dotnet / dotnet/msbuild

Analyzer for "bad" AssemblySearchPaths

Open
#10,368 3 comments 0 reactions 0 assignees View on GitHub
Area: BuildCheck BuildCheck Suggestion triaged
Dominant language
C#
Stars
5.5k
Forks
1.5k
Avg merge
1d 8h
Merged PRs (30d)
141

Description

AssemblySearchPaths should just be `{RawFileName};{HintPathFromItem};{TargetFrameworkDirectory}`

Many builds still have `{GAC}`, registry and other such nonsense. We should consider an analyzer that recommends turning off the "bad" ones and only leave the above three. It might of course reveal cases where people accidentally depend on the bad ones, but maybe trying to turn them off one by one will lead people towards improving their builds.

.NET SDK already defaults to the three good ones plus CandidateAssemblyFiles. CandidateAssemblyFiles is bad, I sometimes see someone include a .dll as Content, and it ends up being an input to RAR, unintentionally. So most newer projects should be in good-ish shape.

See related: https://github.com/dotnet/msbuild/issues/3784

Thankfully we now have properties to individually turn off each of those:
https://github.com/dotnet/msbuild/pull/7008

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.