title: Compiler Error Message: CS0103: The name 'BusinessLogic' does not exist in the current context
body: <p>Like lot of people, I got CS0103 issue, but I've not found a good solution on the existing topics when working with IIS7.5</p>
  
  <p>The strange thing is:</p>
  
  <ul>
  <li>The site is <strong>working fine under IIS5.1 / XP</strong> (at least, there is not this issue)</li>
  <li>The site is working fine under IIS7.5 Express / XP (when running from Visual Studio 2010)</li>
  <li>The site is <strong>working fine under IIS7.5 Express / W7</strong> (when running from Visual Studio 2010)</li>
  <li>But I've got this error when using IIS7.5 / W7</li>
  </ul>
  
  <p>The class involved in this error is in BusinessLogicWrapper.cs, in the App_Code folder (which <strong>icon is grey in Visual Studio</strong>. Does that mean it is not taken into account? Or it's only because it's a special folder?).</p>
  
  <p>I tried to add at the beginning of SessionProcessing.ashx an <code>include BusinessLogic;</code> but it has not working: the compiler just stop at the 3rd line instead of the 30th, saying it does not know what it has to include...</p>
  
  <p>I thank you for your help,</p>
  
  <hr>
  
  <p>More information:</p>
  
  <ul>
  <li>I am running a Precompiled version of the website</li>
  <li>At the beginning it has been designed for IIS5.1</li>
  </ul>
  
  <hr>
  
  <p><strong>A partial workaround has been to put the bin folder of my virtual directory into the root directory.</strong></p>
  
  <p>Note that I do not have "server errors" anymore (for the moment at least), but that the website is still not working (I think that there is issues with path to the different files...).</p>
  
  <p>This is not a definitive answer (from myself to myself and the others) but perhaps it could give some ideas to more experimented users!</p>
  
  <hr>
  
  <p>The 500 error shown by the website:</p>
  
  <pre><code>Compilation Error
  
  Description: An error occurred during the compilation of a resource required to service this request. Please review the following specific error details and modify your source code appropriately. 
  
  Compiler Error Message: CS0103: The name 'BusinessLogic' does not exist in the current context
  
  Source Error:
  
  
  Line 28:                                 (context.Request.HttpMethod == "POST" &amp;&amp; context.Request.Params["action"] == "DELETE"))
  Line 29:                 {
  Line 30:                     BusinessLogic.Wrapper.WRITE_TRACE(BusinessLogic.TraceLevel.MEDIUM, "SessionProcessing.ashx End session", "sid:" + sid);
  Line 31:                     int res = BusinessLogic.Wrapper.removeSession(sid);
  Line 32: 
  
  Source File: c:\Users\blabla\PrecompiledWeb\Web2\SessionProcessing.ashx    Line: 30 
  </code></pre>
  
  <p>The beginning of the SessionProcessing.ashx:</p>
  
  <pre><code>&lt;%@ WebHandler Language="C#" Class="getsession" %&gt;
  
  using System;
  using System.Web;
  using System.Text;
  
  public class getsession : IHttpHandler, System.Web.SessionState.IReadOnlySessionState
  {
  
      public void ProcessRequest (HttpContext context) {
          context.Response.Clear();
          context.Response.TrySkipIisCustomErrors = true;
  
          String sid = context.Request.Params["sessionid"];
  
          try
          {
              if (sid != null)
              {
                  //###############################################
                  //###############################################
                  if (context.Request.HttpMethod == "DELETE" ||
                                  (context.Request.HttpMethod == "POST" &amp;&amp; context.Request.Params["action"] == "DELETE"))
                  {
                      BusinessLogic.Wrapper.WRITE_TRACE(BusinessLogic.TraceLevel.MEDIUM, "SessionProcessing.ashx End session", "sid:" + sid);
                      int res = BusinessLogic.Wrapper.removeSession(sid);
  </code></pre>
  
  <p>And finally an image of the tree: <a href="http://i.stack.imgur.com/szbhA.png" rel="nofollow">http://i.stack.imgur.com/szbhA.png</a></p>
  
  <hr>
  
  <p>App_Code/BusinessLogicWrapper.cs:</p>
  
  <pre><code>using System;
  using System.Collections.Generic;
  using System.Linq;
  using System.Web;
  using System.Text;
  using System.Runtime.InteropServices;
  
  namespace BusinessLogic
  {
      /// &lt;summary&gt;
      /// Summary description for BusinessLogicWrapper
      /// &lt;/summary&gt;
      public class Wrapper
      {
          //Init
          [DllImport("BusinessLogicLib.dll", CallingConvention = CallingConvention.Cdecl, CharSet = CharSet.Ansi)]
          public static extern int init(string loginFilePath, string remoteServerName, string[] itemsConnection, int cItems);
  </code></pre>
  
  <p>web.config (In reality, there is 9 rules for rewriting)</p>
  
  <pre><code>&lt;?xml version="1.0"?&gt;
  &lt;configuration&gt;
    &lt;system.web&gt;
      &lt;compilation debug="true" targetFramework="4.0"/&gt;
      &lt;httpCookies domain="localhost"/&gt;
    &lt;/system.web&gt;
    &lt;system.webServer&gt;
      &lt;!-- add support for ogg files--&gt;
      &lt;staticContent&gt;
        &lt;mimeMap fileExtension=".oga" mimeType="audio/ogg"/&gt;
        &lt;mimeMap fileExtension=".spx" mimeType="audio/ogg"/&gt;
        &lt;!-- &lt;mimeMap fileExtension=".svg" mimeType="image/svg+xml"/&gt; --&gt;
      &lt;/staticContent&gt;
      &lt;!--Disable gzip compression (otherwise server pushed data is cut when arriving on the client) --&gt;
      &lt;urlCompression doStaticCompression="true" doDynamicCompression="false"/&gt;
      &lt;rewrite&gt;
        &lt;rules&gt;
          &lt;rule name="COW API session creation"&gt;
            &lt;match url="^session$"/&gt;
            &lt;action type="Rewrite" url="SessionProcessing.ashx"/&gt;
          &lt;/rule&gt;
        &lt;/rules&gt;
      &lt;/rewrite&gt;
    &lt;/system.webServer&gt;
  &lt;/configuration&gt;
  </code></pre>