Working in a subdirectory when using ASP.NET & Visual Studio .NET 2005

N

Nathan Sokalski

I am creating an ASP.NET application in a subdirectory of what IIS uses as
the root directory (C:\Inetpub\wwwroot\). I am using the version of IIS that
comes with Windows XP Pro SP2. Some of my code in my ASP.NET application
uses root-relative URLs, such as /images/background.gif. However, because
the subdirectory my application is in is not the root directory of IIS, I
cannot test my application on my machine. Is there any way to avoid this
problem?
 
M

Mark Rae

I am creating an ASP.NET application in a subdirectory of what IIS uses as
the root directory (C:\Inetpub\wwwroot\).

Is there a specific reason you did that...?

You mention "ASP.NET application" (as opposed to a "site") and VS.NET 2005,
so I'm assuming you've installed either WAP or SP1...

Why don't you simply create a new ASP.NET application under the usual folder
and drop your files into that - I'm sure if you do that, all will be well
again...
 
C

Cor Ligthert [MVP]

Nathan,

Try never to use fixed paths in webdeveloping; use the virtual path's,
src="images/Logo.gif"

Cor
 
N

Nathan Sokalski

The reason I did that is so that I can work on multiple sites on my
computer. If I were to use C:\Inetpub\wwwroot\ as the root directory for
everything I worked on on my machine, I would end up with multiple files
with the same name, ambiguous class names, etc.
 
N

Nathan Sokalski

in general I do, but in some cases (such as when creating controls that will
be used in pages that are in different directories, or for values in
Web.config's appsettings section) it is either easier or more efficient to
do it this way. But either way, I need a way to test my application on my
Windows XP Pro SP2 version of IIS and have it treat the folder my
application is in as the root directory.
 
M

Mark Rae

The reason I did that is so that I can work on multiple sites on my
computer. If I were to use C:\Inetpub\wwwroot\ as the root directory for
everything I worked on on my machine, I would end up with multiple files
with the same name, ambiguous class names, etc.

??? Each virtual directory is totally isolated from the others as far as IIS
is concerned.

I have maybe 30 different web apps on my development machine, all of which
use the same base classes shared in Visual SourceSafe, all of which have a
file called web.config, all of which have a file called default.aspx etc,
all of which are entirely separate virtual directories etc.

The structure goes like this:

My Documents
Visual Studio 2005
Projects
<project1>.root
<project1>_app
<folder1>
<folder2>
default.aspx
web.config
<project1>_deploy
Debug
Release
<project1>_deploy.wdproj
<project2>.root
<project2>_app
<folder1>
<folder2>
default.aspx
web.config
<project2>_deploy
Debug
Release
<project2>_deploy.wdproj

Etc
 

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,770
Messages
2,569,583
Members
45,074
Latest member
StanleyFra

Latest Threads

Top