AArnott / CodeGeneration.Roslyn

Assists in performing Roslyn-based code generation during a build.
Microsoft Public License
408 stars 60 forks source link

Causes frequent VS2019 16.3 freeze #171

Closed ugumba closed 4 years ago

ugumba commented 4 years ago

In my solution with ~100 projects, ~20 use codegen 1.6.1 (netstandard20). After upgrading to VS2019 16.3, we often experience freezes - not enough to be unusable, but annoying. It can happen during a build, during live code analysis, or while trying to exit VS.

Killing a hanging "dotnet codegen --version" in Task Manager always resolves the freeze.

AArnott commented 4 years ago

What kinds of projects are you using? Is it a .csproj? And is it a .NET SDK style csproj or the older variety?

ugumba commented 4 years ago

The ones using codegen are all modern csproj, netstandard20. Referenced by a few netcore30 (web/api apps). I also use R#, which does a lot of MSBuild under the hood. The "dotnet codegen --version" processes I kill are usually listed with only 30-40K memory in Task Manager. I almost never see the "VS is slow - reporting to MS" popup, so I guess it's hard to diagnose. Anything I can do on my end?

AArnott commented 4 years ago

Great. I'm glad you're using the newest project file format. That means you're also using CPS which is our most modern project system, and the most likely to be able to address UI delays like what you're experiencing, if in fact fixing it in VS is required. But maybe there's a bug we can fix in CG.R.

Can you us VS's "Report a Problem" command and select the performance tab and reproduce the problem? That will collect an ETL trace and send it to Microsoft. Then you'll get an email with a link to the issue you filed. If you send me that link, I'll look at the data and see what if anything we can do.

ugumba commented 4 years ago

Thanks! Here's the issue: https://developercommunity.visualstudio.com/content/problem/801839/locked-by-dotnet-codegen-on-closing-solution.html

AArnott commented 4 years ago

Thanks, @ugumba. It looks like this isn't a dotnet codegen issue. Based on your trace, it's JetBrains that's really getting you down.

ugumba commented 4 years ago

I've uninstalled Resharper now, and I haven't seen the issue since - so it looks like you're correct. Thanks for your time!