没有与特定模式匹配的JSON文件:appsettings.json [英] NO JSON file matched with specific pattern: appsettings.json
问题描述
在Team Services版本上出现此错误.我怀疑此错误会发生,因为我生成了压缩的伪像.
Im getting this error on Team Services release. I suspected that this error occours because im generating a zipped artifact.
MSBuild配置:
The MSBuild configuration:
/p:DeployOnBuild=true /p:WebPublishMethod=Package /p:PackageAsSingleFile=true /p:SkipInvalidConfigurations=true /p:DesktopBuildPackageLocation="$(build.artifactstagingdirectory)\WebApp.zip" /p:DeployIisAppPath="Default Web Site"
然后在我的Release im中尝试替换appsettings.json
变量:
Then in my Release im trying to replace the appsettings.json
variables:
因此该工件是一个zip文件,可能是因为发布管理程序未找到appsettings.json文件.但是如何处理呢?构建没有压缩的工件?
So the artifact is a zip file and problably because this the release management is not finding the appsettings.json file. But what is the way to deal with it? Build an artifact not zipped?
推荐答案
这对我有用:
**/appsettings.json
根据代理的位置以及MSBuild对其进行打包,json文件被埋在很长的深层路径中……它不在根"目录中.
The json file is buried down in a long deep path based on the location of the agent and how MSBuild packages it up...it's not at the "root".
例如,我的json文件位于WebApp.zip文件中的此文件夹中:
For example, my json file was in this folder within the WebApp.zip file:
WebApp.zip \ Content \ C_C \ Build \ Agent \ agent_work \ 3 \ s \ CrmsAngularPOC \ obj \ Release \ netcoreapp1.1 \ PubTmp \ Out
WebApp.zip\Content\C_C\Build\Agent\agent_work\3\s\CrmsAngularPOC\obj\Release\netcoreapp1.1\PubTmp\Out
这篇关于没有与特定模式匹配的JSON文件:appsettings.json的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!