Compilation Error: The type 'ASP.global_asax' exists in both DLLs

In my case the problem was caused by accidentional removal of "PrecompiledApp.config". As soon as i returned the file everything started working normally.


I suggest you go to the path: C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files and clear the all the temporary files of your application, build your solution, and then run it!


In my case the problem occurred in a virtual application's bin folder. Looking into this bin-folder you will probably see two files (an information I found here):

  • App_global.asax.dll
  • App_global.asax.compiled

Removing these resolves the error. The App_global.asax.dll is generated at runtime too which causes the problem. I am however still investigating how these files got there, so comments are definitely welcome!

Tags:

C#

.Net

Asp.Net

Dll