How to reference source file outside of project folder in ASP.NET
<p>I've got a solution with 2 different project. 1 project contains an asp.net web forms app and the other is a winforms app. They share some class files between them. </p>

<ul>
<li>The asp.net app lives in MSDSExpress\MSDSExpress</li>
<li>The winforms app is in MSDSExpress\ReportDesigner</li>
<li>The shared code goes in MSDSExpress\SharedCode</li>
</ul>

<p>I add the shared code files to the winforms project by right-clicking the project and selecting "Add Existing Item", then I add the code files as links. I do the same thing in the web app, but I add them to the App_Code solution folder (although I understand that the files are not actually copied to the physical App_Code folder).</p>

<p>Both apps compile fine and the winforms app runs fine. However, when I try accessing the asp.net home page in the browser I get a compilation error message that says one of my shared classes isn't defined. There is no error when starting the project and no error from the VS debugger, but the error is served back to the browser.</p>

<p>I don't even have an App_Code directory on my deployment server, so I can't think that not having the file physically in the App_Code folder is the problem. The Build Action of the code file is set to Compile for both projects. I know that putting these classes in a new class library project would probably solve the problem, but does anyone know why I can't do it this way?</p>