You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Call compilation.EmitDifference, passing a single SemanticEdit that corresponds to a C# line that is preceded by #line hidden
Observe that the updatedMethods collection is not populated with anything, whereas it would be if #line hidden was not present
Expected Behavior:
I definitely did not expect #line hidden to influence this. It took a long time to track down that this was causing the failure to produce deltas :)
Scenario:
I'm prototyping .NET 6 hot reload for Blazor. The Razor compiler prefixes pretty much all generated user code with #line hidden, so this behavior prevents changes in .razor files from being applied to the running app.
To show this is definitely what's interfering, I tried amending my hot reload prototype to contain newSourceText = newSourceText.Replace("#line hidden", "//#line hidden"); when reading the generated Razor source code, and it does make the problem go away, so user changes in .razor files do flow into the running app.
Related issue:
I expect this is related to #40655 and probably ties in with some historical quirks.
Request:
Is there some option to disable this special-casing of #line hidden? It's not something we'd want when it comes to processing the Razor compiler's generated code. If there's no option for that yet, would you consider adding one?
The text was updated successfully, but these errors were encountered:
Version Used: 3.8.0-5.final
Steps to Reproduce:
compilation.EmitDifference
, passing a singleSemanticEdit
that corresponds to a C# line that is preceded by#line hidden
updatedMethods
collection is not populated with anything, whereas it would be if#line hidden
was not presentExpected Behavior:
I definitely did not expect
#line hidden
to influence this. It took a long time to track down that this was causing the failure to produce deltas :)Scenario:
I'm prototyping .NET 6 hot reload for Blazor. The Razor compiler prefixes pretty much all generated user code with
#line hidden
, so this behavior prevents changes in.razor
files from being applied to the running app.To show this is definitely what's interfering, I tried amending my hot reload prototype to contain
newSourceText = newSourceText.Replace("#line hidden", "//#line hidden");
when reading the generated Razor source code, and it does make the problem go away, so user changes in.razor
files do flow into the running app.Related issue:
I expect this is related to #40655 and probably ties in with some historical quirks.
Request:
Is there some option to disable this special-casing of
#line hidden
? It's not something we'd want when it comes to processing the Razor compiler's generated code. If there's no option for that yet, would you consider adding one?The text was updated successfully, but these errors were encountered: