解析器错误消息:无法加载类型“MYAPP.WebUI._Default”
当我在 Visual Studio 10 中运行该项目时,我不断收到以下错误。我从其他人那里得到了这个项目,并且我必须扩展它,所以我很确定它与路由值有关,因为它来自另一台计算机。但是我不知道该怎么做。它之前可以工作,但后来我尝试连接到数据库(通过创建新用户),然后这种情况开始发生。
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 'MYAPP.WebUI._Default'.
Source Error:
Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MYAPP.WebUI._Default" %>
Line 2:
Line 3: <%-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. --%>
Source File: /Default.aspx Line: 1
Default.aspx.cs 文件:
public partial class _Default : Page
{
public void Page_Load(object sender, System.EventArgs e)
{
// Change the current path so that the Routing handler can correctly interpret
// the request, then restore the original path so that the OutputCache module
// can correctly process the response (if caching is enabled).
string originalPath = Request.Path;
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(originalPath, false);
}
}
请帮忙。
I keep getting the following error when I run the project in Visual Studio 10. I got this project from someone else, and I have to expand it, so I'm pretty sure it has something to do with route values, since it came from an another computer. However I don't know how to do that. It was working before, but then I tried to connect to the database (by creating a new user) and then this started happening.
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 'MYAPP.WebUI._Default'.
Source Error:
Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="MYAPP.WebUI._Default" %>
Line 2:
Line 3: <%-- Please do not delete this file. It is used to ensure that ASP.NET MVC is activated by IIS when a user makes a "/" request to the server. --%>
Source File: /Default.aspx Line: 1
The Default.aspx.cs file:
public partial class _Default : Page
{
public void Page_Load(object sender, System.EventArgs e)
{
// Change the current path so that the Routing handler can correctly interpret
// the request, then restore the original path so that the OutputCache module
// can correctly process the response (if caching is enabled).
string originalPath = Request.Path;
HttpContext.Current.RewritePath(Request.ApplicationPath, false);
IHttpHandler httpHandler = new MvcHttpHandler();
httpHandler.ProcessRequest(HttpContext.Current);
HttpContext.Current.RewritePath(originalPath, false);
}
}
please help.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
解决了。事实证明,使用 Chrome 网络浏览器,如果您在打开多个选项卡的情况下登录 mvc 应用程序,系统会感到困惑。我开始使用 Internet Explorer,它会自动停止 Visual Studio 中的调试器,防止这种情况发生。
Solved it. turns out using Chrome web browser, if you log into the mvc app with multiple tabs open, the system gets confused. I started using Internet Explorer, which stops the debugger in Visual Studio automatically preventing this from happening.