Open ltcmelo opened 4 years ago
What OS are you using?
Can you share a problematic solution?
I'm running both macos and linux (ubuntu), with .NET Core. I've come across a few projects in which the problem is reproducible, one of them is the music store sample (you might need to git reset
the repo to the 3.1 tag).
Note that the buildalyzer does build the project successfully (through I call IProjectAnalyzer.Build
, with/without specific targets), as I describe; the issue is the hanging.
Another open source app example: https://github.com/HooliCorp/Goatly.NET
There's been a lot of work around the pipe logger recently so I'm 🤞 this is resolved. I'm going to close the issue, but let me know if you're still seeing the problem on Buildalyzer 4.1.2 or later.
I'm 🤞 this is resolved
It isn't :-)
To be thorough, it did work up to net5, but with net6 the incompatibilities around MsBuild emerged back.
I'll take another look at this one - with the update to .NET 6 for Buildalyzer pending in #220 maybe that will help (though I'm doubtful - if the problem is that the .NET 6 MSBuild is doing something unexpected for these projects updating the Buildalyzer target won't resolve that).
I can consistently reproduce this hanging:
dotnet run --project BuildalyzerDemo/BuildalyzerDemo.csproj <path-to-GoatlyCore.sln-file>
Here's the dotnet --info
: dotnetinfo.txt.
After some debugging, here's what I noticed:
The hanging happens on PipeStream.Dispose
. Stack trace:
It enters MsBuildPipeLogger.ReadAll
and MsBuildPipeLogger.Dispose
twice (I guess because of the presence of .cshtml files), and it's only during the second iteration that the hanging occurs.
Oddly enough, if we start a new process while the first one is hanging, the second process won't hang. Could this be related?: https://github.com/dotnet/runtime/issues/63536
Moreover, just noticed that the hanging is gone once we pass a TargetFramework property to MSBuild. See, e.g. https://github.com/xavierpinho/BuildalyzerDemo/blob/master/BuildalyzerDemo/Program.cs#L15. Rings any bell, perhaps?
Same issue. .NET 7 and 6. Was using 4.1.6. Upgrading to latest version to see if it still happens, but I assume so since this bug is still open.
I only experience the issue on Linux and OS X.
Yup. Broken in 5.0.1.
I just released several fixes, including a bunch of reference updates. If anyone here is still using Buildalyzer, and still having this problem, I'd be curious if it's resolved in 6.0.3?
It does not appear to have resolved it for me.
I made a description of the issue, together with a PR in (your other) project.