我有一个.NET Web应用程序,最初运行于.NET 3.5,但将其升级到.NET 4.5.1。当我尝试运行应用程序,我得到以下错误:从.NET 3.5更改为4.5.1导致应用程序不运行
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 63: debugging ASP.NET files.
Line 64: -->
Line 65: <compilation defaultLanguage="c#" debug="true" targetFramework="4.5.1" />
Line 66: <!-- CUSTOM ERROR MESSAGES
Line 67: Set customErrors mode="On" or "RemoteOnly" to enable custom error messages, "Off" to disable.
Version Information: Microsoft .NET Framework Version:2.0.50727.8745; ASP.NET Version:2.0.50727.8745
你可以通过在最后一行看到,这个应用程序仍然使用.NET框架verison 2.0.50727.8745。
我问我的同事在从源代码控制中获取它并运行它之后打开该解决方案,它使用.NET 4.0。*,但他没有看到此错误。这使我相信我的机器出了问题。我查看了applicationhost.config,我甚至没有看到我的应用程序列出,更没有关于它使用的.NET版本的任何内容。为什么它会在他的机器上工作而不是我的?我需要实施一个错误修复程序,如果我无法运行不会发生的应用程序。
你在Visual Studio中调试应用程序吗?如果是这样,它是否设置为IISExpress发布?项目属性 - > Web - >服务器 – Sal
你能详细说明你如何“升级到.net 4.5.1”吗? – DaniDev
这不是我,而是另一个在项目属性中更改.NET Framework版本的开发人员。有一个他希望使用的组件需要使用高于3.5的版本。我们应该在接下来的几个月内将所有的应用程序改为使用.NET 4.7。 – DesertFoxAZ