Parser Error - Could not load the assembly 'App_Web_?'

UPDATE: I think my host configured my space with ASP.NET 1.1 instead of 2.0! I’ll see if switching that fixes the problem. :slight_smile:

I’m just beginning to learn C# and ASP.NET 2.0, and I’m find myself running into a serious roadblock. Since I’m new to both C# and .NET it’s very hard for me to troubleshoot the problem, and even days of searching the net for a clue has proven fruitless.

I’m working through some tutorials found on ASP.NET, but I am stuck at ‘codebehind’.

I can get any example to work locally (of course), but I’m finding that I can not get anything to work remotely on my new shared hosting plan.

The error:

[B]Parser Error Message: Could not load the assembly 'App_Web_???????'. Make sure that it is compiled before accessing the page.[/B]

Source Error:


Line 1:  <%@ page language="VB" masterpagefile="~/Default.master" title="Your Name Here | Home" inherits="Default_aspx, App_Web_gphmnbth" stylesheettheme="White" %>
Line 2:
Line 3:  <asp:content id="Content1" contentplaceholderid="Main" runat="server">
 

I have a very simple application with a single codebehind file. Here is the code for default.aspx:

<%@ Page Language="C#" AutoEventWireup="true"  CodeFile="Default.aspx.cs" Inherits="_Default" %>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">

<html xmlns="http://www.w3.org/1999/xhtml" >
<head runat="server">
    <title>Untitled Page</title>
    <link id="Link1" runat="server" rel="stylesheet" href="/css/layout.css" media="screen" />
	<link id="Link2" runat="server" rel="stylesheet" href="/css/style.css"  media="screen" />
</head>
<body>
    <div id="layout">
        <div id="header"><h1>Sovereign Order</h1></div>
        <div id="global_nav"></div>
        <div id="columns">
            <div id="Col_Left">
               <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In vehicula massa sed quam. Nunc vehicula nisl vel magna. Sed in sapien non neque iaculis molestie. Donec fermentum, elit non ultricies dapibus, sem magna tempus nibh, a semper tellus libero nec dolor. Ut molestie, erat ac eleifend ullamcorper, est urna pellentesque dolor, id venenatis metus ante sed neque.</p>
		        <p>Lorem ipsum dolor sit amet, consectetuer adipiscing elit. In vehicula massa sed quam. Nunc vehicula nisl vel magna. Sed in sapien non neque iaculis molestie. Donec fermentum, elit non ultricies dapibus, sem magna tempus nibh, a semper tellus libero nec dolor. Ut molestie, erat ac eleifend ullamcorper, est urna pellentesque dolor, id venenatis metus ante sed neque.</p>
            </div>
            <div id="Col_Center">
                    <div id="news">w

		    <form id="Form1" runat="server">
          <h1>Welcome to ASP.NET 2.0!</h1>
          <b>Enter Your Name:</b>
          <asp:TextBox ID="TextBox1" Runat="server"/>
          <asp:Button ID="Button1" Text="Click Me" OnClick="Button1_Click" Runat="server"/>
          <br />
          <br />
          <asp:Label ID="Label1" Text="Hello" Runat="server" />
        </form>
                    </div>
            </div>
		    <div class="clear"><!-- --></div>
        </div>
    </div>
</body>
</html>

The code for default.aspx.cs:

using System;
using System.Data;
using System.Configuration;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;

public partial class _Default : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {

    }

    protected void Button1_Click(object sender, EventArgs e)
    {
        Label1.Text = "Hello " + TextBox1.Text;
    }
}

Couple of items of interest:

  • I am publishing the site to a local folder, deleting the remote folder entirely, and uploading the local published folder in its entirety (including /bin/*) before each test.

  • I’m new enough to all of this that particular lines of code (such as the “using” statements) are only there becaues they were in the example, not because I understand it.

  • I have tried uploading the compiled files to both my root directory and a subfolder that I have specifically designated as an application starting point. Either way I recieve the error

  • I’ve tried a couple starter projects from Microsoft and I receive the same error.

Is there anyone out there that might have an idea why I’m recieving the error?

It seems ASP.NET 2.0 and Framework 2.0 are missing.

Regards,

You’ll receive this error if your webspace is running framework 1.1 and you try to use 2.0 dll’s or code behind files.

1.1 does not support a number of features introduced in 2.0 including partial classes for code behind files nor does it support deployment of class files in the APP_code folder - all files must be compiled first and placed in a BIN directory. Unfortunately again for compiled class libries to work they must be compiled under 1.1.

Looks like you need to speak to who ever provides your webspace to see if they can use 2.0 of the framework for you.

Hope this provides some insight,

Thanks,

Damien

The problem you are having above is that the “/supplyweb” directory is not marked as an application, yet the \bin directory containing your assemblies is probably contained underneath it. As such, ASP.NET isn’t looking for your assembly in the right place – instead it is looking for it in the \bin directory underneath the root site/application on your system (note how the error message above starts with the text “Server Error in ‘/’ Application”).

To fix this, you should go into the IIS admin tool, right click on the /supplyweb directory and pull up its properties. You’ll then want to make it as an application within IIS (by clicking the “create” button). The assemblies in the \bin directory should then resolve correctly.

Hope this helps,

I am experience a very similar problem.

The web was written with VS2005 and deployed onto the server, which has the ASP.NET set to v2.0.50727 (and there is a c:\windows\Microsoft.NET\Framework\v2.0.50727 folder present on the server)

The web application has been set as an “application”, with script and executable allowed to run.

When I run the application from the same server, I get the message “Parser Error Message: Could not load the assembly ‘App_Web_wpkydqy7’. Make sure that it is compiled before accessing the page” which is followed by “Line 1: <%@ page language=“C#” autoeventwireup=“true” inherits=”_Default, App_Web_wpkydqy7" %>"

I also note the line at the bottom of the page which suspiciously reads “Version Information: Microsoft .NET Framework Version:1.1.4322.2407; ASP.NET Version:1.1.4322.2407”

Any ideas?

Your application might be set to asp.net version 1.1 instead of 2.0, check it in IIS (properties->asp.net tab)

As per my message … “ASP.NET set to v2.0.50727”

Yup, I’ve read that, I just thought I’d mention it, becouse for me it seemed like you’re a 100% sure if there’s a v2.0 directory and the ‘server’s been set to v2.0’ than your application uses 2.0 as well. That’s why I dared to tell you to check the application settings itself, since it might be different than the ‘server’ settings (website).

Also I got this weird error message sometimes when my computer was having some free time and thought it’s time to play a joke on me. Delete temporary files, rebuild application solved it for me. (also I know it sounds strange but I got this error message once when there were some logical errors in my application and instead of throwing and error I always got this message)