问题
We have been having a random issue with our live website. We're not sure what exactly is causing the issue. We tried clearing the temporary files but the issue happened again. We even killed the IIS app_pool so that it wouldn't be holding any of them in memory. As soon as we put the site back up we get this error again.
Compiler Error Message: CS0433: The type 'ASP.modules_dataentry_provider_orderhistory_ascx' exists in both 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\44d35bd0\b13314db\App_Web_orderhistory.ascx.8106afdb.spsukqu_.dll' and 'c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\44d35bd0\b13314db\App_Web_xg5e4m3x.dll'
回答1:
There is not a lot to work with but I think that your deployment of your website went wrong somewhere in the line. You probably only did a overwrite of the folder which could leave old assemblies there. Try to do a clean deploy by first deleting the old assemblies.
回答2:
I ran into this same issue. Usually refreshing the page a few times would clear it out, but ultimately this advice helped out.
Set the compilation configuration to batch = false:
<configuration ...>
<system.web>
<compilation ... batch="false"/>
...
Give it a try and see if it helps.
回答3:
just delete
c:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\44d35bd0\
directory and build again
ASP.NET store compiled dll's into that temp folder, and I guess it create twice in your case
Hope this helps
回答4:
I have had this issue before, and deleting the Debug & Release folders within the obj
directory of my project fixed this for me.
回答5:
A similar error has happened to me with website projects.
As each page's code behind gets compiled into a separate dll, then you move that type to a different page (or even rename the original parent page) sometimes, the remote dll the old type was defined in hangs around. Clearing out the bin directory and redeploying the dll files has solved this for me in the past. Also make sure you don't have any old aspx/ascx referring to this in the website that you no longer have in your project.
回答6:
I had the same issue on my web application and the fix was to change all the "CodeFile" into "CodeBehind"
<%@ Page Language="C#" CodeFile="Default.aspx.cs" MasterPageFile="~/Main.ma ...
To
<%@ Page Language="C#" CodeBehind="Default.aspx.cs" MasterPageFile="~/Main.ma...
来源:https://stackoverflow.com/questions/8447879/duplicate-type-error