ASP.NET - Accessing copied content
<p>I have a class library project which contains some content files configured with the "Copy if newer" copy build action.  This results in the files being copied to a folder under <code>...\bin\</code> for every project in the solution.  In this same solution, I've got a ASP.NET web project (which is MVC, by the way).  In the library I have a static constructor load the files into data structures accessible by the web project.  Previously I've been including the content as an embedded resource.  I now need to be able to replace them without recompiling.  I want to access the data in three different contexts:</p>

<ol>
<li>Unit testing the library assembly</li>
<li>Debugging the web application</li>
<li>Hosting the site in IIS</li>
</ol>

<p>For unit testing, <code>Environment.CurrentDirectory</code> points to a path containing the copied content.  When debugging however, it points to <code>C:\Program Files\Microsoft Visual Studio 9.0\Common7\IDE</code>.  I've also looked at <code>Assembly.GetExecutingAssembly().Location</code> which points to <code>C:\Windows\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\c44f9da4\9238ccc\assembly\dl3\eb4c23b4\9bd39460_f7d4ca01\</code>.  What I need is to the physical location of the webroot <code>\bin</code> folder, but since I'm in a static constructor in the library project, I don't have access to a <code>Request.PhysicalApplicationPath</code>.</p>

<p>Is there some other environment variable or structure where I can always find my "Copy if newer" files?</p>
