-
Notifications
You must be signed in to change notification settings - Fork 4.7k
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
MissingMethodException after changing method signature on hot reload #87032
Comments
Similar to #65442 (on Roslyn) |
I then tried reproducing this with .NET 7 in Visual Studio and checked the box next to "Do not use top-level statements" and the issue reproduced. |
Tagging subscribers to this area: @tommcdon Issue DetailsDescriptionWhen trying to rename methods with hot reload on .NET 7, I consistently get a Reproduction Steps
static void Main(string[] args)
{
Debugger.Break();
Foo(23);
}
static int Foo(int something)
{
Console.WriteLine(something);
return 0;
}
static int Foo(int something, bool aValue = false)
{
Console.WriteLine(something);
return 0;
}
Expected behaviorSuccessfully execute the modified Actual behaviorMissingMethodException gets thrown: Regression?No response Known WorkaroundsNo response ConfigurationNo response Other informationNo response
|
@isadorasophia I've not debugged this, but this might be an issue with the default value in the signature. What if you update both the callsite and the method? @tmat Are default values supported in EnC in general? |
/cc @davidwengier The reason for MethodMissingException is that Main is not recompiled because it does not have any changes, so it calls the old version of Foo, which now throws because it has been "deleted". This behavior is currently expected. Issue dotnet/roslyn#59264 tracks improving this by emitting a call to the newer version of Foo into the body of its old version instead of MethodMissingException throw. |
Closing this issue as dup of dotnet/roslyn#65442. |
Description
When trying to rename methods with hot reload on .NET 7, I consistently get a
MissingMethodException
when changing the methods signatures.Reproduction Steps
Expected behavior
Successfully execute the modified
Foo
method.Actual behavior
MissingMethodException gets thrown:
Regression?
No response
Known Workarounds
No response
Configuration
No response
Other information
No response
The text was updated successfully, but these errors were encountered: