-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
Updating Param metadata table via edit and continue not having any effect #55058
Comments
I couldn't figure out the best area label to add to this issue. If you have write-permissions please help me learn by adding exactly one area label. |
What is the exact code that you are running to verify whether the changes have effect? The reflection object model (MethodInfo, FieldInfo, ParameterInfo, ...) are not updated for metadata edits in-place. You have to re-fetch the |
I'm using a web project and using Hot Reload from an experimental instance of VS, with my build of Roslyn, and on page load I have this code, so it should be a valid test: foreach (var param in this.GetType().GetMethod("Goo", System.Reflection.BindingFlags.Instance | System.Reflection.BindingFlags.Public).GetParameters())
{
result += param.Name + ", ";
} |
Tagging subscribers to this area: @tommcdon Issue DetailsI'm trying to add support in Roslyn to rename method parameters in EnC/Hot Reload but I'm not seeing any changes having any effect in the runtime, when checking via reflection. If it helped I have confirmed metadata update attributes are being processed. Here is the important bits of metadata. Full output from mdv at the bottom. The initial baseline has the methoddef a row 2, and one param at row 1:
In the delta we emit an update to the method with a
The EncLog and EncMap are below, but you can see they indicate that the Param row is an update for row 1:
After applying this change reflection still returns the old name for the parameter, as does the debugger in an F5 scenario. I also tried issuing new attributes and updating the FYI @tmat @tommcdon @mikem8361 @lambdageek Full metadata from a parameter rename of a method F in class C
|
This is currently blocking dotnet/roslyn#52563 |
Both David and I have confirmed that parameter renaming does work with the latest sdk's dotnet-watch. I'm closing this issue. |
I'm trying to add support in Roslyn to rename method parameters in EnC/Hot Reload but I'm not seeing any changes having any effect in the runtime, when checking via reflection. If it helped I have confirmed metadata update attributes are being processed.
Here is the important bits of metadata. Full output from mdv at the bottom.
The initial baseline has the methoddef a row 2, and one param at row 1:
In the delta we emit an update to the method with a
nil
value forParam
because it hasn't changed (we don't allow adding or removing parameters), and an emit of the new param row:The EncLog and EncMap are below, but you can see they indicate that the Param row is an update for row 1:
After applying this change reflection still returns the old name for the parameter, as does the debugger in an F5 scenario.
I also tried issuing new attributes and updating the
Param
column but that didn't work either. If there is any approach that would work here, please let me know.FYI @tmat @tommcdon @mikem8361 @lambdageek
Full metadata from a parameter rename of a method F in class C
The text was updated successfully, but these errors were encountered: