'Nuget SDK missing when Scaffolding a class Using Ardalis clean architecture template

Hi I trying Ardalis Clean Architecture. Running VS 2022 and dotnet 6. I am trying to scaffold a class and get the following error in the code generator phase:

"Scaffolding failed. SDK Resolver Failure: "The NuGet-based SDK resolver failed to run because NuGet assemblies could not be located. Check your installation of MSBuild or set the environment variable "MSBUILD_NUGET_PATH" to the folder that contains the required NuGet assemblies. System.IO.FileLoadException: Could not load file or assembly 'NuGet.Versioning, Version=6.0.0.278, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. Could not find or load a specific file. (0x80131621)To see more information, enable tracing by setting environment variable 'codegen_trace' = 1.

File name: 'NuGet.Versioning, Version=6.0.0.278, Culture=neutral, PublicKeyToken=31bf3856ad364e35' ---> System.IO.FileLoadException: Could not load file or assembly 'NuGet.Versioning, Version=6.0.0.280, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. at System.Runtime.Loader.AssemblyLoadContext.LoadFromPath(IntPtr ptrNativeAssemblyLoadContext, String ilPath, String niPath, ObjectHandleOnStack retAssembly) at System.Runtime.Loader.AssemblyLoadContext.LoadFromAssemblyPath(String assemblyPath) at Microsoft.Build.Shared.MSBuildLoadContext.Load(AssemblyName assemblyName) at System.Runtime.Loader.AssemblyLoadContext.ResolveUsingLoad(AssemblyName assemblyName) at System.Runtime.Loader.AssemblyLoadContext.Resolve(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName) at Microsoft.Build.NuGetSdkResolver.NuGetSdkResolver.NuGetAbstraction.TryParseNuGetVersion(String version, Object& parsed) at Microsoft.Build.NuGetSdkResolver.NuGetSdkResolver.TryGetNuGetVersionForSdk(String id, String version, SdkResolverContext context, Object& parsedVersion) at Microsoft.Build.NuGetSdkResolver.NuGetSdkResolver.Resolve(SdkReference sdkReference, SdkResolverContext resolverContext, SdkResultFactory factory) at Microsoft.Build.BackEnd.SdkResolution.SdkResolverService.ResolveSdk(Int32 submissionId, SdkReference sdk, LoggingContext loggingContext, ElementLocation sdkReferenceLocation, String solutionPath, String projectPath, Boolean interactive, Boolean isRunningInVisualStudio)" C:\Workspace\VSProjects\CleanArchitecture\xxx..."

Any one have a clue what is missing?



Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source