我怎么知道是否安装了正确的.NET框架?

时间:2021-08-19 07:11:14

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.

我是一名开发人员,正在尝试创建一个非常基本的“Hello World”.NET 3.5 Web应用程序。但是,每当我发布代码时,我都会收到以下错误。

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">

Here are the steps I'm taking.

这是我正在采取的步骤。

  • Open VS2008 and create a new website using C# and .NET Framework 3.5.
  • 打开VS2008并使用C#和.NET Framework 3.5创建一个新网站。

  • Update Default.aspx to say "Hello World"
  • 将Default.aspx更新为“Hello World”

  • Make the following changes to web.config ** add <customErrors mode="Off"/> ** comment out <authentication mode="Windows" />
  • 对web.config进行以下更改**添加 **注释掉

  • 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?

它/可能与/ bin目录所在的位置有关吗?

5 个解决方案

#1


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 :

如果您没有部署服务器的访问权限,那么了解运行应用程序的框架版本的最佳方法是查看常见ASP.NET错误页面的底部。你可以找到这样的Framework版本:

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

版本信息:Microsoft .NET Framework版本:2.0.50727.3053; ASP.NET版本:2.0.50727.3053

#2


Here is a post from MSDN:

这是来自MSDN的帖子:

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

#3


Are you using the correct .NET-version in IIS ?

您是否在IIS中使用正确的.NET版本?

The version in the combobox must be correct: (screenshot only showing .NET 1.1 & 2.0)

组合框中的版本必须正确:(屏幕截图仅显示.NET 1.1和2.0)

alt text http://helpdesk.nucleus.be/content/installatie-van-dot-net-3-5/iis_dot_net_3_5.jpg

alt text http://helpdesk.nucleus.be/content/installatie-van-dot-net-3-5/iis_dot_net_3_5.jpg

#4


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:

您可以通过查看以下内容查看.net的安装版本:

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:

如果在.net 2.0之后安装了IIS,则可能需要运行aspnet_regiis来安装或修复.net IIS安装:

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.

请注意,在IIS中,您只能在框架下拉列表中看到v1.1.4322和v2.0.50727(.net v3和v3.5使用v2.0运行时)。您的网站需要选择v2.0.50727。

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).

您还需要确保您的Web应用程序运行的帐户(通常是服务器上的网络服务)对包含您的Web应用程序文件的文件夹具有正确的权限(读取应该足以进行测试)。

#5


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.

问题实际上是我们的网站管理员将网站设置在更高的目录然后我的想法。因此,当我发布该站点时,bin文件夹不在站点的根目录下。这就是无法找到文件的原因。

#1


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 :

如果您没有部署服务器的访问权限,那么了解运行应用程序的框架版本的最佳方法是查看常见ASP.NET错误页面的底部。你可以找到这样的Framework版本:

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

版本信息:Microsoft .NET Framework版本:2.0.50727.3053; ASP.NET版本:2.0.50727.3053

#2


Here is a post from MSDN:

这是来自MSDN的帖子:

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

#3


Are you using the correct .NET-version in IIS ?

您是否在IIS中使用正确的.NET版本?

The version in the combobox must be correct: (screenshot only showing .NET 1.1 & 2.0)

组合框中的版本必须正确:(屏幕截图仅显示.NET 1.1和2.0)

alt text http://helpdesk.nucleus.be/content/installatie-van-dot-net-3-5/iis_dot_net_3_5.jpg

alt text http://helpdesk.nucleus.be/content/installatie-van-dot-net-3-5/iis_dot_net_3_5.jpg

#4


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:

您可以通过查看以下内容查看.net的安装版本:

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:

如果在.net 2.0之后安装了IIS,则可能需要运行aspnet_regiis来安装或修复.net IIS安装:

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.

请注意,在IIS中,您只能在框架下拉列表中看到v1.1.4322和v2.0.50727(.net v3和v3.5使用v2.0运行时)。您的网站需要选择v2.0.50727。

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).

您还需要确保您的Web应用程序运行的帐户(通常是服务器上的网络服务)对包含您的Web应用程序文件的文件夹具有正确的权限(读取应该足以进行测试)。

#5


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.

问题实际上是我们的网站管理员将网站设置在更高的目录然后我的想法。因此,当我发布该站点时,bin文件夹不在站点的根目录下。这就是无法找到文件的原因。