Visual Studio 2015 - 无法添加虚拟目录 [英] Visual Studio 2015 - Adding virtual directory not possible

查看:35
本文介绍了Visual Studio 2015 - 无法添加虚拟目录的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我们在 Visual Studio 中将我们的一些网站作为网站项目运行.我们最近升级到了 VS2015.现在我们无法向新网站添加虚拟目录.

we are running some of our sites as Web Site projects in Visual Studio. We recently upgraded to VS2015. Now we can't add virtual directories to new websites.

我们已经尝试过右键单击添加新的虚拟目录",在那里我们收到一条错误消息以及编辑项目文件夹中的 applicationhost.config.

We already tried right-click "Add new virtual direcory" where we get an error message as well as editing the applicationhost.config in the Project folder.

这是 VS2015 的错误还是有办法创建目录?升级到VS2015之前已经在IIS Express上运行的项目没有问题.

Is this a bug with VS2015 or is there a way to create the directories? There is no problem with project that already ran on IIS Express before upgrading to VS2015.

PS:我知道线程这里但是它没有帮助.

PS: I know of the thread here but it doesn't help.

推荐答案

文件系统网站到 IIS Express.

FileSystem Web site to IIS Express.

  1. 打开 VS2015(右键单击并选择以管理员身份运行).
  2. 点击文件 > 新建 > 网站...
  3. 在新建网站"对话框中,单击浏览...按钮.
  4. 在左侧窗格中选择本地 IIS.然后在右侧窗格中选择 IIS Express 站点.
  5. 顶部右侧有 4 个按钮.点击创建新网站按钮.
  6. 提供名称并点击打开.这将在 Web 位置中选择 HTTP.
  7. 点击确定.
  8. 然后关闭解决方案.
  9. 从以下位置打开 applicationhost.configUsers\DocumentsIISExpressconfig 文件夹.您可以在记事本中打开.
  10. 网站部分找到您的网站.并更改物理路径里面(virtualDirectory path="/" physicalPath="C:WebAppWebSite1").写下您现有网络项目的路径.
  11. 保存并关闭 applicationhost.config 文件.
  12. 运行 VS2015(以管理员身份运行).
  13. 点击文件 > 打开 > 网站...
  14. 在打开网站"对话框中,从左窗格中选择本地 IIS".
  15. IIS Express 站点下选择您的站点,然后点击打开.
  16. 点击网站菜单和新建虚拟目录...
  17. 提供别名和文件夹路径,然后单击确定".
  1. Open VS2015 (Right click and select Run as administrator).
  2. Click File > New > Web Site...
  3. In the New Web Site dialog, click Browse... button.
  4. Select Local IIS in the left pane. And select IIS Express Sites in the right pane.
  5. There are 4 buttons in right side on top. Click Create New Site button.
  6. Give name and click Open.This will select HTTP in Web location.
  7. Click OK.
  8. Then close the solution.
  9. Open applicationhost.config from Users\DocumentsIISExpressconfig folder. You can open in the notepad.
  10. Find your web site in sites section. And change the physical path inside (virtualDirectory path="/" physicalPath="C:WebAppWebSite1"). Write the path of your existing Web Project.
  11. Save and close applicationhost.config file.
  12. Run VS2015 (Run as administrator).
  13. Click File > Open > Web Site...
  14. In the Open Web Site dialog, select Local IIS from left pane.
  15. Select your site under IIS Express Sites and click Open.
  16. Click Web Site menu and New Virtual Directory...
  17. Give Alias Name and Folder path and click OK.

现在您可以毫无错误地创建它.

Now you can create it without error.

这篇关于Visual Studio 2015 - 无法添加虚拟目录的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆