question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Current 6.0 SDK building in VS errors with 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' specified could not be found.

See original GitHub issue

In VS building a mostly empty web project fails with

1>------ Rebuild All started: Project: WebApplication1, Configuration: Release Any CPU ------
1>C:\Program Files\dotnet\sdk\6.0.100-preview.5.21255.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props(14,3):
 error : C:\Program Files\dotnet\sdk\6.0.100-preview.5.21255.14\Sdks\Microsoft.NET.SDK.WorkloadAutoImportPropsLocator\Sdk not found.
 Check that a recent enough .NET SDK is installed and/or increase the version specified in global.json.

1>C:\Program Files\dotnet\sdk\6.0.100-preview.5.21255.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props(14,38):
 error MSB4236: The SDK 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' specified could not be found.

1>Done building project "WebApplication1.csproj" -- FAILED.
========== Rebuild All: 0 succeeded, 1 failed, 0 skipped ==========

At CLI it suceeds by has a different warning (which is https://github.com/dotnet/sdk/issues/17388)

Microsoft (R) Build Engine version 16.11.0-preview-21254-21+e73d08c28 for .NET
Copyright (C) Microsoft Corporation. All rights reserved.

  Determining projects to restore...
  Restored C:\Users\thund\source\repos\WebApplication1\WebApplication1\WebApplication1.csproj (in 62 ms).
  You are using a preview version of .NET. See: https://aka.ms/dotnet-core-preview

C:\Program Files\dotnet\sdk\6.0.100-preview.5.21255.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.targets(255,5):
 warning NETSDK1048: 'AdditionalProbingPaths' were specified for GenerateRuntimeConfigurationFiles,
 but are being skipped because 'RuntimeConfigDevPath' is empty. 

[C:\Users\thund\source\repos\WebApplication1\WebApplication1\WebApplication1.csproj]
  WebApplication1 -> C:\Users\thund\source\repos\WebApplication1\WebApplication1\bin\Debug\net6.0\win-x64\WebApplication1.dll

Build succeeded.

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:8
  • Comments:81 (37 by maintainers)

github_iconTop GitHub Comments

6reactions
tompicommented, Jun 9, 2022

Thank you @baskren !

‘’’ launchctl setenv MSBuildEnableWorkloadResolver false ‘’’

finally brought back my rider ide

6reactions
baskrencommented, May 25, 2022

CORECTION

I am finally able to get VS2022 for Mac (v17.0 - build 8989) working by setting the MSBuildEnableWorkloadResolver = false environment variable.

For those who have the same issue: Note that the most systemic way to set environment variables in MacOS is through launchctl:

 % launchctl setenv MSBuildEnableWorkloadResolver false

The old approach of systemically setting environmental variables was via ~/.MacOSX/environment.plist . However, that approach was removed in OS X Lion.

If you turn on Diagnostic log verbosity, the first thing listed in the build log will be the environment variables used for the build. Setting environment variables in the traditional Unix way (.profile, .bash_profile, .zprofile, .zshenv, etc) will not work for applications.

TO THE MAINTAINERS

I still ask that you consider reopening this issue. Several times it is stated that setting the MSBuildEnableWorkloadResolver environment variable is not necessary with more recent releases of VS2022. My experience has proven that this is not universally true.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Ask Question
Sdk.ImportWorkloads.props(14,38): error MSB4236: The SDK 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' specified could not be found.
Read more >
SDK package not found "Microsoft.NET. ...
A workaround is to remove the sdk-manifests directory /usr/local/share/dotnet/sdk-manifests/6.0.100 and then install the .NET 6 preview sdk ...
Read more >
VS Unable to find SDK 'Microsoft.NET. ...
I believe I downloaded the SDK from Microsoft's site, I type in dotnet in ... NET.SDK.WorkloadAutoImportPropsLocator'. SDK not found
Read more >
The SDK 'Microsoft.NET.Sdk' specified could not be found
led to "The "MSBuildSDKsPath" property is a global property, and cannot be modified." errors. ... I have downloaded several older Rider versions and...
Read more >
MSB4236 The SDK Microsoft.NET.Sdk specified could not ...
While I was doing this a build script was failing. ... The error was error MSB4236 The SDK Microsoft.NET.Sdk specified could not be...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found