Dotnet cli commands hang on "Done building Project"

Ubuntu 19.04
.NET Core SDK 2.2.402

Suddenly the dotnet command just started hanging for me after the initial info display, running dotnet build or dotnet watch run just hangs. Running dotnet build -v diag for more verbose logging shows that it hangs at:

Done executing task “RemoveDuplicates”. (TaskId:12)
15:59:23.573 2>Done building target “_GenerateRestoreProjectPathWalk” in project “Concepts.csproj”.: (TargetId:13)
15:59:23.573 2>Done Building Project “/home/joel/Dolittle/ProsjektLiv/PayEx/PayEx/Concepts/Concepts.csproj” (_GenerateRestoreProjectPathWalk target(s)).

I’ve symlinked my dotnet installation to the place where dolittle expects to find it with the
ln -s /usr/share/dotnet /usr/local/share/dotnet command

1 Like

This also happens on my other dotnet projects (all of them dolittle) so not sure if my systems dotnet is messed up with some updates or it’s something else.

@Woksin, @einari or @Mathieu, is this something you have any experience with?

I had lot of problems with the dotnet core CLI when was running ubuntu 19.4, i don’t remember exactly what kind but maybe that the core sdk 2 has some problems with this version of ubuntu. I haven’t really look for the problem so there is maybe no problem with it but i switched to the 18.4 (long term support) version of ubuntu and now all is working…
I recommend you to keep searching for the cause, but if you don’t find, what i did should work also for you.

1 Like

Weird. Interesting to know if it is only for Dolittle projects or general - like a simple Console app. Dotnet watch has always had an issue. The way it watches is to watch every file that it knows about at start up, that can be a lot of files and it tend to exhaust itself. Instead, IMO, it should have just watched the highest level folder and match files changed with what is being compiled, that way it would discover new files as well. Since dotnet watch relies on operating system features for watching, this could be changed from 18.04 to 19.04.

But that being said, you could try running with NET Core 3. Tooling is fine working with 2.x version. I’ve been running it for a couple of weeks and have migrated our own build pipeline that we use building frameworks. Everything seems fine with it.

1 Like

Just tried this with a simple dotnet new mvc app, restores just fine while doing dolittle create application app and dolittle create boundedcontext bounded and then running dotnet restore hangs.

Last lines of log on the dolittle app with dotnet restore -v d:

Task “RemoveDuplicates”
Done executing task “RemoveDuplicates”.
2>Done building target “_GenerateRestoreProjectPathWalk” in project “Concepts.csproj”.
2>Done Building Project “/home/joel/Dolittle/dolittlecli/bound/Concepts/Concepts.csproj” (_GenerateRestoreProjectPathWalk target(s)).
// hangs here, nothing happens, no noticeable CPU usage

And dotnet mvc:

Task “RemoveDuplicates”
Done executing task “RemoveDuplicates”.
Using “RestoreTask” task from assembly “/usr/share/dotnet/sdk/2.2.402/NuGet.Build.Tasks.dll”.
Task “RestoreTask”
// kinda funny how these lines are invisible on my terminal
(in) RestoreGraphItems Count ‘6’
(in) RestoreDisableParallel ‘False’
(in) RestoreNoCache ‘False’
(in) RestoreIgnoreFailedSources ‘False’
(in) RestoreRecursive ‘True’
(in) RestoreForce ‘False’
(in) HideWarningsAndErrors ‘False’
(in) RestoreForceEvaluate ‘False’
Running restore with 8 concurrent jobs.
Reading project file /home/joel/Dolittle/mvc/mvc.csproj.
The restore inputs for ‘mvc’ have not changed. No further actions are required to complete the restore.
Committing restore…
Assets file has not changed. Skipping assets file writing. Path: /home/joel/Dolittle/mvc/obj/project.assets.json
No-Op restore. The cache will not be updated. Path: /home/joel/Dolittle/mvc/obj/mvc.csproj.nuget.cache
// now back to visible
Restore completed in 38.73 ms for /home/joel/Dolittle/mvc/mvc.csproj.
NuGet Config files used:
Feeds used:
Done executing task “RestoreTask”.
1>Done building target “Restore” in project “mvc.csproj”.
1>Done Building Project “/home/joel/Dolittle/mvc/mvc.csproj” (Restore target(s)).
Build succeeded.
0 Warning(s)
0 Error(s)

So could the project files be messed up on dolittle side?

Edit: reinstalling dotnet doesn’t seem to help.

Found a solution!
Setting the env variable MSBUILDDISABLENODEREUSE=1 as mentioned in here seems to fix it as does passing the -m:1 flag to the build or restore command.
Seems like some sort of thread deadlock is happening that then causes this issue.

1 Like

So glad you found a solution! Nice work.