我创建了一个这样的项目:
dotnet new blazorwasm -f net6.0
我是以下列方式执行这个项目的:
dotnet watch run
每当我保存一些应该触发重建的东西时,改变就会被认可,但什么也不会发生。我只得到以下信息,仅此而已:
watch : File changed: /Path/to/File.example.
它工作了一段时间后突然停了下来。
全部产出:
watch : Project supports hot reload and was configured to run with the default run-command. Watching with hot-reload
watch : Hot reload enabled. For a list of supported edits, see https://aka.ms/dotnet/hot-reload. Press "Ctrl + R" to restart.
watch : Building...
watch : Started '/usr/local/share/dotnet/dotnet' '' with process id 3155
Determining projects to restore...
All projects are up-to-date for restore.
waveshape -> /Users/example/Projects/waveshape/bin/Debug/net6.0/waveshape.dll
waveshape (Blazor output) -> /Users/example/Projects/waveshape/bin/Debug/net6.0/wwwroot
watch : Process id 3155 ran for 3605ms
watch : Running MSBuild target 'GenerateWatchList' on '/Users/example/Projects/waveshape/waveshape.csproj'
watch : Started '/usr/local/share/dotnet/dotnet' '' with process id 3164
watch : Process id 3164 ran for 557ms
watch : Watching 28 file(s) for changes
watch : dotnet-watch is configured to launch a browser on ASP.NET Core application startup.
watch : Configuring the app to use browser-refresh middleware.
watch : Refresh server running at wss://localhost:61209,ws://localhost:61210.
watch : HotReloadProfile: BlazorWebAssembly.
watch : Started 'dotnet' '"/Users/example/.nuget/packages/microsoft.aspnetcore.components.webassembly.devserver/6.0.1/build/../tools/blazor-devserver.dll" --applicationpath "/Users/example/Projects/waveshape/bin/Debug/net6.0/waveshape.dll"' with process id 3173
watch : Running dotnet with the following arguments: run
watch : Started
watch : Waiting for a browser to connect
info: Microsoft.Hosting.Lifetime[14]
Now listening on: https://localhost:7081
watch : Launching browser.
info: Microsoft.Hosting.Lifetime[14]
Now listening on: http://localhost:5236
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: /Users/example/Projects/waveshape
watch : File changed: /Users/example/Projects/waveshape/Pages/Index.razor.发布于 2022-08-04 19:51:48
我有这个问题,当http端口“错误”时可以复制。我不知道为什么这是“错误”,但端口5220我有完全相同的问题,但当我改变到5180,它的工作。
端口更改必须在launchSettings.json文件中完成。
有人创造和问题,但还没有得到回应。
发布于 2022-01-10 12:01:50
试着
dotnet watch --project .\ProjectName.csproj -vdotnet watch --project . -v如果你看到
watch : Hot reload capabilities: Baseline.它应该能正常工作。
这是一个解决办法,因为热重装有问题。其他人也有问题-- https://github.com/dotnet/aspnetcore/issues/38036。
https://stackoverflow.com/questions/70549245
复制相似问题