Automatic MSBuild Registration via Module Initializer
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 30/100
- Issue type
- Feature
- Clarity
- Mostly clear
- Activity status
- Stale
- Tech stack
- csharp
- Domain
- build-system
Research direction
Start by reviewing the existing MSBuildLocator.RegisterDefaults() and other Register* entry points, then examine how a module initializer and the MSBuildLocatorGenerateDefaultInitialization property could control generated initialization. Done means a default MSBuild instance is registered automatically by default, while setting the property to false preserves explicit registration control.
Written by the indexing model from the issue text.
Description
Summary
Add a zero-configuration option for MSBuildLocator that automatically registers a default MSBuild instance without requiring an explicit call to MSBuildLocator.RegisterDefaults().
Motivation
Currently, every consumer of MSBuildLocator must explicitly call MSBuildLocator.RegisterDefaults() (or one of the other Register* methods) before using any MSBuild APIs. For users who don't need to customize which MSBuild instance is used, this is unnecessary ceremony.
A common question from new users: "Why do I need to call RegisterDefaults() if I never customize the MSBuild location?"
For the majority use case where the default behavior is acceptable, requiring explicit initialization adds friction without providing value.
Proposed Solution
Use a module initializer to automatically register a default MSBuild instance when the assembly loads.
Opt-out mechanism
Introduce an MSBuild property to control this behavior:
<MSBuildLocatorGenerateDefaultInitialization>false</MSBuildLocatorGenerateDefaultInitialization>
When set to false, the automatic initialization file would not be generated, allowing users to retain full control over registration timing and configuration.
- Dominant language
- C#
- Stars
- 262
- Forks
- 91
- Avg merge
- 11d 22h
- Merged PRs (30d)
- 3
Contributor guide
No contributing guide indexed for this repository
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/MSBuildLocator
-
Difficulty 3/5 1-2 days Newbie friendliness 52/100
microsoft/MSBuildLocator#390 · 1 reaction ·
-
Difficulty 4/5 3-5 days Newbie friendliness 64/100
microsoft/MSBuildLocator#389 ·
-
Difficulty 4/5 3-5 days Newbie friendliness 45/100
microsoft/MSBuildLocator#380 ·
-
Difficulty 3/5 1-2 days Newbie friendliness 48/100
microsoft/MSBuildLocator#377 ·
-
microsoft/MSBuildLocator#368 · 2 comments · 4 reactions · 1 assignee ·
All issues in microsoft/MSBuildLocator
Similar issues
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
nightscout/nocturne#1425 ·
-
enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
-
Difficulty 2/5 1-3 hours Newbie friendliness 65/100
-
Documentation
Difficulty 2/5 1-3 hours Newbie friendliness 75/100
cake-build/cake#5024 ·
-
Frontend status/draft TechnicalDebt
Difficulty 2/5 1-2 days Newbie friendliness 75/100
Altinn/altinn-auth#4143 ·