Roslyn Analyzer
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, devtools
Research direction
Start by reviewing issue #64 and the documented MSBuildLocator.RegisterDefaults usage to understand the failure pattern. The proposed result is a Roslyn analyzer shipped with this package that detects MSBuild API references in methods calling the locator; the issue does not name implementation files or tests.
Written by the indexing model from the issue text.
Description
There's a very common problem using Locator, which is that the natural code change to use it:
void DoStuff()
{
+ MSBuildLocator.RegisterDefaults();
var project = new Microsoft.Build.Evaluation.Project(projectPath);
Doesn't work, because .NET loads all types referenced in a method before executing that method, so it tries to load MSBuild APIs before the Locator has made that possible.
#64 is one example of this but there have been a ton.
We can't fix this in the deployed code, because it won't have been loaded in time to do anything.
It might be possible, though, to create a Roslyn analyzer that ships as part of this package that checks to make sure there are no MSBuild APIs in a method that calls the locator. That would make things much easier for new users.
- 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 ·
-
Difficulty 5/5 Over a week Newbie friendliness 30/100
microsoft/MSBuildLocator#371 · 1 comment ·
All issues in microsoft/MSBuildLocator
Similar issues
-
type/automation type/tech-debt
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
-
bug
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
-
t/bug
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
ci-failure-cause test-failure
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
-
area:auth FE mvp P3
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
klasolsson81/jobbliggaren#1788 ·