I am trying to deploy my first ASP.NET web application.
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
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.
My web.config in the root directory looks like this:
<system.web>
<customErrors mode="Off"/>
<compilation batch="false" targetFramework="4.5" />
<httpRuntime targetFramework="4.5" />
<roleManager enabled="false" defaultProvider="MyRoles">
<providers>
<clear />
<add name="MyRoles"
type="MtManagementRoles"
connectionStringName="ControlConnection"
applicationName="/myApplication"/>
</providers>
</roleManager>
<authentication mode="Forms">
<forms loginUrl="myApplication/login.aspx" defaultUrl="myApplication/Home.aspx" name="ControlAuthentication" timeout="30" />
</authentication>
</system.web>
Whenever I access any .aspx page from my application on the web server I get the following error.
Could not load the assembly 'App_Web_15jywomu'. Make sure that it is compiled before accessing the page.
<%@ page language="C#" autoeventwireup="true" inherits="Home, App_Web_15jywomu" %>
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?
<preserve resultType="6" virtualPath="/WebTest/App_Code/" hash="2c00728f" filehash="" flags="140000" assembly="App_Code" />