dotnet发布出错.无法找到/创建approot文件夹 [英] dotnet publish going wrong. Unable to find/create approot folder

查看:219
本文介绍了dotnet发布出错.无法找到/创建approot文件夹的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

发布或部署脚本没有错误,但是在部署完成后,导航至网站说:

There is no error in publish or deploy script, but after deploy is done, navigating to website says :

指定的CGI应用程序遇到错误,服务器 终止该过程.

The specified CGI application encountered an error and the server terminated the process.

可能的原因是: 当我使用dnx发布命令时,这没有发生. 我从以前的控制台日志中验证了此警告是新警告.

The possible cause for this would be this : which was not happening while I was using dnx publish commands. I verified from previous console logs that this warning is new.

找不到文件'D:\ TempPublish \ approot'.了解更多信息: http://go.microsoft.com/fwlink/?LinkId=221672 #FileOrFolderNotFound . 信息:使用ID'8zsdwee ------------ b7a299fe6'连接到远程服务器. 警告:由于规则SkipInvalidSource,正在跳过源contentPathLib(D:\ TempPublish \ approot). 找不到文件"D:\ TempPublish \ approot".了解更多信息: http://go.microsoft.com/fwlink/?LinkId=221672 #FileOrFolderNotFound .

Could not find file 'D:\TempPublish\approot'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#FileOrFolderNotFound. Info: Using ID '8zsdwee------------b7a299fe6' for connections to the remote server. Warning: Skipping source contentPathLib (D:\TempPublish\approot) because of rule SkipInvalidSource. Could not find file 'D:\TempPublish\approot'. Learn more at: http://go.microsoft.com/fwlink/?LinkId=221672#FileOrFolderNotFound.

发布命令:

"C:\ Program Files \ dotnet \ dotnet.exe"发布"C:\ Program Files (x86)\ Jenkins \ workspace \ Temp Publish \ Site.Web" --framework net451 -输出"D:\ TempPublish"-配置发布

"C:\Program Files\dotnet\dotnet.exe" publish "C:\Program Files (x86)\Jenkins\workspace\Temp Publish\Site.Web" --framework net451 --output "D:\TempPublish" --configuration Release

由于未创建approot文件夹,因此msdeploy命令已成功执行,但在完成部署后无法正常工作.

Since approot folder is not getting created, msdeploy command is executting successfully but not working after deploy is done.

MsDeploy命令:

MsDeploy Command :

"C:\ Program Files(x86)\ IIS \ Microsoft Web Deploy V3 \ msdeploy.exe" -source:IisApp ='D:\ TempPublish \ wwwroot'-dest:IisApp ='hhhhhhhh',ComputerName =' https://xxxx-zxxx.scm.azurewebsites.net/msdeploy.axd ',UserName ='$ xxxxx',密码='yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy',IncludeAcls ='False ' -verb:sync -enableLink:contentLibExtension

"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:IisApp='D:\TempPublish\wwwroot' -dest:IisApp='hhhhhhhh',ComputerName='https://xxxx-zxxx.scm.azurewebsites.net/msdeploy.axd',UserName='$xxxxx',Password='yyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyyy',IncludeAcls='False',AuthType='Basic' -verb:sync -enableLink:contentLibExtension

Project.Json-发布脚本:

Project.Json - Post-Publish Script :

脚本":{ "postpublish":["dotnet publish-iis --publish-folder%publish:OutputPath%--framework%publish:FullTargetFramework%"]}

"scripts": { "postpublish": [ "dotnet publish-iis --publish-folder %publish:OutputPath% --framework %publish:FullTargetFramework%" ] }

这里可能出什么问题了?

What could possibly be wrong here ?

感谢您的帮助.

推荐答案

好吧,经过很多努力,我找到了答案.并相信我,看到它后您会感到愚蠢.

Ok, I found the answer after a lot of struggle. And believe me you will feel stupid after seeing it.

问题不在于发布脚本,而在于部署脚本,而是在寻找错误的路径.

The problem was not at publish script rather in deploy script, was searching for wrong path.

正确的命令:

"C:\ Program Files(x86)\ IIS \ Microsoft Web Deploy V3 \ msdeploy.exe" -source:IisApp ='D:\ TempPublish \'-dest:IisApp ='xyztwee__testing',ComputerName ='

"C:\Program Files (x86)\IIS\Microsoft Web Deploy V3\msdeploy.exe" -source:IisApp='D:\TempPublish\' -dest:IisApp='xyztwee__testing',ComputerName='https://xxxx-zzzzz.scm.azurewebsites.net/msdeploy.axd',UserName='$xyztwe__testing',Password='LOL53encrypted7beyond9your4limit5Dont70waste87Time',IncludeAcls='False',AuthType='Basic' -verb:sync -enableLink:contentLibExtension

请注意源路径,源:IisApp ='D:\ TempPublish \'而不是'D:\ TempPublish \ wwwroot',而是在已发布文件夹中搜索wwwroot文件夹,只需提供已发布文件夹作为源即可.

Notice the source path, source:IisApp='D:\TempPublish\' Instead of 'D:\TempPublish\wwwroot' searching for wwwroot folder inside published folder just provide the published folder as source.

希望这可以帮助某人并节省一些时间.

Hope this helps someone and saves some time.

这篇关于dotnet发布出错.无法找到/创建approot文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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