Skip to content

Allow runtime compilation to be configured via the hosting startup. #39381

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

Merged
merged 1 commit into from
Jan 19, 2022

Conversation

pranavkm
Copy link
Contributor

@pranavkm pranavkm commented Jan 8, 2022

As part of refactoring how Razor Pages are loaded, the ability to use runtime compilation via the hosting startup / env variable was broken.
The refactoring assumed AddRuntimeCompilation was always invoked after a call to AddRazorPages / AddControllersWithViews etc which is not the case
for registration via the HostingStartup. This PR address this defect.

Fixes #38465

As part of refactoring how Razor Pages are loaded, the ability to use runtime compilation via the hosting startup / env variable was broken.
The refactoring assumed AddRuntimeCompilation was always invoked after a call to AddRazorPages / AddControllersWithViews etc which is not the case
for registration via the HostingStartup. This PR address this defect.

Fixes dotnet#38465
@ghost ghost added the area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates label Jan 8, 2022
@pranavkm pranavkm marked this pull request as ready for review January 9, 2022 15:22
@pranavkm pranavkm requested a review from javiercn as a code owner January 9, 2022 15:22
@pranavkm
Copy link
Contributor Author

pranavkm commented Jan 9, 2022

/azp run

@pranavkm pranavkm requested a review from a team January 9, 2022 15:22
@azure-pipelines
Copy link

Azure Pipelines successfully started running 3 pipeline(s).

@isaacdontjelindellblp
Copy link

Hi @pranavkm - as someone who is unfamiliar with the .NET dev process, but is affected by this issue - how will this fix be released? Is it going to be included in a patch to .NET 6, or will we have to wait until .NET 7 to see this fix? I've read through the linked issue, but the outcome isn't clear to me. Thanks!

@pranavkm
Copy link
Contributor Author

@isaacdontjelindellblp my hope is to backport this to a 6.0 release once it's accepted in to main.

@isaacdontjelindellblp
Copy link

@isaacdontjelindellblp my hope is to backport this to a 6.0 release once it's accepted in to main.

@pranavkm Fantastic - thanks much!

@pranavkm
Copy link
Contributor Author

@dotnet/aspnet-blazor-eng could I get a quick review on this? I'd like to consider this for a 6.0 patch.

Copy link
Member

@javiercn javiercn left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@pranavkm pranavkm merged commit 207f2c3 into dotnet:main Jan 19, 2022
@pranavkm pranavkm deleted the prkrishn/runtime-compilation-fix branch January 19, 2022 18:57
@ghost ghost added this to the 7.0-preview1 milestone Jan 19, 2022
@AndrewTriesToCode
Copy link
Contributor

Thanks for pushing this through @pranavkm

@ghost
Copy link

ghost commented Jan 19, 2022

Hi @AndrewTriesToCode. It looks like you just commented on a closed PR. The team will most probably miss it. If you'd like to bring something important up to their attention, consider filing a new issue and add enough details to build context.

pranavkm added a commit to pranavkm/aspnetcore that referenced this pull request Jan 19, 2022
…otnet#39381)

As part of refactoring how Razor Pages are loaded, the ability to use runtime compilation via the hosting startup / env variable was broken.
The refactoring assumed AddRuntimeCompilation was always invoked after a call to AddRazorPages / AddControllersWithViews etc which is not the case
for registration via the HostingStartup. This PR address this defect.

Fixes dotnet#38465
ShreyasJejurkar pushed a commit to ShreyasJejurkar/aspnetcore that referenced this pull request Jan 22, 2022
…otnet#39381)

As part of refactoring how Razor Pages are loaded, the ability to use runtime compilation via the hosting startup / env variable was broken.
The refactoring assumed AddRuntimeCompilation was always invoked after a call to AddRazorPages / AddControllersWithViews etc which is not the case
for registration via the HostingStartup. This PR address this defect.

Fixes dotnet#38465
wtgodbe pushed a commit that referenced this pull request Feb 2, 2022
…39381) (#39639)

As part of refactoring how Razor Pages are loaded, the ability to use runtime compilation via the hosting startup / env variable was broken.
The refactoring assumed AddRuntimeCompilation was always invoked after a call to AddRazorPages / AddControllersWithViews etc which is not the case
for registration via the HostingStartup. This PR address this defect.

Fixes #38465
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-mvc Includes: MVC, Actions and Controllers, Localization, CORS, most templates
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Razor runtime view compilation via environment variable not working in .NET 6
4 participants