简体   繁体   English

在VS发布工作时,Azure持续部署在Newtonsoft上失败

[英]Azure Continuous deployment fails on Newtonsoft while VS publishing works

I added a new packages that required Newtonsoft.Json version >= 9.0.1 while so far I had 8.0.2. 我添加了一个新的软件包,需要Newtonsoft.Json版本> = 9.0.1,而到目前为止,我有8.0.2。

The solution builds and runs fine on VS. 该解决方案在VS上构建并运行良好。 However, when I push the branch, the continuous deployment build on Azure fails. 但是,当我推送分支时,Azure上的持续部署构建失败。

The type or namespace name 'Newtonsoft' could not be found 找不到类型或命名空间名称“Newtonsoft”

There isn't any error on assembly loading or resolving. 装配加载或解析时没有任何错误。

However if I publish on Azure from Visual Studio it works. 但是,如果我从Visual Studio中在Azure上发布它就可以了。

What can be wrong with my CD build and how can I repare it? 我的CD构建有什么问题,我该如何重新制作?

The solution has only one project. 该解决方案只有一个项目。

Make sure that you have same Newtonsoft.Json version across all your projects. 确保所有项目中都有相同的Newtonsoft.Json版本。

Check that Newtonsoft.Json assemblyBinding in config files is right and same across all projects 检查所有项目中配置文件中的Newtonsoft.Json assemblyBinding是否正确

Make sure that you Enabled NuGet Package Restore 确保已启用NuGet包还原

All the SOF questions about uninstalling\\reinstalling Newtonsoft package as well as checking assemblyBindings etc led me in a wrong direction. 有关卸载\\重新安装Newtonsoft软件包以及检查assemblyBindings等所有SOF问题都导致我的方向错误。

My build server (Azure Continuous Deployment) loads packages in a folder called packages at the root of the solution. 我的构建服务器(Azure Continuous Deployment)将软件包加载到解决方案根目录下名为packages的文件夹中。 However as I have many solutions on my machine, I have a single package folder elsewhere. 但是由于我的机器上有很多解决方案,我在其他地方有一个包文件夹。 In order for the build server to work, I had created a junction package folder at the root of my solution linked to the proper package folder of my machine. 为了使构建服务器正常工作,我在解决方案的根目录下创建了一个联结包文件夹,链接到我的机器的正确包文件夹。 What I had forgotten is that when I add new packages, Visual Studio put the paths of the correct package folder rather than the junction. 我忘记的是,当我添加新包时,Visual Studio会放置正确的包文件夹而不是结点的路径。

Hence, in order to repair my server build I just had to edit my csproj file to redirect new (and updated like Newtonsoft ) packages to the junction folder. 因此,为了修复我的服务器构建,我只需要编辑我的csproj文件,将新的(并更新像Newtonsoft )软件包重定向到联结文件夹。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

相关问题 Azure连续部署-使用VSO进行安装发布 - Azure Continuous Deployment - Setup Publishing with VSO Azure连续部署始终失败 - Azure continuous deployment always fails Azure Web App(MVC 6)持续部署失败 - Azure Web App (MVC 6) continuous deployment fails azure连续部署失败,部署命令上出现nuget客户端版本错误 - azure continuous deployment fails with nuget client version error on deployment command 使用发布配置文件部署到Azure:使用Jenkins在VS2017上发布时失败 - Deploy to Azure using publish profile : Works when publishing on VS2017 fails when using Jenkins 将Web应用程序发布到Azure网站登台部署插槽失败,并显示webjob - Publishing web app to Azure Websites Staging deployment slot fails with webjob 从Bitbucket连续部署到Azure Web App失败 - Continuous deployment to Azure Web App from Bitbucket fails 带有Git子模块的VSTS应用程序的连续部署在Azure上失败 - Continuous Deployment of VSTS app with Git submodules fails on Azure VSTS Azure功能的连续部署失败-ERROR_FILE_IN_USE - VSTS Continuous Deployment of Azure Function fails - ERROR_FILE_IN_USE 天蓝色的连续部署失败 - azure continuous deployment fail
 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM