1

我正在使用最新的DotNetOpenAuth版本。在 localhost 中一切正常。

我看到以下异常消息:

无法将“DotNetOpenAuth.OpenId.Behaviors.AXFetchAsSregTransform”类型的对象转换为“DotNetOpenAuth.OpenId.RelyingParty.IRelyingPartyBehavior”类型

堆栈跟踪是:

at DotNetOpenAuth.Configuration.TypeConfigurationElement1.CreateInstance(T defaultValue, Boolean allowInternals)
at DotNetOpenAuth.Configuration.TypeConfigurationCollection1.<>c__DisplayClass4.<CreateInstances>b__2(TypeConfigurationElement1 element)
at System.Linq.Enumerable.WhereSelectEnumerableIterator2.MoveNext()
at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty..ctor(ICryptoKeyStore cryptoKeyStore, INonceStore nonceStore)
at DotNetOpenAuth.OpenId.RelyingParty.OpenIdRelyingParty..ctor()
at Ideiota.WebApp.Modules.Login.HandleOpenIdProviderResponse()
at Ideiota.WebApp.Modules.Login.Page_Load(Object sender, EventArgs e)
at System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e)
at System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e)
at System.Web.UI.Control.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint);`
4

2 回答 2

3

对于遇到此问题的其他任何人,这就是我遇到的问题。升级到这个新版本(在我的例子中是通过 NuGet)添加了一些新配置,但没有删除旧的和无效的配置。

在你的Web.config

<!-- old and invalid, remove this line -->
<add type="DotNetOpenAuth.OpenId.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth" />
<!-- keep this new line -->
<add type="DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform,
           DotNetOpenAuth.OpenId.RelyingParty" />
于 2012-07-15T16:57:29.177 回答
0

但是错误在配置文件中。新版本有变化...

于 2012-04-20T13:37:01.847 回答