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
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
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)In my experience, people here never answer msbuild questions like this
IG I'll make an SO post for it at some point instead
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
qhar?
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
which link?
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
oh so -- can you not invoke MSBuild programatically or?
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
I was working off of this https://learn.microsoft.com/en-gb/visualstudio/msbuild/msbuild-api?view=vs-2022
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•3d ago
Message Not Public
Sign In & Join Server To View
is MSDN just outdated here then?
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
I can see what that says -- just asking whether that MSDN page is like
for something else
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
I mean the context is basically just "reimplement"
dotnet build
kwkUnknown User•3d ago
Message Not Public
Sign In & Join Server To View
yeah?
like I assume that's just using this internally
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
I can see it -- I just thought it's preferable to ask in forums for more drawn out q.s no?
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
isn't that just crossposting?
oki dokes
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
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•3d ago
Message Not Public
Sign In & Join Server To View
I'm not sure if I can provide more context by my application
user gives sln path, I build it
Unknown User•3d ago
Message Not Public
Sign In & Join Server To View
I know?
it just doesn't have stuff relevant to my situation