【问题标题】:Setting up an ASP.NET website设置 ASP.NET 网站
【发布时间】:2013-07-24 23:15:00
【问题描述】:

我正在尝试为我的新业务Antech 设置一个网站,但我似乎无法让我的登陆站点指向“Default.aspx”。我是否必须使用 IIS,如果需要,IIS Express 是否可以工作?我在我的 Web.config 文件中不断出现以下错误(要查看实际错误,您可以访问我的网站 here):

Server Error in '/' Application.

Configuration Error

Description: An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: Unrecognized attribute 'targetFramework'. Note that attribute names are case-sensitive.

Source Error: 


Line 24:   </connectionStrings>
Line 25:   <system.web>
Line 26:     <compilation debug="true" targetFramework="3.5">
Line 27:       <assemblies>
Line 28:         <add assembly="System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=B77A5C561934E089"/>

Source File: \\boswinfs07\home\users\web\b341\dom.antechdevelopmen\web.config    Line: 26 

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

提前感谢您的帮助!

【问题讨论】:

  • 当您从第 26 行删除 targetFramework 内容时会发生什么?
  • 请不要发布死链接。可能它是一个只有您可以访问的仅限开发人员的网站。
  • 至于问题,由于某种原因,您的web.config 文件是为高于您安装的.NET 版本编写的。
  • @til_b 它开始检查我的 .dll 文件并抛出错误。
  • @Shadow Wizard,很抱歉,我不知道您所说的死链接是什么意思,谢谢!

标签: asp.net iis web


【解决方案1】:

这可能是因为两个原因:

  • 您网站的应用程序池可以设置为.net framework 2.0

  • .Net 4.0 未安装在您的计算机上。

尝试将您的应用程序池更改为 4.0。

如果应用程序池没有列出 4.0 框架,您可能需要注册它。同样按照下面的链接显示如何做到这一点。

https://stackoverflow.com/a/4890368/309395

【讨论】:

  • 谢谢,但是如何打开我的应用程序池?
  • 请通过this链接
  • 好的,谢谢,我现在将其更改为 4.0,并且该错误消失了,但显然我的某些脚本仍然与 4.0 不兼容。如何使它们兼容?查看确切的错误点击here
  • 请原谅我,但我不确定什么不起作用,控制台中没有客户端错误。
【解决方案2】:

您的应用程序池似乎设置为 .Net framework 2.0。 targetFramework 属性仅在 .Net 4.0 中引入。您可以从配置文件中手动删除 targetFramework="3.5",或者将您的应用程序池更改为 .Net framework 4.0

来自http://msdn.microsoft.com/en-us/library/bb398791.aspx

当您将项目升级到 .NET Framework 4 时,Visual Studio 会自动插入 targetFramework 属性。当您将项目的目标从 .NET Framework 4 更改为早期版本时,它会删除该属性。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-02-27
    • 2017-05-28
    • 1970-01-01
    • 2016-08-12
    • 2017-04-17
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    相关资源
    最近更新 更多