This error often rears its ugly head when compiling an ASP.NET 2.0 Web Deployment Project. At first glance, it is extremely difficult to troubleshoot because there is not much information along with the error. In order to troubleshoot this, you need to use a higher level of verbosity. If you're using MSBuild from the command line you can use the /verbosity switch like this (and then look at Output window for build):
C:\projects>msbuild YourSolutionFile.sln /t:Rebuild /p:Configuration=Release /verbosity:detailed
If you're using Visual Studio, then you can set Tools - Options like this:
Typically the problem is that when aspnet_merge merges the entire web project into a single assembly, you might find naming collisions. By default, asp.net 2005 web site applications do not put a default namespace in the class files so if you create MyPage.aspx in the root and also in a sub-folder, this would causes a conflict when merged into a single assembly for the Release build. This problem would not manifest itself during development because you're not pre-compiling the entire web site into a single DLL so there are several DLLs that make up the web project and naming collisions are avoided. To fix the problem you can obviously either rename one of the classes or provide a namespace to avoid the conflict.