I have Full .NET 4.7.2 Web API project. This is existing project. On CI server I am building this project using MSBuild version 15.6.85.37198
from C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Binmsbuild
folder
I added another NETStandard2
library project that has common code. The Web API 2 project now has a project reference to this NETStandard2 project.
Also updated The Web Api's config as
<system.web>
<compilation targetFramework="4.7.2" debug="true">
<assemblies>
<add assembly="netstandard, Version=2.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51" />
</assemblies>
</compilation>
<httpRuntime targetFramework="4.7.2" />
On local machine I am using VS 2019 and both projects are compiling.
On CI server I have installed new NET 5
SDK. I am building Web Project as
C:Program Files (x86)Microsoft Visual Studio2017BuildToolsMSBuild15.0Binmsbuild MyApi.csproj /p:Configuration=Release
Its throwing error
error : Version 5.0.101 of the .NET Core SDK requires at least version
16.8.0 of MSBuild. The current available version of MSBuild is 15.6.85.37198. Change the .NET Core SDK specified in global.json to an older version that requires the MSBuild version currently available.
The error is self explanatory. Since web api is referencing NetStandard I have to install MSbuild 16*
However, from MS documentation
To install MSBuild on a system that doesn't have Visual Studio, go to
Visual Studio downloads and scroll down to All Downloads, then expand
Tools for Visual Studio 2019. Install Build Tools for Visual Studio
2019, which includes MSBuild, or install the .NET Core SDK.
the last part says or install the .NET Core SDK.
Questions
1> I have installed NET5 SDK on CI server, Does that also installs MSbuild 16.*, if yes which location?
2> Where is global.json file located?
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…