Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cortex.net prevents hot reloading using "dotnet watch" (vs2022, .net 6.0.100-rc.2.21505.57) #62

Open
johnhamm opened this issue Oct 18, 2021 · 0 comments

Comments

@johnhamm
Copy link

johnhamm commented Oct 18, 2021

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:

  1. Create a new BlazorWasm application:
    dotnet new blazorwasm
  2. Start dotnet watch in the same folder:
    dotnet watch
  3. Open the project in Visual Studio 2022
  4. Open Pages\Index.razor and edit text of the H1 element.
  5. Command window will say
    watch : File changed: ...\blazrwasm\Pages\Index.razor.
    watch : Hot reload of changes succeeded.
  6. Install the Cortext.Net and Cortex.Net.Blazor nuget packages, then try to edit the text of the H1 element again - it still works!
  7. Add a class AppStore to your project:
using Cortex.Net.Api;

namespace blazrwasm
{
    [Observable]
    public class AppStore
    {
        public string? Name { get; set; }
    }
}
  1. Inject it in program.cs on line 10:
    builder.Services.AddSingleton<AppStore>();
  2. Restart dotnet watch
  3. 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.
@johnhamm johnhamm changed the title Cortex.net prevents hot reloading using "dotnet watch" (vs2022, .net 6 Cortex.net prevents hot reloading using "dotnet watch" (vs2022, .net 6.0.100-rc.2.21505.57) Oct 18, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant