| Author |
Message |
ajhartley
Joined: 27 Jul 2011 Posts: 2
|
Posted: Wed Jul 27, 2011 12:36 pm Post subject: Build Failed - Cannot deserialize |
|
|
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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6345 Location: Red Gate Software
|
Posted: Thu Jul 28, 2011 2:29 pm Post subject: |
|
|
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
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6345 Location: Red Gate Software
|
Posted: Fri Jul 29, 2011 10:44 am Post subject: |
|
|
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>
|
_________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
ajhartley
Joined: 27 Jul 2011 Posts: 2
|
Posted: Fri Jul 29, 2011 10:47 am Post subject: |
|
|
| 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 |
|
 |
Brian Donahue
Joined: 23 Aug 2004 Posts: 6345 Location: Red Gate Software
|
Posted: Fri Jul 29, 2011 1:23 pm Post subject: |
|
|
I'm glad we were able to get there in the end! _________________ Brian Donahue
Technical Support
Red Gate Software Ltd.
44 (0)870 160 0037 ext 8521
US and CAN 1-866-RED GATE ext 8521 |
|
| Back to top |
|
 |
|