ASP.NET - How do I stop classes/dlls from one project being compiled into another project
<p>I have one of those annoying problems where something that used to work stopped working.
Check out this code:</p>

<pre><code>Assembly _abc_assembly = Assembly.LoadFile(“c:\junk\abcabstract\bin\abc.dll”);

ABC.ContentAttribute attribute;
attribute = (ABC.ContentAttribute)_abc_assembly.CreateInstance("ABC.TextAttribute");
</code></pre>

<p>ContentAttribute is defined in the dll.
Obviously, this should work. You should be able to cast an object to itself.</p>

<p>But it produces this error:</p>

<p><img src="http://www.yart.com.au/stackoverflow/compile1.png" alt="alt text" /></p>

<p>This bug is discussed here <a href="http://www.yoda.arachsys.com/csharp/plugin.html" rel="nofollow">http://www.yoda.arachsys.com/csharp/plugin.html</a> which is how I got even this far. From this post I gather that the class ContentAttribute is somehow ending up in ABC.DLL <strong>and</strong> the website project's DLL.</p>

<p>The website project I have looks like this:</p>

<p><img src="http://www.yart.com.au/stackoverflow/compile2.png" alt="alt text" /></p>

<p>Now ContentAttribute is not in this project, it is in the dll ABC.DLL. You can see that as I have expanded every branch and the file ContentAttribute.cs is not there.</p>

<p>Yet somehow it is ending up in the dll for the website creating a duplicating reference. ContentAttribute is somehow ending up in ABC.DLL and the website project's DLL.</p>

<p>Can anyone tell me:</p>

<p>a) Why is ContentAttribute in two dlls? I didn’t think including a dll in a project forced that code into the projects DLL.</p>

<p>b) How to stop it from happening?</p>

<p>By the way, I definitely don't want to change the website project into a website application if I can avoid it.</p>

<p>Notes:</p>

<p>Deleting the temporary ASP.NET files does not work. As soon as I compile my website project they get recreated.</p>

<p><img src="http://www.yart.com.au/stackoverflow/compile3.png" alt="alt text" /></p>
