的Visual Studio 2015年 - 添加虚拟目录不可能 [英] Visual Studio 2015 - Adding virtual directory not possible

查看:3000
本文介绍了的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.

这是一个bug与VS2015或有什么方法来创建目录?没有与项目没有问题,已经运行在IIS防爆preSS升级到VS2015之前。

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:我知道线程的<一个href=\"http://stackoverflow.com/questions/30702577/visual-studio-2015-rc-cant-add-virtual-directory\">here但它并不能帮助。

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

推荐答案

FileSystem的网站到IIS防爆preSS。

FileSystem Web site to IIS Express.


  1. 开启VS2015(右击并选择以管理员身份运行)。

  2. 单击文件>新建>网站...

  3. 在新建网站对话框中,点击浏览... 按钮。

  4. 选择本地IIS 在左窗格中。并选择在右窗格中的 IIS防爆preSS网站

  5. 有在右侧顶部4个按钮。点击新建站点按钮。

  6. 提供名称,然后点击打开。这将选择在Web位置HTTP。

  7. 单击确定。

  8. 然后关闭该解决方案。

  9. 从开放对ApplicationHost.config
    用户\\\\的文档\\ IISEx preSS \\ config文件夹。您可以在记事本中打开。

  10. 找到在网站部分您的网站。并修改物理路径
     里面(virtualDirectory路径=/physicalPath =C:\\ Web应用程序\\的WebSite1)。写您现有的Web项目的路径。

  11. 保存并关闭ApplicationHost.config文件。

  12. 运行VS2015(以管理员身份运行)。

  13. 单击文件>打开>网站...

  14. 在打开网站对话框中,从左侧窗格中的本地IIS。

  15. 选择在 IIS防爆preSS网站网站并点击打开

  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\\Documents\IISExpress\config 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:\WebApp\WebSite1"). 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天全站免登陆