toddams / RazorLight

Template engine based on Microsoft's Razor parsing engine for .NET Core
Apache License 2.0
1.51k stars 261 forks source link

In my cake script, I can't use CompileRenderAsync. #402

Closed tugcearar closed 3 years ago

tugcearar commented 3 years ago

Describe the bug One or more errors occurred. (Can't load metadata reference from the entry assembly. Make sure PreserveCompilationContext is set to true in *.csproj file

To Reproduce Use CompileRenderAsync in cake script file.

Expected behavior Works and create expected result.

Information (please complete the following information):

Where should I add the PreserveCompilationContext file in cake script? By the way I used it for create a csproj file from cshtml template.

jzabroski commented 3 years ago

Use Cake Frosting. Don't use Cake Script.

Please confirm this works for you.

jzabroski commented 3 years ago

@stugcearar Happy end of year - any chance you can let me know if using Cake Frosting works?

tugcearar commented 3 years ago

Hello @jzabroski, I am working on it. I will post the result later today. Thanks!

jzabroski commented 3 years ago

Please use RazorLight 2.0.0-rc.3 as well. Thank you and I will try to see what you have to say.

tugcearar commented 3 years ago

Hello, it is working. Thanks 👍🏻

jzabroski commented 3 years ago

@stugcearar Thank you! Feel free to publish a gist or pull request to demo it for others. Thanks.