如何为 TeamCity NuGet 安装程序设置 MSBuild 版本? [英] How to set the MSBuild verision for TeamCity NuGet Installer?

查看:41
本文介绍了如何为 TeamCity NuGet 安装程序设置 MSBuild 版本?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试使用

但我没能找到类似NuGet 安装程序"步骤的设置.我错过了什么吗?

解决方案

我设法通过指定 -MSBuildPath

I'm trying to restore NuGet packages for a .NET Core solution using NuGet Installer TeamCity build step. The 'MSBuild auto-detection' chooses MSBuild v4.0 instead of v15.0 which is required for .NET Core projects:

[15:41:53][restore] Starting NuGet.exe 4.1.0.2450 from C:\TeamCity\buildAgent\tools\NuGet.CommandLine.4.1.0\tools\NuGet.exe
[15:41:53][restore] MSBuild auto-detection: using msbuild version '4.0' from 'C:\Windows\Microsoft.NET\Framework64\v4.0.30319'.
[15:41:53][restore] Nothing to do. None of the projects in this solution specify any packages for NuGet to restore.
[15:41:53][restore] Process exited with code 0

This leads to the compilation error in the 'MSBuild' TeamCity step that runs after the package restoring:

Assets file 'C:\TeamCity\...\MyProj\obj\project.assets.json' not found.
Run a NuGet package restore to generate this file.

For the 'MSBuild' TeamCity step I choose the MSBuildTools version manually as described in this SO answer:

But I didn't manage to find the similar setting for the 'NuGet Installer' step. Am I missing something?

解决方案

I managed to overcome this specifying the -MSBuildPath command line parameter:

这篇关于如何为 TeamCity NuGet 安装程序设置 MSBuild 版本?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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