C# 调试VS2008时发生分析器错误
当我创建新的VS2008 asp.net应用程序时,它构建得很好。但当我开始调试时,我在浏览器中发现以下错误。我已经重建了应用程序。标记页的Inherits子句与C#后面的代码中的类匹配。有什么线索吗C# 调试VS2008时发生分析器错误,c#,asp.net,C#,Asp.net,当我创建新的VS2008 asp.net应用程序时,它构建得很好。但当我开始调试时,我在浏览器中发现以下错误。我已经重建了应用程序。标记页的Inherits子句与C#后面的代码中的类匹配。有什么线索吗 Server Error in '/' Application. -------------------------------------------------------------------------------- Parser Error Description: An erro
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 'WebApplication3._Default'.
Source Error:
Line 1: <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="WebApplication3._Default" %>
Line 2:
Line 3: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Source File: /Default.aspx Line: 1
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.50727.4952; ASP.NET Version:2.0.50727.4927
“/”应用程序中出现服务器错误。
--------------------------------------------------------------------------------
分析器错误
描述:解析服务此请求所需的资源时出错。请查看以下特定的解析错误详细信息,并适当修改源文件。
分析器错误消息:无法加载类型“WebApplication3.\u默认值”。
源错误:
第1行:
第2行:
第3行:
源文件:/Default.aspx行:1
--------------------------------------------------------------------------------
版本信息:Microsoft.NET Framework版本:2.0.50727.4952;ASP.NET版本:2.0.50727.4927
尝试从
继承属性中删除命名空间:
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="Default.aspx.cs" Inherits="_Default" %>
这通常是因为类名/命名空间背后的代码已更改,但.aspx页面尚未更新(反之亦然)
您应该打开页面后面的代码,并确保命名空间和类名与.aspx页面中的内容匹配(并且该类被标记为public)
是的,如问题中所述,它们是匹配的。我怀疑vs安装已损坏。@Maatthia尝试使用诊断加载失败-您可能引用了另一个无法加载的程序集。还要确保你的项目是最新的。这怎么可能?这是由vs自动生成的。
namespace WebApplication3
{
public class _Default
{
// ...