gpt4 book ai didi

powershell - 将 aspnet5 应用程序部署到 azure 网站上的虚拟目录

转载 作者:行者123 更新时间:2023-12-03 16:31:19 27 4
gpt4 key购买 nike

使用新的 powershell 发布工具部署无虚拟目录时的默认文件夹结构是

/data
/LogFiles
/site
/site/appRoot
/site/wwwroot
/site/wwwroot/web.config
/site/locks
/site/deployments

然后将新应用程序部署到虚拟目录时: enter image description here

结构变成

/site/wwwroot/approot
/site/wwwroot/testvirt
/site/wwwroot/testvirt/web.config

这是在 wwwroot 文件夹中拥有虚拟目录 approot 的预期方法吗?approot.xml 的放置是否有任何灵 active ?添加下一个虚拟应用程序时会发生什么,查看文件结构,它会覆盖第一个虚拟应用程序的 approot?

最佳答案

相关信息可参见:https://github.com/aspnet/dnx/issues/928#issuecomment-171617386

通过在 azure 门户上设置虚拟目录设置,我设法让 3 个虚拟应用程序并行运行,如下所示: enter image description here

然后我将我的 web 应用程序部署到所有 3 个应用程序,以使用命令行进行测试,就像 Visual Studio 所做的那样。

"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:IisApp='C:\Users\pks\AppData\Local\Temp\PublishTemp\appname53' -dest:IisApp='appname/app2',ComputerName='https://appname.scm.azurewebsites.net/msdeploy.axd',UserName='$appname',Password='',IncludeAcls='False',AuthType='Basic' -verb:sync -enableLink:contentLibExtension  -retryAttempts:2

并手动将 web.config 复制到父文件夹,如 @davidfowl 的 github 建议中所示。

因此目前无法直接使用 Visual Studio 工具来发布此行为。如果只需要根目录和一个额外的虚拟应用程序,应该可以使其与 Visual Studio 一起使用。如果想要更多,approots 文件夹将会发生冲突。

我还遇到了一个错误(不确定是否是由于大量手动 web.config 复制所致),虚拟应用程序已添加了 httpplatform 处理程序,并且开始抛出 500 个错误,修复方法是更新 web.config

 <handlers>
<remove name="httpplatformhandler" />
<add name="httpPlatformHandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified"/>
</handlers>

关于powershell - 将 aspnet5 应用程序部署到 azure 网站上的虚拟目录,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/34784391/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com