Problems with modules and virtual paths

Topics: Web Client Software Factory, User Forum
Dec 23, 2008 at 5:39 PM
Edited Dec 23, 2008 at 5:58 PM
Hi, I am starting with WCSF, I write a few modules, and I am trying to integrate in 2 websites:
I have this:
        <modules >
            <module name="Shell" assemblyName="Shell" virtualPath="~/admin/" />
            <module name="Noticias" assemblyName="Noticias" virtualPath="~/admin/Noticias">
                    <dependency module="Shell" />
But in the Tree menu my links point to:

http://localhost/noticias instead of http://localhost/admin/noticias

I try changing in ShellModuleInitializer.RegisterSiteMapInformation
to change
SiteMapNodeInfo moduleNode = new SiteMapNodeInfo("Administración", "~/Default.aspx", "Administración", "Administración");
SiteMapNodeInfo moduleNode = new SiteMapNodeInfo("Administración", "/admin/Default.aspx", "Administración", "Administración");

but then I can't test it in my dev project, and if I need to change location for other websites this don't work :(

I see the virtualpath property into the web.config, but I can't se where is used in the modules, how I can change to the virtual path of each module the links added  in  RegisterSiteMapInformation ?

Best regards, and sorry my bad english. I speak spanish.

Dec 26, 2008 at 4:16 PM

Hi Jorge,


Which are the two Web Sites that you are trying to integrate? Are Admin and Noticias separated web sites?


The virtual path property in each Web.config file allows you to define the sub-folder of your web site that is associated with the module container. As you may know every Business Module has its own CompositionContainer that allows you to scope, for example, service implementations.

Generally, the Shell project has the value: “~/” in the virtual path property. The “~/” path does not refer to the Web Server’s root, this represents the root folder of your Web Site.

If what you want is to have the entire application under the virtual path admin, you accomplish this by publishing it in the IIS under a Virtual Directory called admin. By using this approach, you should not need to change the RegisterSiteMapInformation method.


Another option could be creating your Business Modules as sub-Web Application Projects. This allows you to create a Web Application project mapped to a folder’s Web site:

·         How to: Create a Web Client Solution

·         How to: Create a Business Module


Perhaps, you may also find useful the following article in the WCSF’s documentation to understand the purpose of the Shell, Business and Foundational Modules:

·         Modules


Please, let me know if this helps or if the problem persists, please provide more information into this matter.


Ezequiel Sculli

Dec 26, 2008 at 4:54 PM
Edited Dec 26, 2008 at 4:55 PM
Hi,  I am reading the links that you provide me :)

I have 1 project, with all modules, following the guideline of this
I can't understand how to define my bussines modules as sub web application

I have my project, with 4 modules (I am developing 3 more), and I need to integrate some modules in my websites (not all in all websites at same time) and I want to get the Tree menu for all modules implemented.

Best regards, and thanks in advance :)
Dec 29, 2008 at 7:15 PM


To be able to create a Business Module as a Sub-Web Application Project, your Web Client solution must be created with a Web Application Project templatelike the Web Client Solution (C#, WAP) or Web Client Solution (Visual Basic, WAP). Then, when you run the Add Business Module recipe, the option Create as a sub-Web Application Project (WAP) will appear in the Add Business Module wizard.

You should take into account that Business Modules created as sub-Web Application Projects represents a folder of the root Web Project.


If you are using a Web Site and want to add another Web Site inside the same WCSF solution to be able to run/debug both at the same time, perform the following steps:

1.       Copy the vwd.webinfo file from the original Web Site to the new Web Site.

2.       Close your WCSF solution in Visual Studio and open the solution file (.sln) in Notepad.

3.       Identify the GlobalSection node at the bottom.


GlobalSection(ExtensibilityGlobals) = postSolution

RootNamespace = <Your First Website Namespace>

IsWCSFSolution = True



4.       Add the information for the new Web Site in the Global Section Node.


GlobalSection(ExtensibilityGlobals) = postSolution

RootNamespace = <Your First Website Namespace>

IsWCSFSolution = True

RootNamespace = <Your new website>

IsWCSFSolution = True



5.       Save your solution file.

6.       Open your solution in Visual Studio and compile it.


Note: The new Web Site should have the required structure and libraries in order to run all the WCSF recipes.


For further explanations on this, check the following thread:

·         Create another website inside same wcsf solution


Please let me know if this helps.


Mariano Converti