【问题标题】:Parser Error Message: Could not load type 'PatronWebUserUtility.PatronWebUserMaintenance'解析器错误消息:无法加载类型“PatronWebUserUtility.PatronWebUserMaintenance”
【发布时间】:2020-06-15 02:47:50
【问题描述】:

我们正在尝试发布一个简单的单页 ASPX/VB.NET 应用程序,该应用程序管理数据库中的单个表,但遇到了困难。当我们在 Visual Studio 中运行应用程序时,它运行良好。但是,在发布到我们的 IIS 服务器(使用 Visual Studio 与我们的 PC 分开)后,应用程序会收到此错误。我们从其他帖子中尝试了很多建议,但在我们的实例中似乎没有任何区别。

应用程序配置为针对 .NET 4 构建,并且 IIS 应用程序池也设置为 .NET 4。 IIS 服务器版本为 8.0,在 Windows Server 2012 v6.2 上运行。

将应用程序发布到服务器时,它会生成此文件结构:

bin(文件夹)

-PatronWebUserUtility.dll

-PatronWebUserUtility.pdb

-PatronWebUserUtility.xml

PatronWebUserMaintenance.ASPX

Web.Config

我包含上述内容是因为我不确定所有内容都按应有的方式发布,但我不知道如何验证 DLL 中实际发布的内容。我假设 ASPX.VB 页面会包含在其中,但我只是不知道。

我们在 ASP 方面完全没有经验,只是在内部没有 ASP 开发人员的情况下试图通过这个小项目一瘸一拐地完成。下面的代码块就在我们的实际应用程序代码之前停止,我认为这个查询没有必要,但如果您需要更多信息来帮助,请询问!

错误信息:

Parser Error Message: Could not load type 'PatronWebUserUtility.PatronWebUserMaintenance'.

Source Error: 



Line 1:  <%@ Page Language="vb" AutoEventWireup="false" CodeBehind="PatronWebUserMaintenance.aspx.vb" Inherits="PatronWebUserUtility.PatronWebUserMaintenance" MaintainScrollPositionOnPostback="true"%>
Line 2:  
Line 3:  <!DOCTYPE html>
  

 Source File:  /patronwebusermaintenance/PatronWebUserMaintenance.aspx    Line:  1 
Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.36480 

ASPX 页面标题:

<%@ Page Language="vb" AutoEventWireup="false" CodeBehind="PatronWebUserMaintenance.aspx.vb" Inherits="PatronWebUserUtility.PatronWebUserMaintenance" MaintainScrollPositionOnPostback="true"%>

<!DOCTYPE html>
<html xmlns="http://www.w3.org/1999/xhtml">
<head runat="server">
    <title>Patron Web User Maintenance</title>
</head>

ASPX.VB 页眉:

Imports System
Imports System.Data
Imports System.Data.SqlClient
Imports System.Configuration
Imports System.Data.OleDb
Imports System.Web.UI

Public Class PatronWebUserMaintenance
    Inherits System.Web.UI.Page

网页配置:

<configuration>
  <appSettings/>
  <connectionStrings>
    <add name="PatronWebTestConnectionString" connectionString="Data Source=SQLSERVER;Initial Catalog=PatronWebTest;Integrated Security=True"
      providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <system.web>
    <compilation debug="true" strict="false" explicit="true" targetFramework="4.0"/>
    <httpRuntime/>
    <pages controlRenderingCompatibilityVersion="3.5" clientIDMode="AutoID"/>
  </system.web>
  <system.webServer>
    <defaultDocument enabled="true">
      <files>
        <add value="PatronWebUserMaintenance.aspx" />
      </files>
    </defaultDocument>
  </system.webServer>
  
  
</configuration>

【问题讨论】:

  • 您能告诉我有关您的 IIS 网站的文件夹目录吗? IIS 似乎找不到 bin 文件夹。
  • 服务器上的inetpub文件夹中的文件夹名为PatronWebUserMaintenance。

标签: asp.net vb.net iis


【解决方案1】:

根据你的描述,我猜你可能将IIS网站的物理文件路径设置为父路径而不是正确的路径。

我建议你可以尝试修改物理文件路径再试一次。

更多细节,您可以参考以下步骤:

1.打开IIS管理控制台:

2.找到你用过的网站。

3.右键点击网站,选择管理网站和高级设置

4.修改patronwebusermaintenance的物理路径而不是inetpub文件夹。

【讨论】:

  • 物理路径已经设置为“c:\inetpub\PatronWebUserMaintenance” 你是不是建议把目录移出inetpub,所以路径就是c:\PatronWebUserMaintenance?
  • 你能告诉我你在vs中创建了哪个项目吗? ASP.NET 网站或 ASP.NET Web 表单应用程序”?
  • ASP.NET Web 应用程序 (.NET Framework) Visual Basic
猜你喜欢
  • 2019-11-02
  • 2021-11-14
  • 2014-12-03
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2012-07-25
  • 2022-01-15
  • 1970-01-01
相关资源
最近更新 更多