应用程序子文件夹下的虚拟目录
Virtual Directories Under a Application Sub Folder
我们正在尝试将 .NET 4.5 Web 应用程序从专用 IIS 服务器迁移到 Azure,但我们 运行 遇到了虚拟目录问题。我们需要在网站的子文件夹中创建多个虚拟文件夹。在 Azure 门户中,我们只能创建一个映射到应用程序根目录的虚拟文件夹。
虚拟文件夹的创建由 Microsoft.Web.Administration 在我们的应用程序启动中处理。
这是我们正在尝试做的事情的一个例子
app.com/sub/aspxfolder/ - location of the ASPX code
app.com/sub/aspxfolder-v1/ - virtual path to above code
app.com/sub/aspxfolder-v2/ - virtual path to above code
页面根据请求呈现不同 URL。
当您在 Azure 中创建虚拟目录时,请确保将它们按照从最低深度到最高深度的顺序排列。例如:
Virtual Directory | Relative Path to Site Root
/sub | site\wwwroot\sub
/sub/aspxfolder | site\wwwroot\sub\aspxfolder
会起作用,同时:
Virtual Directory | Relative Path to Site Root
/sub/aspxfolder | site\wwwroot\sub\aspxfolder
/sub | site\wwwroot\sub
行不通。我之前已经 运行 了解过 Azure 中的其他功能。我认为这是您 运行 正在关注的问题。
我们正在尝试将 .NET 4.5 Web 应用程序从专用 IIS 服务器迁移到 Azure,但我们 运行 遇到了虚拟目录问题。我们需要在网站的子文件夹中创建多个虚拟文件夹。在 Azure 门户中,我们只能创建一个映射到应用程序根目录的虚拟文件夹。
虚拟文件夹的创建由 Microsoft.Web.Administration 在我们的应用程序启动中处理。
这是我们正在尝试做的事情的一个例子
app.com/sub/aspxfolder/ - location of the ASPX code
app.com/sub/aspxfolder-v1/ - virtual path to above code
app.com/sub/aspxfolder-v2/ - virtual path to above code
页面根据请求呈现不同 URL。
当您在 Azure 中创建虚拟目录时,请确保将它们按照从最低深度到最高深度的顺序排列。例如:
Virtual Directory | Relative Path to Site Root
/sub | site\wwwroot\sub
/sub/aspxfolder | site\wwwroot\sub\aspxfolder
会起作用,同时:
Virtual Directory | Relative Path to Site Root
/sub/aspxfolder | site\wwwroot\sub\aspxfolder
/sub | site\wwwroot\sub
行不通。我之前已经 运行 了解过 Azure 中的其他功能。我认为这是您 运行 正在关注的问题。