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

Viewed 51253

I have just integrated another project pages and its dlls into my existing project's Bin/ folder. My project framework is 3.5. When i am trying to build the project or solution, it's throwing following error:

"The type 'ASP.global_asax' exists in both 'c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\timesheet\15a75c54\898b48b9\assembly\dl3\58b062b2\00ceda54_c98cc801\App_global.asax.DLL' and 'c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\timesheet\15a75c54\898b48b9\App_global.asax.q_h6dbfx.dll' c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\timesheet\15a75c54\898b48b9\App_Web_admin.master.fdf7a39c.zecazgwd.0.cs "

Setting "batch=false" into web.config's is not working. I have also tried to delete all folders from "c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\", then clean and rebuild soultion. But still it's not working.

11 Answers

In my case, i have added in my folder bin a file with name "App_global.asax.compiled" delete only this files and its work.

View Image

What worked for me was

Remove the TARGET BIN folder or empty that folder completely, and then put the newest version of your BIN folder.

Why: In my case after publishing the BIN folder to my "hosting provider" FTP server, the BIN folder was not overwriting the files that needed NOT to be there in this case those mentioned above App_global.asax.dll App_global.asax.compiled

SO by overwriting the whole BIN folder, we assure that the BIN folder is a brand new

this worked for me...

In my case, to solve the problem, I needed to disable the "PrecompileBeforePublish" and delete the bin folder as the image below.

step by step to set

My problem was I referenced .net standard project on my .net framework project, not sure where it got conflicted.

I just Clean Solution and Build Solution then solved!

In my case I have added DLL from local to stage site.This works for me.

enter image description here

Have got recently the same error when publishing site from debug PC onto the server. Changing option to true solved the issue.

<DeleteExistingFiles>True</DeleteExistingFiles>

file ~\Properties\PublishProfiles\FolderProfile.pubxml

Related