Closed Federico-Luna closed 1 year ago
Hi, your page "Pedido" has a lot of extra stuff in it. for example @htmllocalizer
Start with something simple. Pass PedidoModel and try render something like <p>@Model.Pedido.Id</p>
then add other things so you will instantly see what caused a problem 👍
@htmlLocalizer is for localization, spain spanish, Peru spanish, USA English, British English, etc. and is mandatory, but I'll try to put literals instead of @htmllocalizer and try step by step.
Thank you again.
The new Pedido. I get same error. NewSimplePedido.zip
Pedido = Order.
Is it possible with RazorEngineCore to run a precompiled page? For example, because my main project has several dependencies with other projects like location services, I want to try to create a new project (PedidosTemplate (OrdersTemplate) for example) with the Pedido page and its dependencies included, then in my main project create a project dependency to PedidosTemplate and run OrderTemplate.dll sending the Id of the order I want to generate.
Thank you again.
There is a very important concept to keep in mind: RazorEngineCore is not part of MVC, you can not take existing views and make RazorEngine make compile it to string. Think of it as a stand alone product.
I think you need to get rid of
@page
@model Tienda.Pages.PedidoModel
@{
Layout = null;
}
Ok. Thank you very much for your help.
Following the basic usage, I'm trying to compile a razor page to generate the html for an order and send it via email, but I get this error when I try to compile it:
Message=Method 'CreateDeterministicKeyBuilder' in type 'Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions' from assembly 'Microsoft.CodeAnalysis.CSharp, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35' does not have an implementation. Source=RazorEngineCore
The api: `
` Thank you very much.
Attached razor page to compile and models. RazorPage&Models.zip