4

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" />
1
  • If u can access IIS, check the framework version of your application & try to create a new pool.. Commented May 8, 2015 at 15:08

2 Answers 2

2

I found the solution to my own problem so I will post my solution so that It will hopefully help others.

The solution for me was to move the bin folder from my sub directory (containing my application) into the root directory of my website.

If your application is not in your root directory then try this fix.

Sign up to request clarification or add additional context in comments.

Comments

0

My Solution to Workaround this Problem was Clearing the Checkbox at "Precompile during Publishing" (Publish/Settings)

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.