Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/google-sheets/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
ASP.NET网站上的本地主机错误_Asp.net_Visual Studio 2010_Iis_Localhost_Parse Error - Fatal编程技术网

ASP.NET网站上的本地主机错误

ASP.NET网站上的本地主机错误,asp.net,visual-studio-2010,iis,localhost,parse-error,Asp.net,Visual Studio 2010,Iis,Localhost,Parse Error,在本地主机上运行我的ASP.NET网站时,我遇到以下错误 Parser Error Message: The file '/MPage.master' does not exist. Line 1: <%@ page title="" language="VB" masterpagefile="~/MPage.master" autoeventwireup="false" inherits="Page1, App_Web_rscnlqny" %> 分析器错误消息:文件“/MPa

在本地主机上运行我的ASP.NET网站时,我遇到以下错误

Parser Error Message: The file '/MPage.master' does not exist.

Line 1:  <%@ page title="" language="VB" masterpagefile="~/MPage.master" autoeventwireup="false" inherits="Page1, App_Web_rscnlqny" %>
分析器错误消息:文件“/MPage.master”不存在。
第1行:
我可以使用以下方法解决此问题:

<%@ page title="" language="VB" masterpagefile="./MPage.master" autoeventwireup="false" inherits="Page1, App_Web_rscnlqny" %>

但这样做之后,我得到了一个错误:

Parser Error Message: Could not load the assembly 'App_Web_hipf5z3e'. Make sure that it is compiled before accessing the page.

Line 1:  <%@ master language="VB" inherits="MPage, App_Web_hipf5z3e" %>
分析器错误消息:无法加载程序集“App\u Web\u hipf5z3e”。在访问页面之前,请确保已对其进行编译。
第1行:

如何修复此问题???

当您获取预编译的aspx页面并将其作为未编译的页面进行编辑时,也会发生这种情况,例如从Live server复制该页面并覆盖您的开发/工作版本

在aspx页面的
标记的第一行,您可能会看到如下属性:

inherits="yourPageClass, App_Web_hipf5z3e".
删除
App\u Web\u XXXX部分
并添加指向代码隐藏文件的CodeFile属性:

CodeFile="yourPageFile.aspx.cs"
新答案:

您可以在同一个项目中混合使用C#和VB…但不能在同一个页面中使用。

编辑Web.config



现在我得到:解析器错误消息:代码文件的语言与页面的语言不一致。第1行:但在代码文件中,您使用的是c#-
CodeFile=“MPage.master.cs”
我的是vb-CodeFile=“MPage.master.vb”
<compilation debug="false">
   <codeSubDirectories>
       <add directoryName="VBCode"/>
       <add directoryName="CSCode"/>
   </codeSubDirectories>
</compliation>