Skip to content
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

Extremely slow builds likely due to non-private Microsoft.CodeAnalysis dependency in analyzer #59

Open
Jameak opened this issue Oct 15, 2024 · 1 comment · May be fixed by #60
Open

Comments

@Jameak
Copy link

Jameak commented Oct 15, 2024

After adding a package reference to MR.EntityFrameworkCore.KeysetPagination, the build times of my solution went from taking 1-2 minutes to around 50 minutes.
I think I've narrowed down the reason to be caused by the MR.EntityFrameworkCore.KeysetPagination.Analyzers package having a dependency on Microsoft.CodeAnalysis.CSharp.Workspaces that is marked as non-private.

This causes my solution to get a transitive reference to Microsoft.CodeAnalysis.CSharp.Workspaces, which then seems to trigger this roslyn analyzer issue: dotnet/roslyn-analyzers#6676

By overwriting the transitive Microsoft.CodeAnalysis.Analyzers reference from v3.3.4 to v3.11.0 via central package management the issue goes away.

I've looked at the csproj files of some other analyzers while debugging this issue, and they all seem to mark their Microsoft.CodeAnalysis.* dependencies as PrivateAssets="all". If you make that change, then this issue probably wont hit any other users of this package.

@mrahhal
Copy link
Owner

mrahhal commented Oct 15, 2024

Thanks for reporting this. I will update the analyzer package's dependencies. Microsoft.CodeAnalysis.CSharp.Workspaces can't be marked with PrivateAssets="all" as I get errors otherwise. Not sure how other packages are using it.

Regardless, depending on Microsoft.CodeAnalysis.CSharp.Workspaces itself is also an issue, and should be replaced with Microsoft.CodeAnalysis.CSharp. Hopefully this will resolve the issue.

@mrahhal mrahhal linked a pull request Oct 15, 2024 that will close this issue
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants