For some reason after having migrated a BizTalk 2006/Visual Studio 2005 solution to BizTalk 2010/VS 2010 using Visual Studio Conversion Wizard, I got the following error:
“Cannot generate serialization assembly {AssemblyName}.XmlSerializers.dll because it already exists. Use /force to force an overwrite of the existing assembly”
The migration of this project was divided into two parts:
- First part is to migrate the project as is to the new environment in order to discontinue the old platform;
- The second part is to improve the project with new functionalities available in the new version (migrate SOAP adapter to WCF and so on);
Cause
The XML Serializer Generator creates an XML serialization assembly for types in a specified assembly in order to improve the startup performance of an XmlSerializer when it serializes or deserializes objects of the specified types.
However, sometimes if you have a traditional Web Service reference in your BizTalk Project this error may suddenly appear. It seems that when you try to build the solution the SGEN process is having some trouble deleting the original XMLSerializers.dll and in result will give you that error.
Solution 1
This problem can be solved by:
- Going to the path “%windir%\Microsoft.NET\assembly\” (.NET 4.0) or “C:\WINDOWS\assembly” (if you use the previous version of .NET) and uninstall the corresponding Project name DLL from there.
- And then rebuild the Project.
Limitation: each time you deploy the DLL to the GAC, the next time you need to build the project you first need to uninstall the DLL from the GAC
Solution 2
You also can solve this error by choosing not to generate a Serialization assembly from Project Properties.
- Right-click on the project name and select “Properties” option
- On the left tree option, choose “Build” tag
- Under the Output properties, from the drop box “Generate serialization assembly” select “Off”
Valuable information. I have run into the issue several times.
Greate, it worked,, thanks
thanks
Many thanks for this share.
In my case, i had to restart the server and than add the missing DLL to the Resources folder of the Application.
Perfect; thanks!
Thanks! Very userful tips
worked like a charm. ty
You saved my bacon today! Good job.
Glad I help