this has been answered on different forums, but i have tried all the solution none of them works
this is what i have tried so far
added batch="false" attribute within compilation section of the web.config
removed App_global.asax.dll file from bin
removed temp files from C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files- although they keep getting generated
did clean and re build solution
Error : the type 'ASP.global_asax' exists in both
'c:\Users\username\AppData\Local\Temp\Temporary ASP.NET Files\root\00fc2357\712b6e00\assembly\dl3\ffed6c98\9dede25f_09c2cf01\SLIC.Website.Deployment.DLL'
and 'c:\Users\username\AppData\Local\Temp\Temporary ASP.NET Files\root\00fc2357\712b6e00\App_global.asax.y_m8p2iy.dll'
protected ASP.global_asax ApplicationInstance {
Line 23: get {
Line 24: return ((ASP.global_asax)(this.Context.ApplicationInstance));
Try checking you publish settings. It might include the setting Precompile during publishing
.
In the cases where I have experienced this, disabling this in my publish settings was the solution.
Kindly remove below files from bin folder. App_global.asax.dll App_global.asax.compiled
Here is another solution,
In your ISS virtual directory delete the BIN folder, then clean and rebuild your project and make new build/publish.
This solution is work for me using ASP.NET MVC 5, Entity Framework 6, Framework 4.6 and IIS 7.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With