Setting up Azure DevOps Build Machine - Could not resolve SDK "Microsoft.NET.SDK.WorkloadAutoImportPropsLocator"

71 Views Asked by At

I'm in the process of setting up a pipeline in Azure DevOps. I went with setting up my own agent. When I initially attempted to build the pipeline, it said that it couldn't find C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Sdks\Microsoft.NET.Sdk.Web, so I copied the SDK from C:\Program Files\dotnet\sdk\8.0.203\Sdks. Now when I try to build, I get:

Could not resolve SDK "Microsoft.NET.SDK.WorkloadAutoImportPropsLocator".

I tried to locate the SDK, but I can't find it.

1

There are 1 best solutions below

0
Anthony Mallgren On

I resolved this by adding two environment variables:

  • MSBuildEnableWorkloadResolver set to false
  • MSBuildSDKsPath set to C:\Program Files\dotnet\sdk\8.0.203\Sdks

A restart was required.