Regression in v1.5.3 - The SDK 'Microsoft.NET.Sdk' specified could not be found.
kamronbatman opened this issue · 4 comments
I updated our dependency in this project from 1.4.1 to 1.5.3: https://github.com/modernuo/SerializationGenerator/tree/main/ModernUO.Serialization.SchemaGenerator and now I am getting the error The SDK 'Microsoft.NET.Sdk' specified could not be found.
I have the VS2022 and 6.0.400 SDK installed. I do not have .NET 7 preview installed.
EDIT: Now I have a weird issue. I decided to not update this package and leave it at 1.4.1. But I did update WorkSpaces to 4.3.0. And it seems to also be broken, but only when I use the nuget package I built, not in the IDE (either VS or Rider).
This is super weird and a new problem. I am going to try and revert back to workspaces v4.2.0 and see if that fixes it.
EDIT 2: It looks like reverting to msbuildlocator 1.4.1 and workspaces 4.2.0 fixed it. So I am not sure if this is even an issue with this package. I would love some advisement since I am a little lost tracking it all.
Also to note: MSBuildLocator 1.5.3 and Workspaces 4.2.0/4.3.0 do not work. And with Workspaces 4.3.0, MacOS 11 gets a hostfx native image error while trying to find the SDK, which I think is a separate issue, but relevant to my testing since I test on a variety of operating systems.
Failing to find the SDK sounds like either an MSBuild bug or an SDK bug, as MSBuild owns the general process of SDK resolution, and the SDK owns the SDK resolver that should work in this case. I think Roslyn owns the MSBuildWorkspace, though I'm not sure about that.
The hostfxr bug is very plausibly an MSBuildLocator issue, though. Do you have a path to your dotnet executable on the PATH? And is there another (earlier) folder on your PATH that has either a bad executable or a symlink that looks reasonable but actually doesn't point to a file that exists? One of my recent (unmerged) PRs is trying to fix the latter problem.
I'd also check out #68 (comment), as that might be the issue.
I have wiped my MacOS since this issue. I'll do a clean setup with .net 7 and bump dependencies and see if I get the issue. I think #68 might be related but for a different reason since this is OSX.
The issue is fixed. Pending release.