Build Failed - Cannot deserialize

.NET obfuscator and automated error reporting

Moderators: Luke Jefferson, melvyn.harbour, dom.smith

Build Failed - Cannot deserialize

Postby ajhartley » Wed Jul 27, 2011 12:36 pm

My project is failing to build in SmartAssembly, giving the error:

Build Failed
The build process failed during the preparation of the resulting assembly.
Cannot deserialize object of type 'System.Collections.Generic.List`1[[Pacific.Core.Descriptor.BaseObjectDescriptor, Interface, Version=2.0.4217.26108, Culture=neutral, PublicKeyToken=9bb46428258d97e6]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089': Object of type 'Type1c2374e4de494253bfb10315d5c66a03[]' cannot be converted to type 'Pacific.Core.Descriptor.BaseObjectDescriptor[]'.

The smart assembly configuration only has error reporting enabled, we do not use obfuscation or dependency merging. The build was working as part of our TFS build process, but just stopped working on one particular changeset. Weirdly, that changeset did not touch the file complained about here!
ajhartley
 
Posts: 2
Joined: Wed Jul 27, 2011 12:27 pm

Postby Brian Donahue » Thu Jul 28, 2011 2:29 pm

Thanks for your post. All we know so far, is the original error occurred because the assembly "Interface" could not be found, so the type conversion could not be done. We had to work this out using a debugger.

After putting the assembly where SmartAssembly could find it, we got an error about a failure to deserialize because the target runtime was newer than the one loaded into the AppDomain created to do the operation.
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby Brian Donahue » Fri Jul 29, 2011 10:44 am

The problem turned out to be that there were some .net 2 resources automatically created by Visual Studio and embedded in the executable. Since the assembly "Interfaces" and the main executable were targeted at .Net 4, the analysis failed. Normally this would only affect the "merging" feature, but due to the way SmartAssembly was designed, this analysis is done regardless of whether you are merging or not.

As a workaround, there is an undocumented switch you can use in the SmartAssembly project file.
Code: Select all
<Options>
    <DoNotUpdateResources />
    ...
</Options>
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am

Postby ajhartley » Fri Jul 29, 2011 10:47 am

I've got this back up and running in our build system using your fix. Thanks for your hard work Brian over the last 2 days!
ajhartley
 
Posts: 2
Joined: Wed Jul 27, 2011 12:27 pm

Postby Brian Donahue » Fri Jul 29, 2011 1:23 pm

I'm glad we were able to get there in the end!
Brian Donahue
 
Posts: 6669
Joined: Mon Aug 23, 2004 10:48 am


Return to SmartAssembly 6

Who is online

Users browsing this forum: No registered users and 0 guests