asp.net - 将 aspNetCompatibilityEnabled 设置为 true 会在

在我的应用程序的 web.config 中。在某些服务器上,如果我设置 aspNetCompatibilityEnabled=true

<serviceHostingEnvironment aspNetCompatibilityEnabled="true" />

我得到“MethodAccessException”。我需要使用 aspNetCompatibilityEnabled。因为,我希望此调用由我们的 HttpModule 之一进行身份验证。我用谷歌搜索了所有没有找到答案的地方。似乎有一个 IIS 设置可以修复它。因为,它在一些内部环境中工作。

最佳答案

你试过把:

[AspNetCompatibilityRequirements(RequirementsMode = AspNetCompatibilityRequirementsMode.Allowed)] 

在您的服务等级声明之上?

关于asp.net - 将 aspNetCompatibilityEnabled 设置为 true 会在基于 REST 的 JSON WCF 服务中抛出 MethodAccessException,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/4620982/

相关文章:

asp-classic - 我应该总是使用 connection.close

asp.net-mvc-2 - ASP.NET MVC 2 授权问题

wcf - 注入(inject) WCF REST 服务

networking - 谷歌 API 速率限制

wpf - Visual Studio 2010 中WPF 设计器的选择工具在哪里?

svn - 如何使用 TortoiseSVN 标记多个文件

authentication - cakephp 基于组的权限

dynamic-language-runtime - 关于DLR call site缓存的一些问题

sql - 使用 T-SQL 的 SQL Server 中的 Cast 和 Convert 函数有什

gwt - 如何从 GWT 中的代码单击 anchor ?