• Uncategorized

About c# : dotnet-watch-run-doesnt-seem-to-work-on-linux

Question Detail

I am running Arch Linux and want to do some .NET 6 development.

I do have the .NET SDK and runtimes installed.

~/code/bejebeje feat/login-button ❯ dotnet --list-sdks                                         
6.0.101 [/home/j/.dotnet/sdk]
~/code/bejebeje feat/login-button ❯ dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.1 [/home/j/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.1 [/home/j/.dotnet/shared/Microsoft.NETCore.App]

The project I’m in was recently updated to .NET 6 from .NET Core 5.

The project builds fine, and I can run it with:

~/code/bejebeje feat/login-button ❯ dotnet run --project Bejebeje.Mvc/Bejebeje.Mvc.csproj
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /home/j/code/bejebeje/Bejebeje.Mvc/

However, if I wish to watch and use hot reload, I get the following:

~/code/bejebeje feat/login-button ❯ dotnet watch run --project Bejebeje.Mvc/Bejebeje.Mvc.csproj
watch : Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload. Press "Ctrl + R" to restart.
watch : Building...
  Determining projects to restore...
  All projects are up-to-date for restore.
  Bejebeje.Common -> /home/j/code/bejebeje/Bejebeje.Common/bin/Debug/net6.0/Bejebeje.Common.dll
  Bejebeje.Models -> /home/j/code/bejebeje/Bejebeje.Models/bin/Debug/net6.0/Bejebeje.Models.dll
  Bejebeje.Domain -> /home/j/code/bejebeje/Bejebeje.Domain/bin/Debug/net6.0/Bejebeje.Domain.dll
  Bejebeje.DataAccess -> /home/j/code/bejebeje/Bejebeje.DataAccess/bin/Debug/net6.0/Bejebeje.DataAccess.dll
  Bejebeje.Services -> /home/j/code/bejebeje/Bejebeje.Services/bin/Debug/net6.0/Bejebeje.Services.dll
  Bejebeje.Mvc -> /home/j/code/bejebeje/Bejebeje.Mvc/bin/Debug/net6.0/Bejebeje.Mvc.dll
watch : Started
A fatal error occurred. The required library libhostfxr.so could not be found.
If this is a self-contained application, that library should exist in [/home/j/code/bejebeje/Bejebeje.Mvc/bin/Debug/net6.0/].
If this is a framework-dependent application, install the runtime in the global location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet].

The .NET runtime can be found at:
  - https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=arch-x64&apphost_version=6.0.1
watch : Exited with error code 131
watch : Waiting for a file to change before restarting dotnet...
watch : Building...
  Bejebeje.Common -> /home/j/code/bejebeje/Bejebeje.Common/bin/Debug/net6.0/Bejebeje.Common.dll
  Bejebeje.Domain -> /home/j/code/bejebeje/Bejebeje.Domain/bin/Debug/net6.0/Bejebeje.Domain.dll
  Bejebeje.Models -> /home/j/code/bejebeje/Bejebeje.Models/bin/Debug/net6.0/Bejebeje.Models.dll
  Bejebeje.DataAccess -> /home/j/code/bejebeje/Bejebeje.DataAccess/bin/Debug/net6.0/Bejebeje.DataAccess.dll
  Bejebeje.Services -> /home/j/code/bejebeje/Bejebeje.Services/bin/Debug/net6.0/Bejebeje.Services.dll
  Bejebeje.Mvc -> /home/j/code/bejebeje/Bejebeje.Mvc/bin/Debug/net6.0/Bejebeje.Mvc.dll
watch : Started
A fatal error occurred. The required library libhostfxr.so could not be found.
If this is a self-contained application, that library should exist in [/home/j/code/bejebeje/Bejebeje.Mvc/bin/Debug/net6.0/].
If this is a framework-dependent application, install the runtime in the global location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet].

The .NET runtime can be found at:
  - https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=arch-x64&apphost_version=6.0.1
watch : Exited with error code 131
watch : Waiting for a file to change before restarting dotnet...
watch : Building...
  Bejebeje.Common -> /home/j/code/bejebeje/Bejebeje.Common/bin/Debug/net6.0/Bejebeje.Common.dll
  Bejebeje.Domain -> /home/j/code/bejebeje/Bejebeje.Domain/bin/Debug/net6.0/Bejebeje.Domain.dll
watch : Shutdown requested. Press Ctrl+C again to force exit.
Attempting to cancel the build...
  Bejebeje.Models -> /home/j/code/bejebeje/Bejebeje.Models/bin/Debug/net6.0/Bejebeje.Models.dll

That keeps on repeating until I hit Ctrl + C

Here’s a screenshot too (for colour).

Am I doing something wrong? I thought dotnet watch was supposed to work on all platforms.

Question Answer

No answer for now.

About c# : dotnet-watch-run-doesnt-seem-to-work-on-linux

Question Detail

I am running Arch Linux and want to do some .NET 6 development.

I do have the .NET SDK and runtimes installed.

~/code/bejebeje feat/login-button ❯ dotnet --list-sdks                                         
6.0.101 [/home/j/.dotnet/sdk]
~/code/bejebeje feat/login-button ❯ dotnet --list-runtimes
Microsoft.AspNetCore.App 6.0.1 [/home/j/.dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 6.0.1 [/home/j/.dotnet/shared/Microsoft.NETCore.App]

The project I’m in was recently updated to .NET 6 from .NET Core 5.

The project builds fine, and I can run it with:

~/code/bejebeje feat/login-button ❯ dotnet run --project Bejebeje.Mvc/Bejebeje.Mvc.csproj
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: http://localhost:5000
info: Microsoft.Hosting.Lifetime[14]
      Now listening on: https://localhost:5001
info: Microsoft.Hosting.Lifetime[0]
      Application started. Press Ctrl+C to shut down.
info: Microsoft.Hosting.Lifetime[0]
      Hosting environment: Development
info: Microsoft.Hosting.Lifetime[0]
      Content root path: /home/j/code/bejebeje/Bejebeje.Mvc/

However, if I wish to watch and use hot reload, I get the following:

~/code/bejebeje feat/login-button ❯ dotnet watch run --project Bejebeje.Mvc/Bejebeje.Mvc.csproj
watch : Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload. Press "Ctrl + R" to restart.
watch : Building...
  Determining projects to restore...
  All projects are up-to-date for restore.
  Bejebeje.Common -> /home/j/code/bejebeje/Bejebeje.Common/bin/Debug/net6.0/Bejebeje.Common.dll
  Bejebeje.Models -> /home/j/code/bejebeje/Bejebeje.Models/bin/Debug/net6.0/Bejebeje.Models.dll
  Bejebeje.Domain -> /home/j/code/bejebeje/Bejebeje.Domain/bin/Debug/net6.0/Bejebeje.Domain.dll
  Bejebeje.DataAccess -> /home/j/code/bejebeje/Bejebeje.DataAccess/bin/Debug/net6.0/Bejebeje.DataAccess.dll
  Bejebeje.Services -> /home/j/code/bejebeje/Bejebeje.Services/bin/Debug/net6.0/Bejebeje.Services.dll
  Bejebeje.Mvc -> /home/j/code/bejebeje/Bejebeje.Mvc/bin/Debug/net6.0/Bejebeje.Mvc.dll
watch : Started
A fatal error occurred. The required library libhostfxr.so could not be found.
If this is a self-contained application, that library should exist in [/home/j/code/bejebeje/Bejebeje.Mvc/bin/Debug/net6.0/].
If this is a framework-dependent application, install the runtime in the global location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet].

The .NET runtime can be found at:
  - https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=arch-x64&apphost_version=6.0.1
watch : Exited with error code 131
watch : Waiting for a file to change before restarting dotnet...
watch : Building...
  Bejebeje.Common -> /home/j/code/bejebeje/Bejebeje.Common/bin/Debug/net6.0/Bejebeje.Common.dll
  Bejebeje.Domain -> /home/j/code/bejebeje/Bejebeje.Domain/bin/Debug/net6.0/Bejebeje.Domain.dll
  Bejebeje.Models -> /home/j/code/bejebeje/Bejebeje.Models/bin/Debug/net6.0/Bejebeje.Models.dll
  Bejebeje.DataAccess -> /home/j/code/bejebeje/Bejebeje.DataAccess/bin/Debug/net6.0/Bejebeje.DataAccess.dll
  Bejebeje.Services -> /home/j/code/bejebeje/Bejebeje.Services/bin/Debug/net6.0/Bejebeje.Services.dll
  Bejebeje.Mvc -> /home/j/code/bejebeje/Bejebeje.Mvc/bin/Debug/net6.0/Bejebeje.Mvc.dll
watch : Started
A fatal error occurred. The required library libhostfxr.so could not be found.
If this is a self-contained application, that library should exist in [/home/j/code/bejebeje/Bejebeje.Mvc/bin/Debug/net6.0/].
If this is a framework-dependent application, install the runtime in the global location [/usr/share/dotnet] or use the DOTNET_ROOT environment variable to specify the runtime location or register the runtime location in [/etc/dotnet].

The .NET runtime can be found at:
  - https://aka.ms/dotnet-core-applaunch?missing_runtime=true&arch=x64&rid=arch-x64&apphost_version=6.0.1
watch : Exited with error code 131
watch : Waiting for a file to change before restarting dotnet...
watch : Building...
  Bejebeje.Common -> /home/j/code/bejebeje/Bejebeje.Common/bin/Debug/net6.0/Bejebeje.Common.dll
  Bejebeje.Domain -> /home/j/code/bejebeje/Bejebeje.Domain/bin/Debug/net6.0/Bejebeje.Domain.dll
watch : Shutdown requested. Press Ctrl+C again to force exit.
Attempting to cancel the build...
  Bejebeje.Models -> /home/j/code/bejebeje/Bejebeje.Models/bin/Debug/net6.0/Bejebeje.Models.dll

That keeps on repeating until I hit Ctrl + C

Here’s a screenshot too (for colour).

Am I doing something wrong? I thought dotnet watch was supposed to work on all platforms.

Question Answer

No answer for now.

You may also like...

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.