【问题标题】:Server error "could not load type application.global" on new .net application服务器错误“无法在新的 .net 应用程序上加载类型 application.global”
【发布时间】:2019-04-29 21:19:42
【问题描述】:

这让我发疯了,我有一台带有 vs studio 2017 和 iss Express 的 Windows 10 机器,当我创建一个新的 .net Web 应用程序项目(.net 框架)并运行它而不修改任何东西时,我得到了这个在浏览器上:

Server Error in '/' Application.
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 type 'WebApplication2.Global'.
Source Error: 

Line 1:  <%@ Application Codebehind="Global.asax.cs"  Inherits="WebApplication2.Global" Language="C#" %>
Source File: /global.asax    Line: 1 

Version Information: 
Microsoft .NET Framework Version:4.0.30319; 
ASP.NET Version:4.7.3160.0

我开始什么类型的项目并不重要。

已经尝试清理和重建,将构建文件夹设置为 bin/ 和 bin/debug,并在 .asax 文件上通过 CodeFile 更改“Codebehind”,但它始终相同,我相信我需要配置一些东西或安装,但对于我来说,我无法弄清楚。

问题:

1.这个错误的原因是什么?

2.我需要安装什么才能在本地运行 .net Web 应用程序?`

`

【问题讨论】:

    标签: .net asp.net-mvc visual-studio asp.net-mvc-4 iis


    【解决方案1】:

    请尝试将您的项目版本降级到 4.0 并尝试运行它。您有一个 .NET 版本冲突。由于您的 ASP.NET 版本是 4.7,如果您的 .NET 版本较低,某些 CLI 命令可能无法工作。

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 2012-11-13
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      • 1970-01-01
      相关资源
      最近更新 更多