简体   繁体   English

IIS 8将现有文件夹设置为虚拟文件夹

[英]IIS 8 set up existing folder as virtual

I'm adding code to an existing web site, where I would like to have the code in a new folder. 我正在向现有网站添加代码,我想在其中将代码保存在新文件夹中。 The folder is already created, as I have build the application using Visual Studio (setting up a new folder for the site). 该文件夹已经创建,因为我已经使用Visual Studio构建了应用程序(为站点设置了一个新文件夹)。

It works perfectly fine to view the .html files in the new directory, but it's not possible to reach the .aspx files. 在新目录中查看.html文件效果很好,但是无法访问.aspx文件。 The error message is 错误消息是

It is an error to use a section registered as allowDefinition='MachineToApplication' beyond application level. 使用超出应用程序级别注册为allowDefinition ='MachineToApplication'的节是错误的。 This error can be caused by a virtual directory not being configured as an application in IIS. 此错误可能是由于未在IIS中将虚拟目录配置为应用程序引起的。

And then I tested to add a new virtual folder, which worked fine. 然后,我测试添加一个新的虚拟文件夹,效果很好。 But I cannot figure out how to make an existing folder virtual? 但是我不知道如何使现有文件夹虚拟化? Is that possible? 那可能吗?

As Visual Studio is rather grumpy when it comes to renaming / recreating web applications, I'd like to avoid doing that all over again. 由于Visual Studio在重命名/重新创建Web应用程序时比较脾气暴躁,因此我想避免再做一次。

Please let me know if there's anything else I can provide to make the problem more understandable. 请让我知道是否还有其他方法可以使问题更容易理解。

In IIS 7, you would need to change it in IIS Manager 在IIS 7中,您需要在IIS管理器中进行更改

https://msdn.microsoft.com/en-us/library/bb763173.aspx https://msdn.microsoft.com/zh-CN/library/bb763173.aspx

I haven't used IIS 8, but assume it would be about the same. 我没有使用IIS 8,但假设它几乎相同。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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