Localhost错误上的ASP.NET网站



在Localhost上运行我的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" %>

我可以通过使用:

来解决此问题
<%@ 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" %>

我该如何解决此问题?

当您使用预先编译的ASPX页面并将其编辑时,也可能会发生这种情况,就像从实时服务器复制并覆盖Dev/Working版本一样,将其进行了编辑。<<<<<<<<<<<<<</p>

<%@Page />标签中的ASPX页面的第一行上,您可能会看到一个属性:

inherits="yourPageClass, App_Web_hipf5z3e".

删除App_Web_XXXX零件,然后将指向您的代码的CodeFile属性添加到文件后面:

CodeFile="yourPageFile.aspx.cs"

新答案:

You can mix C# and VB in the same project...but not the same page.

编辑web.config

<compilation debug="false">
   <codeSubDirectories>
       <add directoryName="VBCode"/>
       <add directoryName="CSCode"/>
   </codeSubDirectories>
</compliation>

最新更新