Thursday, July 7, 2011

Fixing error "Cannot generate serialization assembly"

Recently on my development machine I faced this error in Visual Studio. The error occurred at the build a project, and that project is already in use on the local machine.
Now, the problem here is, out the error message nothing clearly come out. After further research I found that the output dll is already present in GAC and after removing that dll, the project showed successful build.


Cheers!!
Somu

3 comments:

Tom_HR said...
This comment has been removed by the author.
Tom_HR said...
This comment has been removed by the author.
Tom_HR said...

To share the solution I developed:
a) Double-click on the "Properties" within your project in Solution Explorer
b) Navigate to the "Build Events" tab
c) Add the following pre-build event command (replace [PROJNAME] with the name of your project):
if exist $(ProjectDir)\[PROJNAME].XmlSerializers.dll del $(ProjectDir)\[PROJNAME].XmlSerializers.dll
d) Save and build your project