问题描述
发布或部署脚本没有错误,但是在部署完成后,导航至网站说:
There is no error in publish or deploy script, but after deploy is done, navigating to website says :
可能的原因是:当我使用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.
发布命令:
由于未创建approot文件夹,因此msdeploy命令已成功执行,但在完成部署后无法正常工作.
Since approot folder is not getting created, msdeploy command is executting successfully but not working after deploy is done.
MsDeploy命令:
MsDeploy Command :
Project.Json-发布脚本:
Project.Json - Post-Publish Script :
这里可能出什么问题了?
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.
正确的命令:
请注意源路径,源: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文件夹的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!