Skip to content

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.

3 participants