title: Asp.net calling C# layer calling Managed C++ calling Native C++
body: <p>My project structure is as follow:</p>
  
  <p><strong>ASP.NET</strong> calling <strong>C#</strong> layer calling <strong>Managed</strong> C++ calling <strong>Native</strong> C++
  <em>(i'm trying to avoid using interop so this is why the managed c++ layer)</em>
  I wrote  unit test that test the C# layer and it works fine.
  When I try to run the asp.net page i'm getting: <code>"Could not load file or assembly..."</code> error.
  I figured out that when i copy paste the <strong>Native C++</strong> dll to "Temporary ASP.NET Files" (to the corresponding folder) the site works.</p>
  
  <p>It seems that the <strong>Managed C++</strong> code can find the <strong>Native C++</strong> code only if it resides in the same folder - obviously I can't have my Native dll in the temp files.</p>
  
  <p>Is there a way to set the Native in a global place(doesn't work with System32)?</p>
  
  <p>Thanks for you comments.</p>
  
  <h2>It boils down to one option:</h2>
  
  <ol>
  <li>It is security issue</li>
  </ol>
  
  <p>i set up the server it self with the code and it runs under the cassini, but when i publish it(to run under iis7) i'm getting "Could not load file or assembly ...."
  i'm running IIS7 with ApplicationPoolIdentity , .net 4 Integrated 
  Thanks a lot,
  Pini.</p>