The Wayback Machine - https://web.archive.org/web/20211117060912/https://github.com/dotnet/aspnetcore/issues/38465
Skip to content
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

Razor runtime view compilation via environment variable not working in .NET 6 #38465

Open
AndrewTriesToCode opened this issue Nov 17, 2021 · 1 comment

Comments

Labels
None yet
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
2 participants
@AndrewTriesToCode
Copy link

@AndrewTriesToCode AndrewTriesToCode commented Nov 17, 2021

Runtime view compilation appears to not be working in .NET 6 Razor Pages projects when using the environment variable to specify this behavior as described here:

https://docs.microsoft.com/en-us/aspnet/core/mvc/views/view-compilation?view=aspnetcore-6.0&tabs=visual-studio#conditionally-enable-runtime-compilation-in-an-existing-project

If I manually add AddRazorRuntimeCompilation() in ConfigureServices it does work though.

I'm including v6.0.0 of the assembly package:
<PackageReference Include="Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation" Version="6.0.0" />

And my launch profile has the following section:

"environmentVariables": {
        "ASPNETCORE_ENVIRONMENT": "Development",
        "ASPNETCORE_HOSTINGSTARTUPASSEMBLIES": "Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation"
      }

Worked as expected in .NET 5 on the same project.

@davidfowl
Copy link
Member

@davidfowl davidfowl commented Nov 17, 2021

cc @halter73 (might be a hosting problem)

Loading

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment