Note that there are some explanatory texts on larger screens.

plurals
  1. POWhere does error CS0433 "Type 'X' already exists in both A.dll and B.dll " come from?
    primarykey
    data
    text
    <p>When I run a webapp from Visual Studio 2008 SP1 using the internal web server (not IIS) I receive the above mentioned error.</p> <p>The full error (source file <em>Default.aspx.cs</em>):</p> <blockquote> <p>Compiler Error Message: CS0433: The type 'WebApplication3.Site1' exists in both 'c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\aa563bcf\59deedc0\App_Web_site1.master.cdcab7d2.muczzy9v.dll' and 'c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\aa563bcf\59deedc0\assembly\dl3\44c3a3cf\80dd34ed_6968ca01\WebApplication3.DLL'</p> </blockquote> <p>The preceding full warning:</p> <blockquote> <p>Warning: CS0436: The type 'WebApplication3._Default' in 'c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\aa563bcf\59deedc0\App_Web_default.aspx.cdcab7d2._tlkwdos.0.cs' conflicts with the imported type 'WebApplication3._Default' in 'c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\aa563bcf\59deedc0\assembly\dl3\44c3a3cf\e096e61c_6568ca01\WebApplication3.DLL'. Using the type defined in 'c:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\aa563bcf\59deedc0\App_Web_default.aspx.cdcab7d2._tlkwdos.0.cs'.</p> </blockquote> <p>Source of warning points to an intermediate file <em>App_Web_default.aspx.cdcab7d2._tlkwdos.0.cs</em>:</p> <pre><code>Line 162: Line 163: [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()] Line 164: public class default_aspx : global::WebApplication3._Default, System.Web.IHttpHandler { Line 165: Line 166: private static bool @__initialized; </code></pre> <p>and my question: where does this come from?</p> <p>The webapp (not website!) has one <em>Default.aspx</em> and one <em>Site1.Master</em>, no dependencies. They're almost empty, with an <code>asp:Label</code> on the page. Previously, this webapp worked fine. When I remove any references in Default.aspx.cs to the master, all goes well. The master has some code only.</p> <p>It's actually one of many little fire-and-forget test webapps, so I couldn't care less. But I hadn't seen this before and now I'm curious of what to do, other then copying code into a new project (cleaning solution doesn't help).</p> <p>Note: I've read <a href="https://stackoverflow.com/questions/371426/asp-net-error-the-type-foo-exists-in-both-temp1-dll-and-temp2-dll">this post</a> and some others, they don't apply.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload