views:

884

answers:

5

I am a developer and am trying to create a very basic "Hello World" .NET 3.5 web app. However, whenever I publish the code I am getting the following error.

Parser Error

Description: An error occurred during the parsing of a resource required to service this request. Please review the following specific parse error details and modify your source file appropriately. 

Parser Error Message: Could not load the assembly 'App_Web_default.aspx.cdcab7d2'. Make sure that it is compiled before accessing the page.

Source Error: 


Line 1:  <%@ page language="C#" autoeventwireup="true" inherits="_Default, App_Web_default.aspx.cdcab7d2" %>
Line 2:  
Line 3:  <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd"&gt;

Here are the steps I'm taking.

  • Open VS2008 and create a new website using C# and .NET Framework 3.5.
  • Update Default.aspx to say "Hello World"
  • Make the following changes to web.config ** add <customErrors mode="Off"/> ** comment out <authentication mode="Windows" />
  • Publish the site, checking the boxes for "Allow this precompiled site to be updateable" and "Use fixed naming and single page assemblies"

What I would like to know is if this is something I am doing wrong or something our web admins have setup incorrectly.

Would/could it have anything to do with where the /bin directory is located?

+1  A: 
Natrium
I do not have access to this. Hence, I do not know. Is there anyway to tell what version it is running?
Jason
@Natrium: you did notice the title of the question, right? ;o)
Fredrik Mörk
yeah, I noticed. But perhaps not the installation is the problem, but the configuration in IIS.
Natrium
From the error message, does it seem like a problem with the version, or could I have my settings wrong someplace.
Jason
+2  A: 

Here is a post from MSDN:

http://msdn.microsoft.com/en-us/kb/kb00318785.aspx

Jeremy Sullivan
I don't have access to check in those areas. However, from the errors does it seem like it is a problem with the version?
Jason
It's hard to tell from the data that you have available to you. You will need to ask your Network Admin to check the versioning and updates for you if you don't have access.
Jeremy Sullivan
In reference to the fact that is says at the bottom of your error message that you are in .Net 2.05, there really isn't an ASP.net 3.0 or 3.5. All .Net 3.5 code runs under the heading of Asp.Net 2.0. .Net 3.0 and 3.5 are just additional features really. So, you can't tell by that.
Jeremy Sullivan
A: 

I would start by publishing the site without pre-compilation first. If it still does not work, then work with your web admin to check the following:

You can see which versions of .net are installed by looking in:

C:\Windows\Microsoft.NET\Framework

You should have a folder for every version of the framework installed, for example:

v1.0.3705
v1.1.4322
v2.0.50727
v3.0
v3.5

If IIS was installed after .net 2.0, you may need to run aspnet_regiis to install or repair the .net IIS installation:

C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis -i

Please note that in IIS you will only see v1.1.4322 and v2.0.50727 in the framework dropdown (.net v3 and v3.5 use the v2.0 runtime). Your site will need v2.0.50727 selected.

You will also want to make sure that the account your web app is running under (usually Network Service on servers) has the correct permissions on the folder that contains your web app files (read should be sufficient for your test).

Jimmie R. Houts
+2  A: 

If you do not have access rights to the deployment server, best way to learn the framework version which your application running is to look at the bottom of the common ASP.NET error page. You can find the Framework version like that :

Version Information: Microsoft .NET Framework Version:2.0.50727.3053; ASP.NET Version:2.0.50727.3053

Canavar
Pefect, exactly what I was looking for. Mine does in fact say 2.0.5.... However, that should be that 3.5 should work as it uses the 2.0 runtime correct?
Jason
Yes, if it says 2.0 you asp.net application is running under asp.net 2.0.
Canavar
A: 

The problem actually was that our web admins set up the site at a higher directory then what I thought. Therefore, when I published the site, the bin folder was not at the root of the site. That is why the files could not be found.

Jason