views:

845

answers:

2

I have an ASP.NET Web application which has 3 projects to handle 3 different layers of the application (UI , BL and Data Access).When i publish the UI project a directory called Precompiled will be created in the solution and Files will be available there.This Folder will have a BIN directory which holds required DLL's(referenced DLL's and DLL of Business Layer project & DLL of DataAccessLayer Project) too. This works fine .NOw i want to use the same BL and DataAcess layer to run multiple UI's (websites). I want to have website called websiteA,WebSiteB,MyWEbSite1,ShyjusWeb etc....I want to create virtual directory for each one of these. SO i created a website and under that i created Virtual directories for the above sites.I put index.asp (of the UI project i had in my solution) in the Folder which is mapping to one virtual directory and when trying to access, I am getting an error like the following

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"&gt;
Line 3:  <html xmlns="http://www.w3.org/1999/xhtml"&gt;


Source File: /websiteA/index.aspx    Line: 1

It seems like the page is not able to access the required DLL's from the BIN folder. IS there any way to solve this ?? IIS 6.0 I am playing with. My folder hierarchy is like this now Root Folder - > Bin folder,Various UI related files & folders ,A folder which is converted to a virtual directory now (WebSiteA). Inside WebSiteA , i have inde.aspx, which is the same copy as of the index.aspx available in the root folder.

I need to have the same website (copy with only some CSS changes for each site). If i copy the Bin folder from my root and paste it in each of the virtual directory folders along with the index.aspx,Its working.But i dont want to have same BIN folder for each sites.I Want to have only one BIN,which should be in the ROOT folder

Thanks in advance

A: 

Add a reference to your BL and DAL projects from the website project that you created

David Archer
If i do this,I need to do it from the solition file (Visual studio IDE ) How about creating virtual directories on IIS ?
Shyju
Why do you want to do it that way round? I think a website should be (built THEN deployed) and not (built AND deployed in one step by adding an IIS virtual dir). Is that what you're trying to do?
David Archer
I guess, and I mean guess, if you REALLY want to do it the way you described, then I don't think you can reference the same dll's on the fly like you want to but could achieve a similar result by copying the bin folder to as well as the index.aspx page. But I wouldn't recommend that way
David Archer
+1  A: 

I think you have gotten yourself in a muddle. The file you mention (App_Web_lls0_qzf) appears to be the compiled DLL for the first specified UI/BL/DAL combination and I am unfortunately confused by your description of your folder structure.

I am not clear about whether you are wanting multiple COPIES of the same site or whether each site is different.

Have you not tried creating the 4 websites, and referencing the the common BL and DAL projects?

Remember that your file structure and your IIS structure do not have to be the same, i.e.

  • c:\sites\website1
  • c:\sites\website2
  • c:\sites\website3
  • c:\sites\website4

and in IIS

  • Master Web Site
  • > Web1
  • > Web2
  • > Web3
  • > Web4

Remember inheritance! - DLLs and references in your master website will be inherited into your virtual directories. You may also wish to consider creating web app pools for each web site.

David Christiansen
If i add the Web1/Web2 as a project under my Solution .It will work.Is that the right way to tackle this ? Cant i do anything with IIS ?
Shyju
Multiple copies of same site(same functionality).But the CSS Styles of each site will be different.I Will have different CSS files for each Website.
Shyju