I'm so bummed out because there currently isn't an alternative to this library for Blazor but not being able to hot reload is a deal breaker. Installing the Cortex.Net and Cortex.Net.Blazor nuget packages stops hot reloading from working once you inject a store with [Observable] on it.
Steps to reproduce:
Create a new BlazorWasm application:
dotnet new blazorwasm
Start dotnet watch in the same folder:
dotnet watch
Open the project in Visual Studio 2022
Open Pages\Index.razor and edit text of the H1 element.
Command window will say
watch : File changed: ...\blazrwasm\Pages\Index.razor.
watch : Hot reload of changes succeeded.
Install the Cortext.Net and Cortex.Net.Blazor nuget packages, then try to edit the text of the H1 element again - it still works!
Add a class AppStore to your project:
using Cortex.Net.Api;
namespace blazrwasm
{
[Observable]
public class AppStore
{
public string? Name { get; set; }
}
}
Inject it in program.cs on line 10:
builder.Services.AddSingleton<AppStore>();
Restart dotnet watch
Try to edit the H1 element. Hot reloading now fails. Command window will say
watch : File changed: D:\Temp\blazrwasm\Pages\Index.razor.
watch : No hot reload changes to apply.
I'm so bummed out because there currently isn't an alternative to this library for Blazor but not being able to hot reload is a deal breaker. Installing the Cortex.Net and Cortex.Net.Blazor nuget packages stops hot reloading from working once you inject a store with [Observable] on it.
Steps to reproduce:
namespace blazrwasm { [Observable] public class AppStore { public string? Name { get; set; } } }
builder.Services.AddSingleton<AppStore>();