views:

412

answers:

6

I am seeing the following error in the event log. It is coming from our ASP.Net application. I am having trouble tracking down what is causing the error. Any suggestions appreciated!

  • OS: Windows Server 2000
  • WebServer: IIS 6
  • Application: ASP.Net v3.5

Error Log

[MachineName] has logged the following Error for IIS

Details: ComputerName=[ComputerName] User=Not specified Logfile=Application Type=Error EventType=1 SourceName=ASP.NET 2.0.50727.0 Category=0 CategoryString=Not specified EventCode=1334 EventID=-1073740490 TimeGenerated=20091125101806.000000-360 TimeWritten=20091125101806.000000-360 Message=An unhandled exception occurred and the process was terminated.

Application ID: DefaultDomain Process ID: 1440 Exception: System.Runtime.Serialization.SerializationException Message: Unable to find assembly 'Company.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'.

StackTrace: at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly() at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name) at 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)
at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run() at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm) at System.AppDomain.Deserialize(Byte[] blob) at System.AppDomain.UnmarshalObject(Byte[] blob)

A: 

I'm looking at the text "Unable to find assembly 'Company.Common, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'".

Are you missing an assembly, or do you have a version problem?

DOK
The assembly is present in the bin, it is not signed or versioned. Thanks for the suggestion though.
James
A: 

The error says the assembly can't be found. If it's in the bin folder and correctly formatted, then perhaps it's a permission error?

Does your Company.Common assembly have permissions that allow it to be read by your IIS AppPool identity?

You might also double-check to make sure that the assembly is listed in the system.web / compilation / assemblies section of your web.config.

RickNZ
No unusual permissions are set, they all look standard and work for all other code. It is not in the system.web / compilation / assemblies, but it is not strongly signed or in the GAC and it all compiles fine.
James
Are you doing server-side compilation (as a "web site" project), or client-side compilation ("web application" project)?
RickNZ
+1  A: 

I created a custom unhanded exception module, which allowed retrieval of more information about the origin of the bug, and the eventual resolution of the issue.

Here is a link to a codeplex project that has code for an unhanded exception module: http://unhandledexception.codeplex.com/SourceControl/changeset/view/55373#118549

James
and what was the error?
Jaguar
+1  A: 

Try the IIS Debug Diagnostics tools

http://support.microsoft.com/kb/919789

Joel Etherton
A: 

I'm getting the same error for signed assembly. The strange is my assembly name is "Company.AO.Common.dll"

Evgeny
A: 

@James can you explain what the problem wound up being? I'm seeing this same issue but with the MongoDB.dll assembly from the mongo-csharp project: http://github.com/samus/mongodb-csharp

An unhandled exception occurred and the process was terminated.

Application ID: DefaultDomain

Process ID: 4436

Exception: System.Runtime.Serialization.SerializationException

Message: Unable to find assembly 'MongoDB, Version=0.90.0.1, Culture=neutral, PublicKeyToken=f61bd00ba2535278'.

StackTrace:    at System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name)
   at 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)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record)
   at System.Runtime.Serialization.Formatters.Binary.__BinaryParser.Run()
   at System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(Stream serializationStream, HeaderHandler handler, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage)
   at System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm)
   at System.AppDomain.Deserialize(Byte[] blob)
   at System.AppDomain.UnmarshalObject(Byte[] blob)
tlianza
Tlianza - I think the actual serialization error ended up being misleading, and the actual issue was lack of proper error handling in a new thread that was created in an ASP.Net application. However, it wasn't until i created a custom error module that this was revealed.I have updated my answer with a link to some custom error module. It is very easy to use. Good luck.
James