phmonte / Buildalyzer

A utility to perform design-time builds of .NET projects without having to think too hard about it.
MIT License
589 stars 92 forks source link

ProjectReferences could be duplicated, which ends up with ThrowArgumentItemNullOrDuplicateException #203

Closed Mingxue008 closed 2 years ago

Mingxue008 commented 2 years ago

Buildalyzer is only parsing the csproj files, and doesn't ensure that ProjectReferences to be distinct when accessed by users. After users get their AnalyseResult and try to add that result back into an AdhocWorkspace, which will call Roslyn ProjectInfo.Create() API and trigger ThrowArgumentItemNullOrDuplicateException by Roslyn default behavior. We would expect ProjectReferences to be distinct even users somehow edit their csproj files and accidently duplicated them.

daveaglick commented 2 years ago

Thanks a bunch for taking the lead on getting this fixed @Mingxue008! Resolved in #204.

Mingxue008 commented 2 years ago

@daveaglick any update on the release of Buidalyzer?

daveaglick commented 2 years ago

@Mingxue008 I actually totally forget this wasn't released yet! Thanks for the reminder, pushing the release button now.

Mingxue008 commented 2 years ago

Thanks for the release, much appreciated.