Emily-TTG
Emily-TTG
CC#
Created by Emily-TTG on 1/23/2025 in #help
Project which programatically calls MSBuild does not properly configure NuGetSdkResolver path
I'm writing a hosting library and want to expose solution building to native code -- so I'm using Microsoft.Build.* stuff from native land. The actual dispatch appears to work fine but it fails with
Could not load SDK Resolver. A manifest file exists, but the path to the SDK Resolver DLL file could not be found. Manifest file path '.\Build\Debug\SdkResolvers\Microsoft.Build.NuGetSdkResolver\Microsoft.Build.NuGetSdkResolver.xml'. SDK resolver path: .\Build\Debug\Microsoft.Build.NuGetSdkResolver.dll .\Example\Example.Managed\Example.Managed.csproj(0, 0)
Could not load SDK Resolver. A manifest file exists, but the path to the SDK Resolver DLL file could not be found. Manifest file path '.\Build\Debug\SdkResolvers\Microsoft.Build.NuGetSdkResolver\Microsoft.Build.NuGetSdkResolver.xml'. SDK resolver path: .\Build\Debug\Microsoft.Build.NuGetSdkResolver.dll .\Example\Example.Managed\Example.Managed.csproj(0, 0)
The build appears to be generating the manifest file which points to the base dir with all required DLLs, but the NuGetSdkResolver DLL does not get copied in there as part of the build. I'm not quite sure how to resolve this -- is there a way to tell my solution not to generate that manifest or make it point to the correct location? Alternatively a way to make it copy in the NuGetSdkResolver DLL?
79 replies
CC#
Created by Emily-TTG on 1/13/2025 in #help
Resolve `dotnet` executable path programmatically
Trying to get NuGet packages loading correctly under a hosted env. -- so I need to grab the NuGet package dir. But doing so programmatically itself seems to require a NuGet package so I'm trying to just grab the output from dotnet nuget locals global-packages --list instead. However I want to try and support a situation where the executing dotnet may not be the one on the PATH, or no dotnet is present on the PATH at all -- so I'd like to grab the dotnet executable which is running the current program. I couldn't find a reliable way to do this without some janky solution like getting the process argv with native APIs so I thought I'd ask here. Thanks in advance!
111 replies