Closed 929496959 closed 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 等包 依旧报错
尝试 Install-Package RazorEngineCore -Version 2020.9.1 支持4.7.2
切换之后正常输出 @adoconnection
👍👍
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 等包 依旧报错