Hacktoberfest 2026: le issue che i maintainer hanno segnato per ottobre, aperte e adatte ai principianti. Sfoglia le issue Hacktoberfest

Should MSBuildLocator.RegisterDefaults register the highest VS version instead of first?

Aperta
#81 4 commenti 5 reazioni 0 assegnatari Vedi su GitHub

Nessuno ha ancora preso questa issue.

Valutazione

Difficoltà
4/5
Tempo stimato
3-5 giorni
Idoneità per principianti
35/100
Tipo di issue
Funzionalità
Chiarezza
Abbastanza chiara
Stato di attività
Ferma
Stack tecnologico
csharp
Ambito
build-system

Direzione di ricerca

Inizia da src/MSBuildLocator/MSBuildLocator.cs, intorno all’implementazione collegata di RegisterDefaults, e analizza come vengono individuate e selezionate le istanze installate di Visual Studio. Riproduci lo scenario VS2017/VS2019 descritto nell’issue, quindi verifica che il comportamento di registrazione predefinito corrisponda alla scelta della versione prevista senza interrompere i chiamanti esistenti.

Scritto dal modello di indicizzazione a partire dal testo della issue.

Descrizione

Right now MSBuildLocator.RegisterDefaults registers the first instance it finds on the machine, whatever that is:

https://github.com/microsoft/MSBuildLocator/blob/ecd04bf208ed0cc3e67d46e7eb90359df7315504/src/MSBuildLocator/MSBuildLocator.cs#L93

This provides to be wrong in a lot of cases: for example, any tool using RegisterDefaults won't be able to analyze the Roslyn solution on a machine with both VS2017 and VS2019. RegisterDefaults will pick the 2017 version, which will break because we're using the new "GetPathsOfAllDirectoriesAbove" feature which doesn't exist in 2017. Just yesterday both I and @sharwell were independently replacing this in two separate tools with the exact same PR:

https://github.com/dotnet/roslyn/pull/40886
https://github.com/dotnet/roslyn/pull/40574/commits/43e13de123dce589518b51dd48bbe82aadba5361

Should this just be the automatic behavior? Because .editorconfig support uses this new MSBuild feature, anybody using any tool using the default function that has both VS2017 and VS2019 on their machine is going to get potentially very unexpected results.

Lingua principale
C#
Stelle
262
Fork
91
Merge medio
11g 22h
PR unite (30g)
3

Guida per i contributori

Nessuna guida per i contributori indicizzata per questo repository

Come iniziare

  1. Leggi tutta la issue e poi la guida ai contributi del progetto.
  2. Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
  3. Fai un fork del repository e lavora su un branch.
  4. Apri una pull request che faccia riferimento al numero della issue.

Altre issue di microsoft/MSBuildLocator

Tutte le issue di microsoft/MSBuildLocator

Issue simili

Altre issue su C#

Ricevi le nuove issue nella tua casella

Un breve riepilogo di issue GitHub adatte ai principianti.