dotnet / dotnet/msbuild

[On Hold] Prepary Microsoft.Build.Analyzers.AuthoringContracts assembly

Open
#9,826 1 comment 0 reactions 0 assignees View on GitHub
gathering-feedback triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

### Context

In order to author custom analyzer, one would need to reference Microsoft.Build currently. That is however carrying over too much other public API, so it can get confusing.
Extracting the analyzers contracts to separate assembly has it's own perf and usability concerns (e.g. https://github.com/dotnet/msbuild/pull/9735#discussion_r1495736682) - so the code is currently part of Microsoft.Build.
But we can prepare a spearate assembly - Microsoft.Build.Analyzers.AuthoringContracts - that just links all the contract codefiles used in Microsoft.Build, so that users can have a lightweight assembly to reference

### Gotchas

Such an assembly wouldn't be possible to use at runtime together with Microsoft.Build - due to duplicite existence of types. Users would need to be guided to reference it as compile time only reference (private assets). But we should think about putting some safety check that fails fast and more clearly in such situation (e.g. assembly initialization code that checks for presence of other msbuild assemblies?)

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.