Microsoft 企业缓存块 + ASP.NET 开发服务器显示奇怪的引用未找到错误

发布于 2024-12-02 19:11:42 字数 2322 浏览 0 评论 0原文

我正在开发一个 ASP.NET 项目,当我从 Visual Studio 查看页面时,我开始遇到这个非常奇怪的错误。 它正在寻找的 Web 引用是一些随机字符串,因此我假设它位于临时 ASP.Net 文件夹中。

确切的错误是:

无法找到程序集“App_WebReferences.uphmdpcs,Version=0.0.0.0,Culture=neutral,PublicKeyToken=null”。 描述:执行当前 Web 请求期间发生未处理的异常。请查看堆栈跟踪以获取有关错误及其在代码中的来源的更多信息。

异常详细信息:System.Runtime.Serialization.SerializationException:无法找到程序集“App_WebReferences.uphmdpcs,版本= 0.0.0.0,文化=中性,PublicKeyToken = null”。

源错误:

第 59 行:公共静态对象 GetD(字符串键) 第 60 行:{ 第 61 行:CacheManager cache = CacheFactory.GetCacheManager("Cache Manager"); 第62行:返回cache.GetData(key); 第 63 行:}

这是堆栈跟踪的一部分:

SerializationException: Unable to find assembly 'App_WebReferences.uphmdpcs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.]
   System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly() +1656829
   System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name) +1641477
   System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable) +120
   System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) +400
   System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum) +62
   System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() +144
   System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +183
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +190
   Microsoft.Practices.EnterpriseLibrary.Caching.SerializationUtility.ToObject(Byte[] serializedObject) +97

我正在使用 Enterprise Library 2007、.Net 2、VS 2005(我也尝试过 2008)、Windows Server 2003。

我尝试在临时 ASP 上授予慷慨的权限。 NET 文件夹到“每个人”作为最后的手段,但这并没有帮助。 以前有人遇到过这样的错误吗?我很困惑。

I'm working on an ASP.NET project and I've started getting this really strange error when I view a page from Visual studio.
The web reference it is looking for is some random string, so I'm assuming it's in the Temporary ASP.Net file folder.

The exact error is:

Unable to find assembly 'App_WebReferences.uphmdpcs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.Runtime.Serialization.SerializationException: Unable to find assembly 'App_WebReferences.uphmdpcs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.

Source Error:

Line 59: public static object GetD(string key)
Line 60: {
Line 61: CacheManager cache = CacheFactory.GetCacheManager("Cache Manager");
Line 62: return cache.GetData(key);
Line 63: }

Here's part of the stack trace:

SerializationException: Unable to find assembly 'App_WebReferences.uphmdpcs, Version=0.0.0.0, Culture=neutral, PublicKeyToken=null'.]
   System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly() +1656829
   System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name) +1641477
   System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable) +120
   System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) +400
   System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryHeaderEnum binaryHeaderEnum) +62
   System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() +144
   System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +183
   System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) +190
   Microsoft.Practices.EnterpriseLibrary.Caching.SerializationUtility.ToObject(Byte[] serializedObject) +97

I'm using Enterprise Library 2007, .Net 2 , VS 2005 (i've tried 2008 too), Windows Server 2003.

I've tried giving generous permissions on the Temporary ASP.NET folder to 'Everyone' as a last resort, but that didn't help.
Has anyone had an error like this before? I'm stumped.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

坏尐絯 2024-12-09 19:11:42

我不确定为什么会发生这种情况,但我发现它与缓存块使用的isolatedStorage有关。可能是因为我们的应用程序退出不干净,所以存储没有清理干净。

临时修复是删除应用程序的isolatedStorage。位置是:

c:\Documents and Settings\YOURUSERNAME\Local Settings\Application Data\IsolatedStorage\

我删除了该路径中的目录,这解决了问题。每次运行失败时我都必须执行此操作,这通常是因为我正在开发中。

是的,该错误似乎与缓存无关,因为它抱怨找不到程序集,但它有效。

I don't know for sure why this is happening, but I found out it's related to the IsolatedStorage being used by the Caching block. It may be that the storage isn't cleaned up since our application is exited uncleanly.

The temporary fix is to delete the IsolatedStorage for the application. The location is:

c:\Documents and Settings\YOURUSERNAME\Local Settings\Application Data\IsolatedStorage\

I removed the directories in that path and that cleared up the issue. I've had to do this everytime the run fails, which is often since I'm in development.

Yes, the error doesn't seem related to the cache since it's complaining about not finding an assembly, but it works.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文