Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

VS APP in root/IIS

Status
Not open for further replies.

gagz

Programmer
Nov 21, 2002
333
US
Ok, this may be more an IIS question than anything...

I'm about to take the plunge and convert the app I'm working on to VS. How the heck can I make an app in my web root and not in, say I don't really know much about IIS admin, but this is going to end up being when published, so i want it to be in webroot when its developed locally. Does any of this make sense? I tried just creating a new project in VS, but when i remove the standard "webapplication1" from the new project window, and leave it at localhost, it doesn't let me continue.

whats the difference between a project and a solution?

thanks guys/gals.

i'm using win2k workstation.
 
one solution is to pull up IIS and create the site there... by right clicking on the default web site.. and selecting add...new site... and then connecting to that from VS... rather than relying on VS to create it (the thought being that you would be able to browse to it and you would know exactly what you need next time around- whether that is localhost/blah or something else)
 
you know i've been searching on the web, etc for how to do something like that... I don't have that option, the add... new site. all I can add is virtual directories. what do you suppose is limiting me?

the main reason i care about this is because of how i reference relative paths to files/images... if the site is in the root, i can say something like /images, but if its a virtual dir, that wouldn't work. I don't want to have to change all that when i publish it.
 
A common solution to the problem you refer to as far as the root changing is to store a globally accessible variable in your web.config file. Call it root, and use it whenever you need to point to a file. Normally, if I have something that will eventually be put on another server, I'll use two variables in my config file:

<add key=&quot;root&quot; value=&quot;c:\inetput\ />
<add key=&quot;address&quot; value=&quot; />

Then, wherever you need to reference an absolute path, just:

ConfigurationSettings.AppSettings.Item[&quot;root&quot;]

And so on.

You can use Server.MapPath, as well, but I prefer the former solution.
penny1.gif
penny1.gif

The answer to getting answered -- faq855-2992
 
does anyone else not have the add... new site... option on their IIS? Its freakin me out.
 
It's under the &quot;New&quot; option on the context menu when right clicking the computer name, using the MMC snap-in on a Windows2000 Advanced Server.

Lighter versions of 2k &/Or XP don't have this option.
penny1.gif
penny1.gif

The answer to getting answered -- faq855-2992
 
yeah thats my problem, i run w2k professional... DAMN IT
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top