简体   繁体   中英

ASP.NET and IIS 7.5: Creating a virtual directory

I have written an ASP.NET MVC 5 application in Visual Studio 2012, and I am now attempting to run it on IIS 7.5. Following a tutorial, within IIS Manager I have created a virtual directory, whose physical address is the address on my computer of the web application. That seems to work fine.

However, the tutorial also says that an alternative way to create this virtual directory is from within Visual Studio. Again following the tutorial, under the project Properties->Web, I select Use Local IIS Web server , and then type in http://localhost:8010/MyWebApp as the Project Url . Then, after clicking the Create Virtual Directory button, I receive the message The virtual directory was created successfully .

However, I notice that this virtual directory does not appear in fact appear in IIS Manager, even after refreshing or restarting. What am I doing wrong? (Note that Use IIS Express is checked, if that makes any difference.)

Using IIS express is the issue, the IIS manager is for the inbuilt IIS instead.

If you untick that use IIS express box, it will remove the port number and you will create a virtual directory under the main IIS installed.

http://localhost/MyWebApp

Note that VS must be run as an administrator for it to be able to access the IIS metabase, otherwise your web app project will fail to load.

If you are running on a base install, you may also need to install some extra features into IIS to get it working properly.

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM