adoconnection / RazorEngineCore

.NET6 Razor Template Engine
MIT License
585 stars 88 forks source link

在 .net Framework 4.7 的winfrom程序下运行报错 #32

Closed 929496959 closed 4 years ago

929496959 commented 4 years ago

public class RazorEngineCompilationOptions { public HashSet<Assembly> ReferencedAssemblies { get; set; } = new HashSet<Assembly>() { typeof(object).Assembly, Assembly.Load(new AssemblyName("Microsoft.CSharp")), typeof(RazorEngineTemplateBase).Assembly, Assembly.Load(new AssemblyName("System.Runtime")), Assembly.Load(new AssemblyName("System.Linq")), Assembly.Load(new AssemblyName("System.Linq.Expressions")) }; ....... }

err info :System.IO.FileNotFoundException:“未能加载文件或程序集“Microsoft.CSharp”或它的某一个依赖项。系统找不到指定的文件。”

已经在引用中添加了 Microsoft.CSharp,System.Runtime,System.Linq,System.Linq.Expressions 等包 依旧报错

adoconnection commented 4 years ago

尝试 Install-Package RazorEngineCore -Version 2020.9.1 支持4.7.2

929496959 commented 4 years ago

切换之后正常输出 @adoconnection

adoconnection commented 4 years ago

👍👍