For some reason, after having migrated a BizTalk 2006/Visual Studio 2005 solution to BizTalk 2010/VS 2010 usingthe 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:
- The 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 the SOAP adapter to WCF, and so on).
📝 One-Minute Brief
When building BizTalk solutions in Visual Studio, you may encounter the error: “Cannot generate serialization assembly… because it already exists.” This typically happens during a rebuild because Visual Studio fails to clean up or overwrite the previously generated XmlSerializers.dll in the output folder. The quick fix is to manually delete the bin and obj folders, but the permanent solution involves adjusting the “Generate Serialization Assembly” setting in your project properties.
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 as a result, it 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 can also solve this error by choosing not to generate a Serialization assembly from Project Properties.
- Right-click on the project name and select the Properties option.
- On the left tree option, choose Build tag.
- Under the Output properties, from the drop-down box Generate serialization assembly, select Off.

Hope you find this helpful! If you liked the content or found it useful and would like to support me in writing more, consider buying (or helping to buy) a Star Wars Lego set for my son.
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