Skip to content
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

Clean up MSBuild environment initialization and allow it to use Visual Studio 2017 if it's present #818

Merged

Conversation

DustinCampbell
Copy link
Contributor

Fixes dotnet/vscode-csharp#1368

This change ensures that OmniSharp will use the MSBuild tools installed with Visual Studio 2017 if they're present on the machine. This allows OmniSharp to properly handle VS 2017 projects where the targets/tasks aren't include with OmniSharp's local MSBuild, such as WebApplication projects as reported in the bug listed above. If VS 2017 is not on the machine, OmniSharp will continue to use its local MSBuild which has a fallback to the Microsoft Build Tools for targets/tasks that it can't find.

I've also taken the opportunity to clean up a lot of the MSBuild environment initialized code and project file processing.

…l Studio 2017 if it's present

Fixes dotnet/vscode-csharp#1368

This change ensures that OmniSharp will use the MSBuild tools installed with Visual Studio 2017 if they're present on the machine. This allows OmniSharp to properly handle VS 2017 projects where the targets/tasks aren't include with OmniSharp's local MSBuild, such as WebApplication projects as reported in the bug listed above. If VS 2017 is not on the machine, OmniSharp will continue to use its local MSBuild which has a fallback to the Microsoft Build Tools for targets/tasks that it can't find.

I've also taken the opportunity to clean up a lot of the MSBuild environment initialized code and project file processing.
Copy link
Member

@david-driscoll david-driscoll left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looked at this last night and forgot to hit the button. LGTM

@DustinCampbell
Copy link
Contributor Author

Thanks!

@DustinCampbell DustinCampbell merged commit 0ad7681 into OmniSharp:dev Apr 9, 2017
var msbuildFolder = Path.Combine(AppContext.BaseDirectory, "msbuild");
// If MSBuild can locate VS 2017 and set up a build environment, we don't need to do anything.
// MSBuild will take care of itself.
if (MSBuildHelpers.TryGetVisualStudioBuildEnvironment())
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice

@DustinCampbell DustinCampbell deleted the improve-msbuild-support branch May 9, 2017 12:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants