C
C#3d ago
Emily-TTG

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?
31 Replies
Emily-TTG
Emily-TTGOP3d ago
if I just remove the manifest the error is replaced with The SDK 'Microsoft.NET.Sdk' specified could not be found (also to clarify -- the sln builds fine if I build it directly)
Anton
Anton3d ago
In my experience, people here never answer msbuild questions like this
Emily-TTG
Emily-TTGOP3d ago
IG I'll make an SO post for it at some point instead
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
sure https://github.com/StudioCherno/Coral/tree/dev the relevant code is at uh
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
qhar?
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
which link?
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
oh so -- can you not invoke MSBuild programatically or?
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
Build and inspect projects with the MSBuild API - MSBuild
Explore the public API surface provided in MSBuild that you can use to enable your program to perform builds and inspect projects.
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
is MSDN just outdated here then?
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
I can see what that says -- just asking whether that MSDN page is like for something else
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
I mean the context is basically just "reimplement" dotnet build kwk
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
yeah? like I assume that's just using this internally
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
I can see it -- I just thought it's preferable to ask in forums for more drawn out q.s no?
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
isn't that just crossposting? oki dokes
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
Sure I mean I can just use this API you've sent instead of the ms.build one and it might "just work"
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
I'm not sure if I can provide more context by my application user gives sln path, I build it
Unknown User
Unknown User3d ago
Message Not Public
Sign In & Join Server To View
Emily-TTG
Emily-TTGOP3d ago
I know? it just doesn't have stuff relevant to my situation

Did you find this page helpful?