The virtual path maps to another application, sturcturing a solution

I want to create a template system using

I am trying to put the templates in a global project which will then be used by pages in other projects in same solution. so here is the folder structure:

Page Config file: H:\Inetpub\wwwroot\MyMasterPages\Page.config
User Controls: H:\Inetpub\wwwroot\MyMasterPages\Controls\MyTemplate\
ASPX Page: H:\Inetpub\wwwroot\MyMasterPages\MyProject\WebForm1.aspx

to access the user controls, i changed the path in Page.config from

<Control Path="~/Controls/DivisionTemplate/PagePre.ascx" ControlPlacement="BeforeContent" />


<Control Path="../Controls/MyTemplate/PagePre.ascx" ControlPlacement="BeforeContent" />

but when running Webform1.aspx i get following error:
The virtual path '/MyMasterPages/Controls/MainTemplate/Header.ascx' maps to another application, which is not allowed.

so what does ~ mean here? and how do i solve this problem?

considering this problem i realize that i lack in-depth knowledge about how to organize the solution.

i m basically trying to create a solution with multiple projects in a way that each project is going to be a self-sufficient and at the end i will be able to sell each project separately. so each project will have its own business logic and data access layer. the stuff which will be accessed by more than one project will be kept in a separate project called "Common", which will have all the images, style sheets, global code libraris, page templates, user controls etc.

but this structure is giving me alot of problems like references and asseblies, so is this an advisable structure? if not what is the better one? if yes where can i read details about this way of sturcturing?
Who is Participating?
riyasjefConnect With a Mentor Commented:

Yo have one solusion with different projects.. right?
Even with this .. If u wanat to sell one project u have to give the whole assemblies ..right?
I would prefer a master solusion with different solusions for each modules..
--  "Partitioned Single Solution Model" - allow you to work on smaller subsystems within your overall system but retain the key benefits of project references.

You can read more on this


By placing a tilde (~) in front of a path, a URL can refer to the root of a site

See this

and here is an article on sharing pages and user controls..

aosexpertAuthor Commented:
~ gives the root of the working project, but in my case the user controls are present in a separate project in the same solution.

Ok tell me is it a good idea to make separate projects for each module in the solution or simply make their seaprate folders within one project? i have the told the reason in my first post why i selected to make separate projects instead of folders to recap, i want to make each module self-sufficient so that i just copy the project from the solution with others required projects in a solution.

Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

All Courses

From novice to tech pro — start learning today.