Search code examples
asp.netwebformsvs-web-site-project

ASP.NET Web Forms website build error


As I try to build this project, I keep coming up with an error.

Description, where the eight '*' are always something different with every build:

An error occurred when merging assemblies: ILMerge.Merge: ERROR!!: Duplicate type 'myTypeName' found in assembly 'App_Web_********'.

and the file is

aspnet_merge

What do I need to do in order to resolve this (annoying) error?


Solution

  • A couple of things you can try is after right clicking on your project, select Publish Web App. Then under settings (settings for me, might be different for you), find your File Publish Options and click Configure. You'll see the dialog below.

    Try the first or second option, Do not merge OR Do not merge. Create a separate assembly for each page and control

    enter image description here

    I know this is something that has plagued me in the past so good luck. Update us if you find any better or if something better works for you.