Duplicate type 'master' found in assembly

2.4k Views Asked by At

Previously, we were on .net 2.0 and aspnet_merge build was working fine. Now after upgrading to .net 4.0, when we are trying to build our code using aspnet_merge, it throws following error

Duplicate type 'master' found in assembly.

It is a master page and I have throughly checked for duplicacy and there is none..

Plz suggest..

2

There are 2 best solutions below

0
On
0
On

I had a similar issue in VS 2012 with 2 aspx files:

  • Foo_Bar.aspx
  • Foo/Bar.aspx

What fixed it for me was to check off Precompile during publishing. As the screenshot shows, it is set not to merge:

Advanced Precompile Settings

If you still have issues try renaming class in the code-behind (eg, from Foo_Bar to Foo_Bar_Old and update the aspx page tag to match: <%@ Page ... Inherits="Foo_Bar_Old" %>)