升级到最新版本的asp.net-5堆栈时,我在尝试访问SignalR中心时遇到了以下堆栈跟踪.
FileNotFoundException: Could not load file or assembly 'Microsoft.AspNet.Security.DataProtection, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified.
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
System.Type.GetType(String typeName, Boolean throwOnError)
Microsoft.AspNet.DataProtection.KeyManagement.XmlKeyManager.ParseKeyElement(XElement keyElement)
Microsoft.AspNet.DataProtection.KeyManagement.XmlKeyManager.GetAllKeys()
Microsoft.AspNet.DataProtection.KeyManagement.KeyRingProvider.CreateCachedKeyRingInstanceUnderLock(DateTime utcNow, CachedKeyRing existingCachedKeyRing)
Microsoft.AspNet.DataProtection.KeyManagement.KeyRingProvider.GetCurrentKeyRing()
Microsoft.AspNet.DataProtection.KeyManagement.KeyRingBasedDataProtector.Protect(Byte[] unprotectedData)
Microsoft.AspNet.SignalR.Infrastructure.DataProtectionProviderProtectedData.Protect(String data, String purpose)
据我所知,这个程序集已经重命名为Microsoft.AspNet.DataProtection,我从aspnet github存储库中看到,这个改变了SEEMS已经在其他项目中掀起了波澜.
我删除了对旧程序集的所有引用,搜索了.k目录的整个内容,我的项目目录,我的GAC,一切.
Avi*_*rry 12
当然,经过4个小时的尝试来解决这个问题后,我在发布问题后立即发现了它的奇怪原因:
为什么淘汰我的整个硬盘驱动器没有任何可能提到旧组件的原因是因为在旧版本的程序集创建的%APPDATA%目录中的XML文件中,它的引用被巧妙地加密了!
使用新的程序集名称升级到新版本时,必须删除目录的内容:%APPDATA%\ Local\ASP.NET\keys-BETA,否则您将收到此错误!此目录中的xml文件包含解密器的程序集限定类名的加密表示形式,该表示形式将使用旧的"Security.DataProtection"程序集而不是新程序集.
| 归档时间: |
|
| 查看次数: |
3785 次 |
| 最近记录: |