发布网站并应对服务器后解析器错误 [英] Parser Error after Publishing Website and coping to Sever
问题描述
大家好,我是ASP.NET的新手.
当我在Visual Studio中运行WEBSITE时,所有缝隙都能正常工作.
发布网站,将文件复制到服务器,然后出现此错误.
我发现是否将App_Web_0nk2gezv更改为可以编译的其他文件之一,一切正常.
为什么是这样?我想了解编译的DLL与网页之间的链接吗?
我肯定这很容易回答,但是在尝试学习时会感到沮丧……
感谢任何可以提供帮助的人....非常感谢.
<pre lang="xml">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 the assembly ''App_Web_0nk2gezv''. Make sure that it is compiled before accessing the page. Source Error: Line 1: <%@ master language="VB" inherits="Site, App_Web_0nk2gezv" %> 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: /Site.Master Line: 1 </pre>
只需确保使用正确的.NET Framework来运行托管的应用程序.如果您是在2.0版本中创建的,则托管版本也应使用.NET 2.0.
对于IIS5或6,您可以直接为应用程序查看和设置.NET框架.对于IIS7,您还需要查看正在使用的应用程序池和分配给它的.NET框架. .
我已经从该Web站点下载了一个示例,并且它只能正常工作,区别仅在于我可以看到C#和我是否正在使用VB.
在NET的母版页上的文章333650初学者教程.
在下面,我从文件中添加了代码片段.我有一个内容页Default.aspx和一个母版页.
正如我所说的,它可以在VS2010(Windows 7 64位)中找到,但是当我发布到IIS 7.5站点时,我收到消息:
处理程序"PageHandlerFactory-Intergrated"在其模块列表中具有错误的模块"ManagedPipeLineHandler".
<![CDATA[<%@ Page Language="VB" MasterPageFile="~/gmeMaster.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_index" Title="Untitled Page" %>]]> <![CDATA[<%@ MasterType VirtualPath="~/gmeMaster.Master" %>]]> <asp:content id="Content1" contentplaceholderid="MainDataFrame" runat="Server" xmlns:asp="#unknown"> </asp:content>
背后的代码
导入系统 导入 System.Data 导入 System.Configuration 导入 System.Collections 导入 System.Web 导入 System.Web.Security 导入 System.Web.UI 导入 System.Web.UI.WebControls 导入 System.Web.UI.WebControls.WebParts 导入 System.Web.UI.HtmlControls 部分 类 _index 继承 System.Web.UI.Page 公共 子 新建() 结束 子 结束 类
母版页
< ![CDATA [<%@ Master 语言 =" CodeFile =" 继承 =" gmeMaster" % > ]]>
母版页
< ![CDATA [<%@ 页面 语言 =" MasterPageFile =" AutoEventWireup =" 错误" CodeFile =" 继承 =" 标题 =" 无标题页面" % < ![CDATA [<%@ MasterType VirtualPath =" % > ]]> < asp:content id =" contentplaceholderid MainDataFrame " runat 服务器" xmlns:asp =" > < /asp:content >
背后的代码
导入系统 导入 System.Data 导入 System.Configuration 导入 System.Collections 导入 System.Web 导入 System.Web.Security 导入 System.Web.UI 导入 System.Web.UI.WebControls 导入 System.Web.UI.WebControls.WebParts 导入 System.Web.UI.HtmlControls 部分 类 _index 继承 System.Web.UI.Page 公共 子 新建() 结束 子 结束 类
内容页面DEFAULT.ASPX
< ![CDATA [<%@ Master 语言 =" CodeFile =" 继承 =" gmeMaster" % > ]]>
Hi Guys I am new to ASP.NET.
When I run my WEBSITE in Visual Studio everything seam to work fine.
Publish the website, copy files to Server and then I get this error.
I found if I change the App_Web_0nk2gezv to one of the other files that gets compiled everything works.
Why is this? I am trying to understand the link between compiled DLL and the web pages?
Im sure this is easy to answer, but frustrating when your trying to learn......
Thanks anyone who can help.... Very much appreciate it.
<pre lang="xml">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 the assembly ''App_Web_0nk2gezv''. Make sure that it is compiled before accessing the page. Source Error: Line 1: <%@ master language="VB" inherits="Site, App_Web_0nk2gezv" %> 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: /Site.Master Line: 1 </pre>
Just make sure that correct .NET Framework is used to run the application hosted. If you have made it in 2.0 then the hosted version too should use .NET 2.0.
For IIS5 or 6, you can see and set the .NET framework directly for application. For IIS7 you also need to see the application pool being used and .NET framework assigned to it.
Ok I have dumbed down my pages to almost nothing and I cant seam to get it to work.
I have down loaded an example from this WebSite and it works fine only difference I can see if the C# and I am using VB.
Article 333650 Beginners Tutorial on Master Pages in Asp NET.
Below I have added the snippets from my files. I have a Content Pages Default.aspx and a Master Page.
As I said it works find in VS2010 (Windows 7 64bit) but when I publish to my IIS 7.5 site I get the message:
Handler "PageHandlerFactory-Intergrated" has a bad module "ManagedPipeLineHandler" in it module List.
<![CDATA[<%@ Page Language="VB" MasterPageFile="~/gmeMaster.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_index" Title="Untitled Page" %>]]> <![CDATA[<%@ MasterType VirtualPath="~/gmeMaster.Master" %>]]> <asp:content id="Content1" contentplaceholderid="MainDataFrame" runat="Server" xmlns:asp="#unknown"> </asp:content>
Code Behind
Imports System Imports System.Data Imports System.Configuration Imports System.Collections Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Partial Class _index Inherits System.Web.UI.Page Public Sub New() End Sub End Class
Master Page
<![CDATA[<%@ Master Language="VB" CodeFile="gmeMaster.master.vb" Inherits="gmeMaster" %>]]>
Master Page
<![CDATA[<%@ Page Language="VB" MasterPageFile="~/gmeMaster.master" AutoEventWireup="false" CodeFile="Default.aspx.vb" Inherits="_index" Title="Untitled Page" %>]]> <![CDATA[<%@ MasterType VirtualPath="~/gmeMaster.Master" %>]]> <asp:content id="Content1" contentplaceholderid="MainDataFrame" runat="Server" xmlns:asp="#unknown"> </asp:content>
Code Behind
Imports System Imports System.Data Imports System.Configuration Imports System.Collections Imports System.Web Imports System.Web.Security Imports System.Web.UI Imports System.Web.UI.WebControls Imports System.Web.UI.WebControls.WebParts Imports System.Web.UI.HtmlControls Partial Class _index Inherits System.Web.UI.Page Public Sub New() End Sub End Class
Content Pages DEFAULT.ASPX
<![CDATA[<%@ Master Language="VB" CodeFile="gmeMaster.master.vb" Inherits="gmeMaster" %>]]>
这篇关于发布网站并应对服务器后解析器错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!