-
Notifications
You must be signed in to change notification settings - Fork 4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
System.ArgumentException in SolutionState.CompilationTracker.cs #31390
Comments
Tagging @jasonmalinowski @heejaechang |
We JUST Ran into this on one of our larger solution files (~1000 Projects; ~90,000 files) we'll try the patch and report back. **Edit: So in researching this issue we found that we had a duplicated ProjectReference in one of our projects; removing this duplicate resolved the issue but it might be nice to get a little better error message. It appears that the suggested fix is just to ignore the duplicated Projects which seems wrong in my mind. For now we are going to fix our processes to avoid adding duplicate ProjectReferences. |
@aolszowka What tool were you using that was crashing? Visual Studio, or some command line tool that was processing your projects? |
@jasonmalinowski Hi Jason, I was/am using using the StyleCopTester Tool (https://github.com/DotNetAnalyzers/StyleCopAnalyzers/tree/master/StyleCop.Analyzers/StyleCopTester) As I noted above I corrected the project that had the duplicate ProjectReference and have not had an issue since. I have also switched to generating Solution files to contain all of our projects (~3,000) that bad boy takes 25-30GB of RAM to run but man it fixes (most) of the errors :) |
@aolszowka OK, good, just wanted to confirm it was a tool that (behind the scenes) is using MSBuildWorkspace. |
The workspace isn't supposed to allow duplicate ProjectReferences, but currently due to dotnet#12101 it does. This dedups (correctly) at the surface and also adds a test to ensure this isn't broken. Fixes dotnet#31390.
Oops thought I had merged. My bad. |
Version Used: Latest roslyn master sources
Steps to Reproduce:
C:\roslyn
.C:\roslyn\Binaries\Debug\Exes\AnalyzerRunner\AnalyzerRunner.exe C:\roslyn\Binaries\Debug\Exes\AnalyzerRunner c:\roslyn\Roslyn.sln /concurrent
Expected Behavior:
No exceptions
Actual Behavior:
System.ArgumentException: An item with the same key has already been added.
Also note that you might see assert from #31388
.Add
invocation below seems to be throwing here when processingsrc\NuGet\VisualStudio\VS.ExternalAPIs.Roslyn.Package.csproj
:Call stack:
The text was updated successfully, but these errors were encountered: