I am trying to follow the Blazor tutorial found here. I did dotnet restore on the whole solution and was able to successfully run the BlazingPizza.Server project, but when I try to run BlazingPizza.Client using dotnet watch run, I get the following error:
watch : Started
Cannot use file stream for [/Users/user/projects/blazor/blazor-workshop/save-points/00-get-started/BlazingPizza.Client/bin/Debug/net5.0/BlazingPizza.Client.deps.json]: No such file or directory
A fatal error was encountered. The library 'libhostpolicy.dylib' required to execute the application was not found in '/Users/user/projects/blazor/blazor-workshop/save-points/00-get-started/BlazingPizza.Client/bin/Debug/net5.0/'.
Failed to run as a self-contained app.
- The application was run as a self-contained app because '/Users/user/projects/blazor/blazor-workshop/save-points/00-get-started/BlazingPizza.Client/bin/Debug/net5.0/BlazingPizza.Client.runtimeconfig.json' was not found.
- If this should be a framework-dependent app, add the '/Users/user/projects/blazor/blazor-workshop/save-points/00-get-started/BlazingPizza.Client/bin/Debug/net5.0/BlazingPizza.Client.runtimeconfig.json' file and specify the appropriate framework.
watch : Exited with error code 131
watch : Waiting for a file to change before restarting dotnet...
I have the most recent version of the .NET SDK downloaded (5.0.302), and based on the error messages, it just seems like I'm missing some .NET specific files, but I'm not sure how to add them. Are these library specific files that I should use dotnet add to include? Just confused because the tutorial didn't mention needing to do anything outside of dotnet restore
I was fundamentally misunderstanding how Blazor apps run. You don't need to run each individual portion (.server, .client), by just running the server it will serve the client.