title: ASP.NET web application 'Could not load the assembly 'App_Web_'
body: <p>I am trying to deploy my first ASP.NET web application.</p>
  
  <p>So far I have gone to Build > Publish Web Site > Publish to file system and it has created my web application, packaging the .cs files into the bin directory in  a number of .dlls. I have then copied this output to my web server</p>
  
  <p>When developing on my local machine everything has been in the same directory, on the web server my web application is in a sub directory so root/myApplication.</p>
  
  <p>My web.config in the root directory looks like this:</p>
  
  <p></p>
  
  <pre><code>&lt;system.web&gt;
  &lt;customErrors mode="Off"/&gt;
   &lt;compilation batch="false" targetFramework="4.5" /&gt;
    &lt;httpRuntime targetFramework="4.5" /&gt;
  
    &lt;roleManager enabled="false" defaultProvider="MyRoles"&gt;
      &lt;providers&gt;
        &lt;clear /&gt;
        &lt;add name="MyRoles"
             type="MtManagementRoles"
             connectionStringName="ControlConnection" 
             applicationName="/myApplication"/&gt;
      &lt;/providers&gt;
    &lt;/roleManager&gt;
  
    &lt;authentication mode="Forms"&gt;
      &lt;forms loginUrl="myApplication/login.aspx" defaultUrl="myApplication/Home.aspx" name="ControlAuthentication" timeout="30" /&gt;
    &lt;/authentication&gt;
  &lt;/system.web&gt;
  </code></pre>
  
  <p></p>
  
  <p>Whenever I access any .aspx page from my application on the web server I get the following error.</p>
  
  <pre><code> Could not load the assembly 'App_Web_15jywomu'. Make sure that it is compiled before accessing the page.
  &lt;%@ page language="C#" autoeventwireup="true" inherits="Home, App_Web_15jywomu" %&gt;
  </code></pre>
  
  <p>I have seen a number of other similar questions but none had a clear solution. I have noticed in the bin folder created by publishing the site through visual studio, there are two 'Compiled files'. inside these files it mentions virtual file paths. This file path matches my solution name and folder from the visual studio project but not the web server directories. Is this also an issue?</p>
  
  <pre><code>&lt;preserve resultType="6" virtualPath="/WebTest/App_Code/" hash="2c00728f" filehash="" flags="140000" assembly="App_Code" /&gt;
  </code></pre>