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

init. Removed dependency on MSBuildLocator.RegisterDefaults(). #1983

Merged
merged 3 commits into from
Aug 10, 2022

Conversation

deepchoudhery
Copy link
Member

@deepchoudhery deepchoudhery commented Aug 9, 2022

We were using Microsoft.Build.Locator to load in requisite Microsoft.Build assemblies (using MSBuildLocator.RegisterDefaults()) to :

  • initialize Microsoft.Build.Evaluation.Project object
  • use Project.GetProperty("ms build property name")?.EvaluatedValue to get needed MSBuild project properties
  • we needed the "Nullable" property.

Now:

  • Added Nullable string property to IProjectContext
  • Initialize IProjectContext during runtime msbuild operation using updated VS.Web.CG.Msbuild/Target/build/Microsoft.VisualStudio.Web.CodeGeneration.Tools.targets file.
  • Nullable property populated at runtime without performing additional Microsoft.Build initialization and calls.

Changes :

  • Removed package references to Microsoft.Build.Locator
  • Removed all calls to MSBuildLocator.RegisterDefaults().
  • Added tests with nullable = enable, disable and the nullable property missing (disable by default).

@deepchoudhery deepchoudhery self-assigned this Aug 9, 2022
Copy link
Contributor

@zahalzel zahalzel left a comment

Choose a reason for hiding this comment

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

LGTM

@deepchoudhery deepchoudhery merged commit 43c849e into main Aug 10, 2022
@deepchoudhery deepchoudhery deleted the dev/decho/remove-msbuild-locator-dependency branch August 10, 2022 00:07
deepchoudhery added a commit that referenced this pull request Aug 10, 2022
* init. Removed dependency on MSBuildLocator.RegisterDefaults().

* minor fixes

* minor fixes
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.

2 participants