-
Notifications
You must be signed in to change notification settings - Fork 1.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
How do I use Microsoft.Build
within my app to load a project?
#2839
Comments
@firelizzard18 You should set own SDK resolver or use |
How would I set my own resolver? Looking through the source of |
I am having a similar problem, I am using My project file looks like this:
Note: As per #2803 I have specified the package version hoping this will light up the nuget sdk resolver. In the parent directory of this project file, I have a
In the "local-packages" folder I have the nuget package containing the SDK that I am wanting to be resolved. The message I get when I try to load this project
The stack trace:
I set the following environment variables at runtime before attempting to load the project using msbuild:
What gives? |
I am not sure what has changed, but this has started working for me today. The nuget based sdk resolver suddenly finds and restored my sdk package. The only thing I can think of is either that a recent VS upgrade fixed it, or perhaps it was related to nuget cache. |
I want to use the
Microsoft.Build
nuget package in a .NET Core app to load a project file. I do not have Visual Studio installed. I am only using the dotnet cli.Steps to reproduce
Project file
Directory contents:
Program.cs:
Command line
Expected behavior
I can load the CS project file
Actual behavior
Initially:
After setting
MSBuildSDKsPath=/usr/local/share/dotnet/sdk/2.1.3/Sdks
andMSBuildExtensionsPath=/usr/local/share/dotnet/sdk/2.1.3
:Environment data
dotnet --version
: 2.1.3OS info: Mac
The text was updated successfully, but these errors were encountered: