There is an excellent post on the forum at: http://forums.asp.net/t/980517.aspx
It seems that all that is required is the right bit of code in the web application project, and VS says: “Oh, this is the website project, so I'd rather autocompile it,” and then it crashes when it discovers that it was already compiled as one DLL.
The reasons listed by Darin above are the primary culprits.
Please note that you can get a similar error by accidentally getting two links to the same assembly, double links in the web.config assembly section, or accidentally dropping a duplicate copy of the code file into a folder in the project, but they will usually be pretty obvious if you included debugging in your web.config, and the error message should mention the assembly different from the assembly of the web application {WebAppName} .dll and the assembly with automatic compilation App_Web_ {number} .dll
There are many people who say (in the mentioned topic) that event handlers cause problems, but I think that this is just something strange in the code, which is interpreted as requiring autocompilation. I am in the same boat, I cut and put a whole bunch of example code into my web application and checked all of the above. However, on many pages there is code by which they already have the “Web Form Designer” code, so when I right-click the application on the solution explorer and select "convert to web application", nothing happens. The old code remains there, and dual compilation continues.
Therefore, I would say in addition to these posts: If the code was cut and pasted, and something that the converter does not like, it will not convert it, and double compilation will continue. The only solution is to add offensive pages as new elements, copy the markup and code (as needed), and then delete the old versions.
In my case, I just went to the website for the project, because I could not worry, and it was just a demo project.