6

This issue happens seemingly randomly after publishing. The site will work fine and then bam, I get this error parsing the webconfig. I just republish and it works fine for a bit again. When publishing, I checked the box to remove existing files so there shouldn't be garbage laying around.

This is an MVC4 project using .net 4.5 and Azure Access Control Service (ACS) integrated with Yahoo!. This error occurs when redirecting back from Yahoo. This way happening every time, but I found a post (which I can not find now, of course) where there was a bug with the 4.5.1 Identity and Access Visual Studio integration. I went to the previous version and now it's only sometimes.

ID8030: The value of the 'type' property could not be parsed.
Verify that the type attribute of '<issuerNameRegistry type="System.IdentityModel.Tokens.ValidatingIssuerNameRegistry, System.IdentityModel.Tokens.ValidatingIssuerNameRegistry"><authority name="[my authority]"><keys><add thumbprint="[print]" /></keys><validIssuers><add name="[issuer]" /></validIssuers></authority></issuerNameRegistry>' element is correct.

In the above error message, I have replaced the items in brackets ([]) for this post.

Here is the stack trace:

[TypeLoadException: ID8030: The value of the 'type' property could not be parsed. *** element is correct.]
System.IdentityModel.Configuration.TypeResolveHelper.Resolve(ConfigurationElementInterceptor customTypeElement, Type customType) +602659
System.IdentityModel.Configuration.IdentityConfiguration.GetIssuerNameRegistry(IssuerNameRegistryElement element) +114
System.IdentityModel.Configuration.IdentityConfiguration.LoadHandlerConfiguration(IdentityConfigurationElement element) +841
System.IdentityModel.Configuration.IdentityConfiguration.LoadConfiguration(IdentityConfigurationElement element) +117
System.IdentityModel.Configuration.IdentityConfiguration..ctor(String identityConfigurationName) +180
System.IdentityModel.Services.Configuration.FederationConfiguration.LoadConfiguration(FederationConfigurationElement element) +392
System.IdentityModel.Services.Configuration.FederationConfiguration..ctor(Boolean loadConfig) +94
System.IdentityModel.Services.FederatedAuthentication.CreateFederationConfiguration() +71
System.IdentityModel.Services.FederatedAuthentication.get_FederationConfiguration() +85
System.IdentityModel.Services.HttpModuleBase.Init(HttpApplication context) +56
System.Web.HttpApplication.RegisterEventSubscriptionsWithIIS(IntPtr appContext, HttpContext context, MethodInfo[] handlers) +418
System.Web.HttpApplication.InitSpecial(HttpApplicationState state, MethodInfo[] handlers, IntPtr appContext, HttpContext context) +172
System.Web.HttpApplicationFactory.GetSpecialApplicationInstance(IntPtr appContext, HttpContext context) +336
System.Web.Hosting.PipelineRuntime.InitializeApplication(IntPtr appContext) +296

[HttpException (0x80004005): ***... element is correct.]
System.Web.HttpRuntime.FirstRequestInit(HttpContext context) +9873784
System.Web.HttpRuntime.EnsureFirstRequestInit(HttpContext context) +101
System.Web.HttpRuntime.ProcessRequestNotificationPrivate(IIS7WorkerRequest wr, HttpContext context) +254
4

3 回答 3

17

我在本地运行时遇到了同样的问题。我正在浏览此处找到的操作方法:http: //msdn.microsoft.com/en-us/library/jj161104.aspx,并且会在该程序集上收到未找到类型的错误。

我仔细检查以确保我通过 NuGet 拉下程序集,甚至卸载并重新安装它......没有骰子。 它基本上归结为缺少对 System.IdentityModel.Tokens.ValidatingIssuerNameRegistry 的引用

因此,如果您确实通过NuGet将其拉下来并且仍然存在问题,请记住,当 NuGet 删除此包时,它会将其扔到文件系统中位于解决方案级别的包文件夹中。

如果您的项目没有显示对System.IdentityModel.Tokens.ValidatingIssuerNameRegistry的引用,请通过右键单击项目将程序集添加到项目中,选择添加引用、浏览,然后单击浏览按钮,然后向上浏览到包文件夹并找到 dll ( [Your Solution Root]packages\System.IdentityModel.Tokens.ValidatingIssuerNameRegistry.4.5.1\lib\net45 ) 并添加它。

我希望这有帮助。

于 2013-09-18T22:44:11.717 回答
2

我遇到了同样的问题,但对我来说它是恒定的,而不是零星的,所以可能是一个不同的根本问题。

我能够通过在我的 MVC 4 项目中安装以下 NuGet 包来解决这个问题: http ://www.nuget.org/packages/System.IdentityModel.Tokens.ValidatingIssuerNameRegistry/

我不记得这是否默认添加到新的 MVC 4 项目中。我曾一度删除它,所以也许它可能已经被删除然后重新安装解决了这个问题。无论哪种方式,通过添加上面的包,我能够让我的 MVC 4 项目与 ACS 一起正确工作。

希望它也适用于你。

于 2013-09-15T20:44:10.930 回答
0

我只是有同样的问题。解决它的一种方法是添加对其他帖子中指定的 DLL 的引用。

另一种选择是用这个替换部分,它使用核心 .Net Framework 4.5 中可用的类(您也必须添加对 System.IdentityModel 的引用):

<issuerNameRegistry type="System.IdentityModel.Tokens.ConfigurationBasedIssuerNameRegistry, System.IdentityModel, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089">
  <trustedIssuers>
    <add thumbprint="[print]" name="[issuer]" />
  </trustedIssuers>
</issuerNameRegistry>
于 2014-01-22T17:00:09.683 回答