Red Gate forums :: View topic - Build Failed - Cannot deserialize
Return to www.red-gate.com RSS Feed Available

Search  | Usergroups |  Profile |  Messages |  Log in  Register 
Go to product documentation
SmartAssembly 6
SmartAssembly 6 forum

Build Failed - Cannot deserialize

Search in SmartAssembly 6 forum
Post new topic   Reply to topic
Jump to:  
Author Message
ajhartley



Joined: 27 Jul 2011
Posts: 2

PostPosted: Wed Jul 27, 2011 12:36 pm    Post subject: Build Failed - Cannot deserialize Reply with quote

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!
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6668

PostPosted: Thu Jul 28, 2011 2:29 pm    Post subject: Reply with quote

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.
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6668

PostPosted: Fri Jul 29, 2011 10:44 am    Post subject: Reply with quote

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:
<Options>
    <DoNotUpdateResources />
    ...
</Options>
Back to top
View user's profile Send private message
ajhartley



Joined: 27 Jul 2011
Posts: 2

PostPosted: Fri Jul 29, 2011 10:47 am    Post subject: Reply with quote

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!
Back to top
View user's profile Send private message
Brian Donahue



Joined: 23 Aug 2004
Posts: 6668

PostPosted: Fri Jul 29, 2011 1:23 pm    Post subject: Reply with quote

I'm glad we were able to get there in the end!
Back to top
View user's profile Send private message
Display posts from previous:   
Reply to topic All times are GMT + 1 Hour
Page 1 of 1

 
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group