-
Notifications
You must be signed in to change notification settings - Fork 10.2k
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
Running dotnet watch with a EditForm component with @bind-Value breaks with error "condition `<disabled>' not met" #33152
Comments
@lambdageek do you have a separate issue tracking this already? |
Very strange: the assert is hit when you start the app via |
It does. That sounds like a bug in Blazor's hot reload agent. I'll look at this further. |
Thanks for contacting us. |
I should have a fix out for this soon. The exception is triggered because a "Anonymously Hosted DynamicMethods Assembly" is loaded and accessing it's Module property throws:
We can do a better job handling this case, but I'm curious if you happen to know what could be loading that particular assembly? @lambdageek? |
I have a targeted fix that prevents the exception from AssemblyLoad event. Once that is resolved you run in to dotnet/runtime#51855. |
Accessing Assembly.Modules for arbitrary loaded assemblies may throw which currently results in the hot reload agent to produce an unhandled exception crashing the app. This change attempts to perform a targeted fix for that issue. Fixes #33152
@pranavkm Those modules are created by I just tried this in a console app: using System;
using System.Reflection;
using System.Reflection.Emit;
namespace q
{
class Program
{
static void Main(string[] args)
{
Console.WriteLine("Hello World!");
var d = new DynamicMethod ("ababa", typeof(void), new Type[]{ });
foreach (var a in AppDomain.CurrentDomain.GetAssemblies()) {
foreach (var m in a.Modules) {
Console.WriteLine ($"{a.FullName}: module {m}, {m.ModuleVersionId}");
}
}
}
}
} And on both CoreCLR and Mono it prints out:
So it doesn't seem like there's an obvious bug in Is the IL trimmer running for this project? Maybe it is removing some reflection enumeration code that the hot reload agent depends on? |
No trimmer's running during development. More specifically, nothing in the code explicitly creates and loads a dynamically loaded assembly. Perhaps the presence of the anonymous lambda causes one to load and that has different semantics? |
Running my project I've noticed that the hot reload will exit/crash if it finds a with a @bind-Value inside of it.
Files looks like
Crashes with when navigating to the page
Downgrading the preview packages to Preview 3 (not the SDK) will not crash the application.
I have created a reproduction of the issue here - You will need Preview4 and latest Visual Studio Preview
https://github.com/ShoarW/BlazorHotReloadPreview4
The text was updated successfully, but these errors were encountered: