Is there any way to create a virtual directory in IIS express? I know that Cassini can't do this and it would be nice to be able to do this without using a full version of IIS.
I've got it so far that I can browse to my application locally in IIS express like this:
What I would like to do is create a virtual directory called "OffSiteStuff" and point it to some location on my C drive, like "c:\offsitestuff" and then browse to items in that folder like this:
http://localhost:1132/OffSiteStuff/UserUploadedImage.jpg
I know I could do this with a folder within my site and still use IIS Express, or, for that matter plain old Cassini, but this folder will store images uploaded by users and I really don't want to have these images mixed up with application files.
The other, "go big" solution is to deploy the site onto a full blown Server 2008 IIS 7.5 instance every time I want to debug the features that use offsite content, but that is a bit cumbersome too.
Is there any way I can do this in the <System.WebServer />
Web config element?
I had something else, the files itself where inaccessible in a SBS envirenment.
Delete the files in the config folder (if you can't open them!) and replace them with a copy of the folder on your own local pc.
Fixed it for me :)
A new option is Jexus Manager for IIS Express,
https://blog.lextudio.com/2014/10/jexus-manager-for-iis-express/
It is just the management tool you know how to use.
IIS express configuration is managed by applicationhost.config.
You can find it in
Inside you can find the sites section that hold a section for each IIS Express configured site.
Add (or modify) a site section like this:
Practically you need to add a new application tag in your site for each virtual directory. You get a lot of flexibility because you can set different configuration for the virtual directory (for example a different .Net Framework version)
EDIT Thanks to Fevzi Apaydın to point to a more elegant solution.
You can achieve same result by adding one or more virtualDirectory tag to the Application tag:
Reference:
@Be.St.'s aprroach is true, but incomplete. I'm just copying his explanation with correcting the incorrect part.
IIS express configuration is managed by applicationhost.config.
You can find it in
Inside you can find the sites section that hold a section for each IIS Express configured site.
Add (or modify) a site section like this:
Instead of adding a new application block, you should just add a new virtualDirectory element to the application parent element.
Edit - Visual Studio 2015
If you're looking for the applicationHost.config file and you're using VS2015 you'll find it in:
In VS2013 I did this in the following steps:
1.Right-click the web application project and hit Properties
2.View the "Web" tab of the Properties page
3.Under Servers, with "IIS Express" being the default choice of the dropdown, in the "Project Url" change the url using the port number to one that suits you. For example I deleted the port number and added "/MVCDemo4" after the localhost.
4.Click the "Create Virtual Directory" button.
5.Run your project and the new url will be used
If you're using Visual Studio 2013 (may require Pro edition or higher), I was able to add a virtual directory to an IIS Express (file-based) website by right-clicking on the website in the Solution Explorer and clicking Add > New Virtual Directory. This added an entry to the applicationhost.config file as with the manual methods described here.