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.
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.