Asp.net mvc 3 ASP.NET MVC 3-DotNetOpenAuth-System.Security.SecurityException

Asp.net mvc 3 ASP.NET MVC 3-DotNetOpenAuth-System.Security.SecurityException,asp.net-mvc-3,dotnetopenauth,shared-hosting,securityexception,Asp.net Mvc 3,Dotnetopenauth,Shared Hosting,Securityexception,我正在尝试建立一个简单的网站,它使用DotNetOpenAuth作为其会员提供商。一切都很顺利,直到我遇到以下例外 [SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.] System.Security.CodeAc

我正在尝试建立一个简单的网站,它使用DotNetOpenAuth作为其会员提供商。一切都很顺利,直到我遇到以下例外

[SecurityException: Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.]
    System.Security.CodeAccessSecurityEngine.Check(Object demand, StackCrawlMark& stackMark, Boolean isPermSet) +0
    System.Security.CodeAccessSecurityEngine.Check(CodeAccessPermission cap, StackCrawlMark& stackMark) +31
    System.Security.CodeAccessPermission.Demand() +46
    System.Net.Configuration.DefaultProxySection.PostDeserialize() +103
代码如下。不幸的是,我无法在本地计算机上重现该问题。这是在GoDaddy共享主机上托管的。导致异常的行是
openid.CreateRequest(id)

我已尝试更改的
requirecommission
属性

<section name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection" requirePermission="false" allowLocation="true" />


但这只会导致异常堆栈跟踪的根不同。在web上几乎找不到有关此异常的信息。

这似乎是因为您有一个包含以下代码段的web.config:

<system.net>
    <defaultProxy enabled="true" />
</system.net>


尝试删除
标记,这在GoDaddy上应该是不必要的。

这似乎是因为您有一个包含以下代码段的web.config:

<system.net>
    <defaultProxy enabled="true" />
</system.net>


尝试删除
标记,这在GoDaddy上应该是不必要的。

我从nuget获得了该软件包,从软件包描述中可以看出它是版本3.4.6.10357。我可以给你任何其他你想要的信息。太好了。无论如何,我误读了你问题中的错误信息。我已经更新了我的答案。我从nuget获得了这个包,从包的描述来看它是3.4.6.10357版本。我可以给你任何其他你想要的信息。太好了。无论如何,我误读了你问题中的错误信息。我已经更新了我的答案。