我有一个 ASP.NET Web 应用程序,它有 3 个项目来处理应用程序的 3 个不同层(UI、BL 和数据访问)。当我发布 UI 项目时,将在解决方案中创建一个名为 Precompiled 的目录,并且文件将在那里可用。该文件夹将有一个 BIN 目录,其中包含所需的 DLL(引用的 DLL 和业务层项目的 DLL 和 DataAccessLayer 项目的 DLL)。
这工作正常。现在我想使用相同的 BL 和 DataAcess 层来运行多个 UI(网站)。我想拥有一个名为 WebsiteA、WebSiteB、MyWebSite1、ShyjusWeb 等的网站。我想为其中的每一个创建虚拟目录。所以我创建了一个网站,并在该网站下为上述网站创建了虚拟目录。我将 index.asp(我的解决方案中的 UI 项目)放在映射到一个虚拟目录的文件夹中,当尝试访问时,我收到如下错误:
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_lls0_qzf'. Make sure that it is compiled before accessing the page.
Source Error:
Line 1: <%@ page language="C#" autoeventwireup="true" inherits="index, App_Web_lls0_qzf" %>
Line 2: <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
Line 3: <html xmlns="http://www.w3.org/1999/xhtml">
Source File: /websiteA/index.aspx Line: 1
该页面似乎无法从 BIN 文件夹访问所需的 DLL。有没有办法解决这个问题?IIS 6.0 我正在玩。我的文件夹层次结构现在是这样的:
根文件夹 - > Bin 文件夹,各种 UI 相关文件和文件夹现在转换为虚拟目录的文件夹(WebSiteA)。在 WebSiteA 中,我有 inde.aspx,它与根文件夹中可用的 index.aspx 的副本相同。
我需要有相同的网站(复制每个网站只有一些 CSS 更改)。如果我从我的根目录复制 Bin 文件夹并将其与 index.aspx 一起粘贴到每个虚拟目录文件夹中,它就可以工作。但我不想每个站点都有相同的 BIN 文件夹。我只想有一个 BIN,它应该在 ROOT 文件夹中