1
votes

We have a script that runs to build and deploy our web site that has a command like so: msbuild.exe C:\SOURCE\WebSites\WebSiteName\website.publishproj /p:DeployOnBuild=true /p:PublishProfile="WebSiteName Deploy" /p:VisualStudioVersion=14.0

This was all working fine until we started getting this error. aspnet_merge : error occurred: An error occurred when merging assemblies: ILMerge.Merge: ERROR!!: Duplicate type 'UserControlClassName' found in assembly 'App_Web_usercontrolclassname.ascx.cc671b29

The user control mentioned in the error has not changed. There is not a duplicate in the code. Code involving the control doesn't seem to have changed.

One thing I noticed is that in the publish directory where there used to be one dll, there are now several with names like App_Web_5y43dp11.dll. Including a dll for the usercontrol itself, App_Web_usercontrolclassname.ascx.cc671b29.dll

Any suggestions are greatly appreciated. This has been disrupting our team for days.

1
It's saying that the DLL's being merged together both have a class with the same name - it can't merge that. Your command doesn't show the ilmerge call; are you sure it's attempting to merge the correct DLLs together? - Luke Briggs

1 Answers

1
votes

After a lot of reading around and troubleshooting it appears as if the issue was related to a circular reference involving some of our user controls. Rearranging the way our controls are organized in folders fixed the issue.