20

I'm using the Visual Studio Development Server, with a specific port. Is there a way to add a virtual directory to it?

EDIT:

Sorry, I wasn't very clear. I'd like to be able to add one or more virtual directories to arbitrary physical directories. For instance: http://localhost/c_drive/ would map to C:\, http://localhost:/d_drive/ would map to D:\, etc.

Charles
  • 50,943
  • 13
  • 104
  • 142
David Hodgson
  • 10,104
  • 17
  • 56
  • 77

4 Answers4

14

The Visual Studio Development Server is codenamed Cassini.

From ASP.NET 2.0: A Getting Started Guide

Cassini doesn't support virtual directories, security settings, 
or any of IIS's other fancy features; it's just a very simple web server 
that gives you the basics you need to get up and running.

I am using the IIS which is included with Windows XP Pro. It only allows one website without tweaking but does have virtual directories. If you are on Vista, you can setup multiple sites in IIS from what I have heard.

DaveB
  • 9,470
  • 4
  • 39
  • 66
12

Yes, you can specify a virtual path such as /foo instead of / in the properties of your project:

alt text

Community
  • 1
  • 1
Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
  • Sorry, I need to be able to add more than one virtual directory to an arbitrary physical directory, like you can in IIS. Is there a way to do that? – David Hodgson Apr 06 '10 at 21:59
  • 7
    I think you misunderstood the question. Adding virtual directories is not the same as setting a virtual path for a project. Virtual directories are almost like shortcuts to folders existing elsewhere than in the web root, but is accessible to the web application as if it was in the web root folder. – hofnarwillie Feb 10 '12 at 11:36
9

The closest you can get to virtual directories in the Visual Studio Development Server is by using OS symlinks to map a directoty outside of the Web site root to a path within the root
http://en.wikipedia.org/wiki/NTFS_symbolic_link

stefann
  • 1,045
  • 10
  • 14
0

Yes, you can provide a physical path by launching it through command line

C:\Program Files (x86)\Common Files\microsoft shared\DevServer\9.0\Webdev.WebServer.exe /port:9081 /path:C:\temp\vdir

just do /? for a list of command line options

GenEric35
  • 7,083
  • 3
  • 24
  • 25