Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings
Discussion options

Our team is looking for a solution to render the cshtml files in the background when the web sites starts. So that the cshtml files are cached and skip the compiling at next access.
We notice this project. But we have some questions.

  1. As the title, what is the scenario to use this project besides a .net core console application?
  2. Any difference between the outputs of RazorEngineCore and RazorEngine?
  3. Is there a way to communicate between these two engines? I want to cache the output from RazorEngineCore to RazorEngine.
  4. Does the core engine have better performance?

Regards,
Yanlin

You must be logged in to vote

Replies: 2 comments · 2 replies

Comment options

Our team is looking for a solution to render the cshtml files in the background when the web sites starts. So that the cshtml files are cached and skip the compiling at next access.

Hi! I need to clarify one thing first: if you are using ASP.NET Core it is done by default – all views turned into assembly during build and they never compiled again. Are you sure you are solving right problem?

You must be logged in to vote
2 replies
@yanlinsun
Comment options

The cshtml files are loaded at runtime. We design our application to allow third party providers to extend our web with their own cshtml files. So we turn on the 'Runtime compilation' feature.

@adoconnection
Comment options

I have not tested this yet, but dont they compile only once after you modify cshtml file content?

Comment options

As the title, what is the scenario to use this project besides a .net core console application?

Every project that requires templating with Razor syntax no matter its a console app, asp.net core site or windows app

Any difference between the outputs of RazorEngineCore and RazorEngine?

Microsoft RazorEngine is a tool to produce binaries out of text templates. ASP.NET Core and RazorEngineCore use the same RazorEngine in a different way, so the output is not compatible to each other.
Have a look at my article: https://www.codeproject.com/Articles/5260233/Building-String-Razor-Template-Engine-with-Bare-Ha

Is there a way to communicate between these two engines? I want to cache the output from RazorEngineCore to RazorEngine.

No

Does the core engine have better performance?

Performance is exactly the same

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
🙏
Q&A
Labels
None yet
2 participants
Morty Proxy This is a proxified and sanitized view of the page, visit original site.