1. The first step required is setting up a global.json file with below content in the same folder where the Visual Studio solution file is located in your repo. It will allow the MSBuild to use the preview .NET core versions in the build step.
{ "sdk": { "version": "3.0.100-preview" } }2. If you want to dynamically create this file in the build pipeline (to prevent the temporary needed file to be added to the repo), you can use a PowerShell task with a inline script in your build such as below.
$globaljson = '{"sdk": {"version": "3.0.100-preview"}}';
$globaljson | out-file $(globaljsonPath) -Encoding UTF8
3. Then you need to add Use .NET Core step to the build and you can define which version of the .NET Core preview should be downloaded to the build server. The version number specifications can be found in here.
Then you can use Visual Studio build step to build your solution which is containing a .NET Core 3.0 application.
The usage of dotnet build task is possible as well and you would be able to skip the step 1 and 2 of adding a global.json if you are using dotnet build task. But if you want to build the entire solution with Visual Studio build step you have to follow the steps described above.
No comments:
Post a Comment