toddams / RazorLight

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

Could not load file or assembly 'System.Diagnostics.EventLog #487

Closed gumbarros closed 2 years ago

gumbarros commented 2 years ago

Describe the bug Could not load file or assembly 'System.Diagnostics.EventLog, Version=6.0.0.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51' or one of its dependencies. The system cannot find the file specified.

To Reproduce

  1. Run LightRazor on .NET Framework 4.8

Expected behavior Compiled HTML from Engine.CompileRenderAsync(template, model).Result;

Information (please complete the following information):

gumbarros commented 2 years ago

Already added .AddMetadataReferences(MetadataReference.CreateFromFile(Assembly.GetExecutingAssembly().Location)) and no success

gumbarros commented 2 years ago

Solved installing System.Diagnostics.EventLog at the parent project