错误:“/”应用程序分析器错误,asp.net C#中的服务器错误? [英] Error: Server Error in '/' Application Parser Error, asp.net c#?

查看:606
本文介绍了错误:“/”应用程序分析器错误,asp.net C#中的服务器错误?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

在我的应用程序,其他页面都正常运行,但这个页面抛出一​​个错误。

code

 <%@页面语言=C#AutoEventWireup =真codeBehind =OutReport.aspx.cs继承=HMS.OutReport的MasterPageFile =〜 /Site.Master%GT;
< ASP:内容=服务器ID =的BodyContentContentPlaceHolderID =日程地址搜索Maincontent>
< / ASP:内容>

错误

 在'/'应用程序的服务器错误。分析器错误说明:该请求提供服务所需资源的分析过程中出现错误。请检查下列特定分析错误详细信息并适当地修改源文件。分析器错误信息:未能加载类型'HMS.OutReport。源错误:
1号线:
2号线:LT;%@页面语言=C#AutoEventWireup =真codeBehind =OutReport.aspx.cs继承=HMS.OutReport的MasterPageFile =./的Site.Master%GT;
3号线:​​LT; ASP:内容=服务器ID =的BodyContentContentPlaceHolderID =日程地址搜索Maincontent>
4号线:LT; / ASP:内容>源文件:/OutReport.aspx行:2


解决方案

试着改变 codeBehind =OutReport.aspx.cs codeFILE =OutReport.aspx.cs

编辑:

A codeBehind 需要进行编译(asp.net 1.1模型)和编译的二进制放置在网站的bin文件夹。你需要做一个编译在Visual Studio部署之前。良好的模型时,你不想源$ C ​​$ C到交付给客户时,你没有义务提供code谁是可见的纯文本...例如。

A codeFILE 文件位于由ASP.NET在运行时编译,点播。你可以在pre-编译你的网站依傍上了年纪的模型,如果你不希望你的源$ C ​​$ C部署到每一个网站是有用的。但默认情况下,您的codeFILE文件是部署到站点cs文件,并在ASP.NET临时存储文件夹中生成的类。

在您的code,你告诉ASP.NET忽略C#文件presence,只有寻找它在编译的程序集。 ASP.NET是,反过来,告诉您编译的程序集实际上并不包含你告诉它来寻找类。

In my application, other pages are running correctly, but this page is throwing an error.

Code

<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutReport.aspx.cs" Inherits="HMS.OutReport" MasterPageFile="~/Site.Master" %>
<asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
</asp:Content>

Error

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 'HMS.OutReport'.

Source Error: 


Line 1:  
Line 2:  <%@ Page Language="C#" AutoEventWireup="true" CodeBehind="OutReport.aspx.cs"     Inherits="HMS.OutReport" MasterPageFile="./Site.Master" %>
Line 3:  <asp:Content runat="server" ID="BodyContent" ContentPlaceHolderID="MainContent">
Line 4:  </asp:Content>

Source File: /OutReport.aspx    Line: 2 

解决方案

Try changing CodeBehind="OutReport.aspx.cs" to CodeFile="OutReport.aspx.cs"

EDIT:

A CodeBehind Needs to be compiled ( asp.net 1.1 model) and compiled binary is placed in the bin folder of the website. You need to do a compile in visual studio before you deploy. Good model when you do not want the source code to be viewable as plain text ... for example when delivering to a customer who you not have obligation to provide code.

A CodeFile file is located and compiled by ASP.NET at runtime, on demand. You can "pre-compile" your web site to fall back on the older model, which is useful if you won't want to deploy your source code to every web site. But by default, your CodeFile file is a .cs file that is deployed to the site, and the class is generated in the ASP.NET temporary storage folder.

In your code you are telling ASP.NET to ignore the presence of the C# file, and only look for it in the compiled assembly. ASP.NET is, in turn, telling you that the compiled assembly doesn't actually contain the class you told it to look for.

这篇关于错误:“/”应用程序分析器错误,asp.net C#中的服务器错误?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆