custom virtual directory mapping for web project?

G

Guest

Hi there,

I'm facing a problem that is driving me nuts. The scenario is as follows:

1) Create an empty directory structure e.g. C:\Dev1\TestWebApp

2) Map a virtual directory e.g. TestWebApp to this new directory

3) Under C:\Dev1 create a blank visual studio solution and add a new web
project called TestWebApp (which will be created in C:\Dev1\TestWebApp and
mapped to http://localhost/TestWebApp)

4) Everything runs smoothly, visual studio maps the url that you created in
1) to new web project created in 2). The web app can be accessed at
http://localhost/TestWebApp

5) Check all this into SourceSafe

6) Go to a clean machine and get the project created in 4) to anywhere, say
C:\Dev2\TestWebApp

7) On the clean machine, create a new virtual directory mapping for
TestWebApp to C:\Dev2\TestWebApp

8) If you try to open the solution now on this new machine, even with the
virtual directory mapped, visual studio prompts you to set the project
location and defaults the working directory to something like
http://localhost/TestWebApp_1 which it creates under inetput\wwwroot

This will not work for me - I'm trying to automate my build process by
calling devenv.exe and hence need to be able to set the virtual directory to
whatever I want.

Has anyone experienced this problem and found a solution?

Regards,

Danny
 
G

Guest

Hey Danny,
I've been trying a similar thing for a while, and have had nothing but
pain. A couple things I've found that might help:

1 - Each web project has a *.webinfo file, like "TestWebApp.csproj.webinfo".
This is contained in the project directory with the *.csproj file. This
contains a mapping to the virtual directory like:
<VisualStudioUNCWeb>
<Web URLPath = "http://localhost/myFolder/TestWebApp.csproj" />
</VisualStudioUNCWeb>

If you switch the directory, you'll need to update this as well.

2 - I've noticed that I can get this exact situation to work - if VSS
information is removed. So if I purge all VSS info from the solution, then it
works. If VSS info remains, then it fails. I think I've narrowed it down to
the soln file containing the "GlobalSection(SourceCodeControl)" section. This
has a mapping for the Virtual Directory. Although I'm not sure why this
causes a problem.
 
G

Guest

Thanks for replying Tim,

I was aware of the mapping in .webinfo but unfortunately that doesn't seem
to have an effect. As a base example, all I was trying to do was get the
source from VSS and open the solution using the same settings that it was
originally created with. Even when the .webinfo information was correctly set
the 'Set project location' dialog still appears the first time you open the
web application after getting it from VSS.

I also noticed the VSS info and found that it was possible to remove this
but I'd rather not have to parse and clean all VSS information from files for
an automated build. The web app is the only project giving me grief in the
automated build.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,763
Messages
2,569,562
Members
45,038
Latest member
OrderProperKetocapsules

Latest Threads

Top