问题
I have an application that uses .NET Core 3.1 but in .NET Core Build and Publish tasks, the dropdown menu offers only 'til 2.x version.
How am I supposed to use them or what workaround instead? Simple CLI?
Thanks in advance
@Patrick .NET Core Task is this right?
But how should be that different compared to Restore/Build/Publish that are aldready set up in .NET Core pipeline?
If that so, I guess I just need to set the command with my custom publish value:
dotnet publish myPath -c release -f netcoreapp3.0 --self-contained true -r win-x64
Am I right?
回答1:
That's the version of the task, not the version of .NET Core.
回答2:
That's not stand for .NET Core Version. It's our task version in Azure DevOps build Pipeline.
Tasks are versioned, and you must specify the major version of the task used in your pipeline. This can help to prevent issues when new versions of a task are released.
Each task in a pipeline has a Version selector to let you choose the version you want.
Source Link: Task versions
According to your TFS tag, seems you are using private agent. You could choose to pre-install your .NET Core related environment/SDK in the agent manually.
If you want to do this during the pipeline, you should use Use .NET Core task
Use this task in a build or release pipeline to acquire a specific version of .NET Core from the Internet or the tools cache and add it to the PATH.
Not sure which TFS version you are using, which may do not contain above task. You could choose to manually pre-install .NET Core related on the agent or download source of task code and package upload to TFS server or use 3-rd party extension instead.
来源:https://stackoverflow.com/questions/60381518/build-publish-net-core-3-x-application-with-tfs-2018-update-3-2