Closed benaadams closed 3 years ago
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 global.json
does allow them to build
{
"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 msbuild
instead of dotnet
from the command line), you need the workload resolver enabled. This is enabled by default in VS 16.10 Preview 3. For previous versions of MSBuild, you can set the MSBuildEnableWorkloadResolver
environment variable to true
. However, this workaround is likely to stop working in Preview 4 or Preview 5 of .NET SDK 6.0.100, as there is a change to the workload manifest schema which will cause the previous version of the resolver to fail.
In short: Update to VS 16.10 Preview 3 or later if you can, and if you can't you can try setting the MSBuildEnableWorkloadResolver
environment variable to true
.
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.
Actually, I can't seem to create any projects...
I get this when doing new project in VS https://github.com/dotnet/sdk/issues/17515 have to create a new one in cli
Actually, a better workaround is probably to set MSBuildEnableWorkloadResolver
to false. This should avoid the issue with the manifest schema change.
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 dotnet build
from the command line. .NET 6 was working a few days ago when I was using the nightly releases, stopped working when I installed Preview 4.
Tried the workaround, setting MSBuildEnableWorkloadResolver
env variable to false seems to work. I was able to load and build the project now.
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.
Actually, a better workaround is probably to set MSBuildEnableWorkloadResolver to false. This should avoid the issue with the manifest schema change.
Can the SDK make this feature opt-in, rather than opt-out, until it's ready enough to work without such mitigations?
NuGet has a bunch of functional tests that restore various projects, and it's a bit of a burden to find all the places we need to set this. Plus we'll need to remember to remove it again in the future.
Seeing the same thing with .Net 6-preview-5, both with command-line builds and VS for Mac 8.10.2 (build 17). If I do:
export MSBuildEnableWorkloadResolver=false
that works around it and lets me build, both on the command-line and in VS4Mac.
For those not wanting to remember to set this env var, you can add a Directory.Build.rsp
file in the root of your repo to achieve the same thing, then once this gets fixed you can delete the file.
Example: https://github.com/slang25/JustEat.StatsD/commit/30fffb3c5cf6d94fb286642220445a95df5aa2fc
Just upgraded to VS for Mac 8.10.6 build 10, and .Net 6.0 preview-6, and still getting this. Any idea when it's likely to be fixed?
Just hit this too in the latest VS: Version 17.0.0 Preview 3.0 [31516.353.main]
C:\Program Files\dotnet\sdk\6.0.100-preview.7.21358.10\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props(14,3): warning MSB4242: The SDK resolver "Microsoft.DotNet.MSBuildWorkloadSdkResolver" failed to run. An item with the same key has already been added. Key: Microsoft.NET.Runtime.Emscripten.Node
C:\Program Files\dotnet\sdk\6.0.100-preview.7.21358.10\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. [C:\Development\DesignerTestHarness\WindowsFormsApp472\NetFx472.csproj]
@dsplaisted looks like I can't use VS at all, outside projects that use local version of .dotnet...
When this happens I typically rename the C:\Program Files\dotnet\sdk-manifests
folder, then restart VS
When this happens I typically rename the
C:\Program Files\dotnet\sdk-manifests
folder, then restart VS
Thanks! That worked.
I just set the MSBuildEnableWorkloadResolver
environment variable on all my machines to false
. Looking forward to what breaks in future when I forget I've done that 😀
I believe that with #18166 these error messages will get a bit more useful.
I think the more recent issues described by Russ happens when you install preview 7 and then install VS (which has preview 6), you get mismatching manifests with emscripten and it breaks. You can repair preview 7 to work around this or delete the manifests folder as you've done. It'll get resolved once we put preview 7 in VS.
So i've hit this as well. It took us almost a week to work through this. The only thing that worked was setting MSBuildEnableWorkloadResolver
to false
. Can fixing this be prioritized? (tagging @marcpopMSFT ). Thanks!
The fix requires either getting preview 7 inserted into VS or going back in time and not breaking compat between preview 6 and 7. Unfortunately, the .Net build system is not conducive to created earlier signed builds and inserting to VS so typically this happens very late in each milestone. The good news is that this should be the final compat break in the workloads and so preview 7 through GA should not have the same issues.
This compat issue was communicated to tactics but we could have gone more broadly with it.
Feels like this has been broken for 3 previews but I'm happy it's getting fixed in preview 7
There has been a lot of churn in the workloads (which we expected) but also churn in their names and dependencies (less expected). It should be fixed with preview 7 going forward mostly because the workload owners are done with that level of breaking change. We have a design for how to allow for smooth name changes with aliasing between different workloads but that work didn't get done for .net 6 (and was going to be a breaking change all on it's own).
Installed .Net 6 preview 7 this morning, and I still get the error about this workload when I launch Visual Studio for Mac, so still have to set export MSBuildEnableWorkloadResolver=false
to be able to continue working. So I'm not sure this is fixed in preview 7.
I fixed it by deleting the following folders from /usr/local/share/dotnet/sdk-manifests/6.0.100
I believe one of the older previews put these folders there, so it could be that it's fixed from occurring again, but with no automatic fix-up shipping in new previews.
Nice! Will try that later.
I had some problems with preview 7 (#19653), and when I reinstalled preview 6 they continued - in the end I had to manually delete/uninstall the preview 7 files that had been left behind. It might be useful if the folks from MSFT could add an option in the SDK installer that force-deleted all other older (and newer) previews completely, so people could ensure they were running with a clean install. Might reduce the number of false positive bug reports.
@sfoslund for visibility as we tried to put a hack into the resolver to avoid this particular rename but it looks like that may have only applied to VS. Workloads were designed to be SxS across different feature bands but not within the same one which previews are.
I fixed it by deleting the following folders from
/usr/local/share/dotnet/sdk-manifests/6.0.100
I tried deleting those folders, but it didn't fix the issue for me. I'm using the VS4Mac 2022 preview, and this workload issue hangs it at startup so you can't quit - the only way to solve it is force-quit. Luckily the export MSBuildEnableWorkloadResolver=false
solves it in there too.
The SDK 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' specified could not be found. C:\Program Files\dotnet\sdk\6.0.100-preview.7.21379.14\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Sdk.ImportWorkloads.props
Setting env variable helps.
Could someone confirm that this doesn't work with preview7
for them too?
Nuking the entire /usr/local/share/dotnet/sdk-manifests/6.0.100
from orbit seems to have resolved my issues -.- This has been such a pain.
Nuking the entire
/usr/local/share/dotnet/sdk-manifests/6.0.100
from orbit seems to have resolved my issues -.- This has been such a pain.
That did the trick. Thanks!
For folks seeing this error, here's a summary/overview.
The error The SDK 'Microsoft.NET.SDK.WorkloadAutoImportPropsLocator' specified could not be found
can be caused by several underlying issues.
It may indicate that the .NET workload resolver is not present in the MSBuild directory. This happens with versions of Visual Studio that do not support the .NET 6 previews. (It could also happen in corrupt MSBuild installations or custom MSBuild distributions, but that's an edge case.)
Otherwise, it indicates an internal error in the workload resolver, most likely when reading the workload manifests in the .NET SDK. A known case is a composition error due to stale manifests from an older .NET 6 preview, which can be fixed by removing the dotnet/sdk-manifests/6.0.100
directory from the .NET installation and reinstalling the latest .NET 6 SDK preview. If that doesn't fix it, check the MSBuild log for details of the internal error. It will be surfaced better in future.
if you can't find get to an MSBuild log in the IDE, you can invoke msbuild from the CLI. Be aware that Visual Studio includes its own copy of MSBuild, which can be invoked as follows:
msbuild
from that prompt.vsmac msbuild
from Terminal.app. If you have multiple VS instances, see vsmac --help
for arguments to select a specific instance.I got this issue in a docker container running a clean installation of .NET SDKs. Here is some info: Docker: 20.x (latest) Base image: balenalib's aarch64 (arm64v8) debian bullseye .NET sdk installed in docker container: 3.1, 5, 6-rc.1 Installation instructions: here Logs: here (login as guest) Project: here (running using Nuke build automation system) Server instance: Raspberry Pi 4 Model B (8 GB RAM) How to reproduce on my server? here, then setup using internal database and add a build configuration with versioning settings: enabled pointing to my repo, TeamCity should fetch the configuration from VCS automatically
Contact me if you need more info about my case
I've been hitting this a lot now too. It fails with both VS2019 and 2022, provided you have .NET6-rc1 installed. The repro steps are pretty simple:
git clone https://github.com/Esri/arcgis-toolkit-dotnet
cd arcgis-toolkit-dotnet\src\Toolkit\Toolkit
msbuild /restore Esri.ArcGISRuntime.Toolkit.csproj
Output:
"e:\sources.tmp\tktest2\arcgis-toolkit-dotnet\src\Toolkit\Toolkit\Esri.ArcGISRuntime.Toolkit.csproj" (default target) (1:35) ->
"e:\sources.tmp\tktest2\arcgis-toolkit-dotnet\src\Toolkit\Toolkit\Esri.ArcGISRuntime.Toolkit.csproj" (Build target) (1:48) ->
"e:\sources.tmp\tktest2\arcgis-toolkit-dotnet\src\Toolkit\Toolkit\Esri.ArcGISRuntime.Toolkit_zk34cdww_wpftmp.csproj" (_CompileTemporaryAssembly target) (4) -> e:\sources.tmp\tktest2\arcgis-toolkit-dotnet\src\Toolkit\Toolkit\Esri.ArcGISRuntime.Toolkit_zk34cdww_wpftmp.csproj(9,31): error MSB4236: The SDK 'MSBuild.Sdk.Extras/3.0.23' specified could not be found.
@dotMorten Have you got any other earlier .Net 6 previews installed? I saw this frequently until preview-7, but it only went away when I physically deleted all the old previews, per @TaylorWatson's comment previously (see also here).
@Webreaper On one PC where I reproduce it, it's a completely fresh install. Never had anything but RC1 and VS2022P4 on it. I'm starting to think my issue is WPF specific though.
Closing this issue out with the release of RC2 which we believe should fix most instances of this. Folks still seeing issues should try to clean out their sdks (in particular old sdk-manifests) and reinstall as many people still hitting this had leftover files from old maui-check calls. I think dotMorten's repro is a completely separate issue than this.
@marcpopMSFT I still have this issue with .NET 6 rc2, my case is described a few comments above
Here is full log of build: https://tc.vova-lantsov.dev/buildConfiguration/Vlrpi_Build_CreateBuilder/402?buildTab=log (login as guest)
@vova-lantsov-dev Was this a clean install of RC2 or did the machines used have prior versions? All situations of this we've found so far were people with older previews who upgraded or had previously used maui-check.
CC @dsplaisted
@marcpopMSFT that's a clean installation inside the docker container, after docker cache was pruned.
How I install SDKs: link
@vova-lantsov-dev so you're doing arm64 linux? @sfoslund, since many of the workloads doesn't support linux or arm64 today, do we have an issue in that package where they are not included but the sdk is looking for them anyway?
@marcpopMSFT sure, arm64v8 linux docker images
do we have an issue in that package where they are not included but the sdk is looking for them anyway?
@marcpopMSFT I'm not following, can you clarify what you mean? We expect that if a workload isn't supported on the current OS then installing that workload will fail early (before any packs are installed) with an error message about not being supported.
@sfoslund To clarify, I think the customer is using arm64 linux docker images, isn't trying to do workloads at all, but is getting workload failures when just using this sdk. I'm wondering if our workload fallback logic is working incorrectly here. I don't think they are doing a workload install at all from the build results. Could be something off specifically with our linux arm64 images maybe or our fallback logic
Here is full log of build: https://tc.vova-lantsov.dev/buildConfiguration/Vlrpi_Build_CreateBuilder/402?buildTab=log (login as guest)
@marcpopMSFT what you mean by workload?
In VS building a mostly empty web project fails with
At CLI it suceeds by has a different warning (which is https://github.com/dotnet/sdk/issues/17388)