-
Notifications
You must be signed in to change notification settings - Fork 1.1k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Current 6.0 SDK building in VS errors with 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' specified could not be found. #17461
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
Causes all VS builds to fail including net5.0 ones. Adding {
"sdk": {
"version": "5.0.202",
"rollForward": "latestFeature"
}
} |
I'm hitting this too. I reverted my upgrade because of this |
The .NET 6 SDK now enables workload resolvers by default. This means when using Full Framework MSBuild (which happens in Visual Studio or when you use In short: Update to VS 16.10 Preview 3 or later if you can, and if you can't you can try setting the |
I tried updating both VS and the .NET SDK and ASP.NET Core basically disappeared. I can't seem to make a new project (or open an existing one). |
Actually, I can't seem to create any projects... |
Repaired VS, still doesn't work. I'm gonna declare that there's a bug here. |
I get this when doing new project in VS #17515 have to create a new one in cli |
Actually, a better workaround is probably to set Of course, eventually after you are using an updated version of VS you'll want to unset the environment variable to allow workloads to work. |
I'm using internal dogfood builds and its still broken in the ways expressed here. |
I'm having this same issue on macOS, either on Rider or running Tried the workaround, setting |
This issue is definitely causing problems with omnisharp. No luck with the MSBuildEnableWorkloadResolver environment variable. Uninstalling the preview caused even more issues. I had to reinstall the preview and install the preview version of Visual Studio. |
@danwalmsley Really? My case is better now. |
Bumping... I see a similar exception in the log produced under %TEMP%\servicehub\logs\ when trying to start Live Unit Testing:
Setting the |
@sfoslund to look into the LUT report above. |
@apousada can you give a full repro of this issue? cc @dsplaisted in case you've seen this issue before or have any ideas. |
This happens to us using the https://github.com/actions/virtual-environments/blob/main/images/win/Windows2022-Readme.md#net-core-sdk |
This is still happening for me as well.
❯ nuke
PowerShell Desktop version 5.1.22000.282
Microsoft (R) .NET Core SDK version 6.0.100
Creating directory 'C:\Source\Redacted.EntityFrameworkCore\.nuke\temp'...
███╗ ██╗██╗ ██╗██╗ ██╗███████╗
████╗ ██║██║ ██║██║ ██╔╝██╔════╝
██╔██╗ ██║██║ ██║█████╔╝ █████╗
██║╚██╗██║██║ ██║██╔═██╗ ██╔══╝
██║ ╚████║╚██████╔╝██║ ██╗███████╗
╚═╝ ╚═══╝ ╚═════╝ ╚═╝ ╚═╝╚══════╝
NUKE Execution Engine version 5.3.0 (Windows,.NETCoreApp,Version=v5.0)
The SDK 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' specified could not be found. C:\Program Files\dotnet\sdk\6.0.100\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props
StackTrace:
at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImportsFromUnescapedImportExpressionConditioned(String directoryOfImportingFile, ProjectImportElement importElement, List`1& projects, SdkResult& sdkResult, Boolean throwOnFileNotExistsError)
at Microsoft.Build.Evaluation.Evaluator`4.ExpandAndLoadImports(String directoryOfImportingFile, ProjectImportElement importElement, SdkResult& sdkResult)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount, PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext, Boolean interactive)
at Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project..ctor(ProjectRootElement xml, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
at Microsoft.Build.Evaluation.Project.FromProjectRootElement(ProjectRootElement rootElement, ProjectOptions options)
at Nuke.Common.ProjectModel.ProjectModelTasks.ParseProject(String projectFile, String configuration, String targetFramework)
at Nuke.Common.Execution.Telemetry.CheckAwareness() |
@hellfirehd please read #22221 (or better visit official Nuke community in Slack to get support there) |
Sorry for the delay, @sfoslund ! Yes, a barebones solution that reproduces the issue for me is attached. The steps are simply to open Visual Studio 2022, load the solution and try starting Live Unit Testing when the |
I am also having this issue. Attempting to run my project (https://github.com/ppy/osu) in monodevelop gives me: |
That is because monodevelop is not supported anymore I think at all. |
I created a .NET 4 webapplication project and migrated it to the SDK-style projectfile format (using this project). To build it I need to use msbuild (as both |
I would like to ask for this issue to be reopened. Upon install of VS2022 (v17.0 - build8989) on x64 Mac, I get this error. Do not get this error when building from command line. Have 3x deleted every trace of Mono, Xamarin, NuGet, DotNet, and VisualStudio from my system and reinstalled VS2022 to the same result. Setting the |
CORECTIONI am finally able to get VS2022 for Mac (v17.0 - build 8989) working by setting the For those who have the same issue: Note that the most systemic way to set environment variables in MacOS is through
The old approach of systemically setting environmental variables was via 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 ( TO THE MAINTAINERSI still ask that you consider reopening this issue. Several times it is stated that setting the |
@mrward the latest customer reply above is specific to VSMac 17.0. Have you seen this behavior in your own testing of VSMac 17? Since you manage how the SDK gets inserted and configured into VSMac, I wonder if there is an issue with that specific scenario. |
@marcpopMSFT There is this feedback ticket - https://developercommunity.visualstudio.com/t/Unable-to-find-SDK-’MicrosoftNETSDKWo/10053602 - which has the same error, and needs further investigation. With this feedback ticket the problem seems to be that one of the project's in the solution is a non-sdk project (or one that targets .NET Framework v4) which causes VS Mac 17.0 to use MSBuild on mono for the solution, and .NET 6.0.300 SDK was the only SDK installed, which is not supported by MSBuild on mono. VS Mac downgrades the .NET SDK to allow MSBuild on mono to work, and then that means there is no SDK available which I suspect then causes the workload resolver to fail. This particular problem is specific to VS Mac and is not a dotnet sdk or runtime issue. dotnet restore/build would not be affected by this. Possible workarounds that may fix this are to install .NET 6.0.10x SDK, or to uncheck the Solution options - Build - General - Build with MSBuild on Mono check box. |
@mrward : FWIW:
I use the above conditionals (and, as needed, corresponding solution files) to reduce build times when doing application debugging. |
I am running into this with my VS for Mac 2019 and 2022 projects. It seems including a .NET 6 project into a solution breaks resolution. Hoping for a fix as this affects all my projects.
That worked for at least one of my projects. Thank you. |
Thank you @baskren ! ''' finally brought back my rider ide |
Just had this issue on VS 17.3.6 (build 20) on macOS Monterey 12.6 Wasted days before finding this "launchctl setenv MSBuildEnableWorkloadResolver false" The issue started after installing latest Xamarin.iOS. Seems like a lot of regression testing is left with the community. |
I just had this issue with Visual Studio for Mac 17.3.8 (build 5). This issue is clearly not fixed and should be reopened. |
I got this issue for the first time today with the latest Macos version 17.5 Workaround is to executer: Release ID: 1705000437 INFO [2022-11-08 15:30:51Z]: Running on .NET 7.0.0 (64-bit) |
Got this issue today after updating to VS Mac 17.5. I need to set the environment variable every time i reboot. |
Just adding to the anecdotes -- I also encountered the issue and had to set the environment variable. |
Same here VS Mac 17.5 Preview (17.5 build 437) |
The 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' not being found error can happen in VS Mac for different reasons. There is a recent feedback ticket where if there were old pre-release versions of .NET 7 installed then this could also happen: https://developercommunity.visualstudio.com/t/After-updating-to-net-7-Visual-Studio-/10194756 The underlying bug, old workload was renamed in later .NET 7 SDK, was also reported for Windows - #28947 The workaround there is to remove .NET completely and install it again. The developer community ticket gives information on how to do that. If that does not solve the problem, then we would need the IDE log. Since the IDE log may contain personal data it would better if this was reported on Developer Community or via Report a Problem from with VS Mac itself. Thanks. |
In VS building a mostly empty web project fails with
At CLI it suceeds by has a different warning (which is #17388)
The text was updated successfully, but these errors were encountered: