OYIon / LiveSharp

Public repository for the LiveSharp project
96 stars 4 forks source link

Live update when adding a dependency #112

Open wocar opened 3 years ago

wocar commented 3 years ago

Let's say I add

@inject IJSRuntime JsRuntime

void Delete(){
+++
var confirmed = await JsRuntime.InvokeAsync<bool>("confirm", "Are you sure?"); //Only added this line

}

I hit save. Then I call the delete method. I get the following exception:

System.InvalidProgramException: Common Language Runtime detected an invalid program.

So, is it possible to have liveupdate when adding a dependency using @inject thank you

ionoy commented 3 years ago

Yeah, inject attributes don't work correctly yet since LiveSharp doesn't modify the assembly metadata. I do have a full assembly update functionality but it needs proper support from the Blazor update handler which is not there yet.

For now, you'll have to just restart the app for such changes.