RazorLight requires ASP.NET Core runtime
See original GitHub issueDescribe the bug
Because RazorLight has a FrameworkReference
to Microsoft.AspNetCore.App
, the user is expected to have the corresponding runtime. This is a show stopper for console or WPF apps as users of those will not have it installed (and shouldn’t need to).
To Reproduce
- Create a WPF app
- Add RazorLight
- Publish it
- Try running on a machine where neither ASP.NET Core runtime nor SDK is installed
Expected behavior
It should work with just the base .NET Runtime.
Information (please complete the following information):
- OS: Win10 x64
- Platform .NET Core 3.1
- RazorLight version 2.0-beta9
- Are you using the OFFICIAL RazorLight package? yes
- Rider 2020.1.3
Issue Analytics
- State:
- Created 3 years ago
- Reactions:2
- Comments:30 (1 by maintainers)
Top Results From Across the Web
toddams/RazorLight: Template engine based on ...
Applications must add an explicit reference to the Microsoft.AspNetCore.Mvc.Razor.RuntimeCompilation package if the app relies on runtime compilation to process ...
Read more >RazorLight requires ASP.NET Core runtime
Describe the bug. Because RazorLight has a FrameworkReference to Microsoft.AspNetCore.App , the user is expected to have the corresponding runtime.
Read more >Razor file compilation in ASP.NET Core
Build-time and publish-time compilation of Razor files is enabled by default by the Razor SDK. When enabled, runtime compilation complements ...
Read more >PreserveCompilationContext not configured by default - .NET
Razor.RuntimeCompilation configure this property as required. Version introduced. ASP.NET Core 6.0. Old behavior. The dependency file contains ...
Read more >Publish .cshtml views for RazorLight in .net core 3.0
Yet when I publish, I see no EmailTemplates folder and no ForgotPassword.cshtml and Registration.cshtml . What am I doing wrong? asp.net-core ...
Read more >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
OK, please add it 😃
I tried removing this from RazorLight for core 3.0 and 3.1
<FrameworkReference Include="Microsoft.AspNetCore.App" />
and added this<PackageReference Include="Microsoft.AspNetCore.Razor.Runtime" Version="2.2.0" />
and then put this into RazorLight.Tests for core 3.0 and 3.1
<FrameworkReference Include="Microsoft.AspNetCore.App" />
After that, everything compiled and all unit tests pass. I did not see the errors shown above.
I think the only reason that the framework reference is necessary is because the tests project uses some aspnetcore types like Microsoft.AspNetCore.Hosting.IHostingEnvironment