我在运行asp.net mvc 2应用时遇到问题。使用VS2010 ASP.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 'PrototypeB.MvcApplication'.
Source Error:
Line 1: <%@ Application Codebehind="Global.asax.cs" Inherits="PrototypeB.MvcApplication" Language="C#" %>
Source File: /global.asax Line: 1
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.1
global.aspx.cs:
namespace PrototypeB
{
public class MvcApplication : System.Web.HttpApplication
{
...
答案 0 :(得分:0)
请复制粘贴Global.asax文件中的命名空间,右键单击Global.asax并选择“查看标记”以查看它
https://forums.asp.net/t/1559469.aspx/1?Could+not+load+type+MvcApplication1+MvcApplication+
我只是通过复制粘贴和重新编译解决方案来解决同样的问题。