C# 动态编译
2021-06-08 23:07
标签:erro 集合 pat filename ESS errors compiler tps www. 原文:https://www.cnblogs.com/rookey/p/5230945.html 备注:在看项目的时候看到的,顺便备注一下。 Student.code 文件: C# 动态编译 标签:erro 集合 pat filename ESS errors compiler tps www. 原文地址:https://www.cnblogs.com/guxingy/p/10669638.html public ActionResult Test2()
{
string filePath = "E:\\2\\Student.code";
string[] referenceAssemblyNames = new string[]
{
"System.dll"
};
//输出dll
string outputDll = "E:\\2\\Student.dll";
string errMsg = CompileFromFile(new string[] { filePath }, referenceAssemblyNames, outputDll);
return Content(errMsg);
}
///
using System;
namespace WebApplication1.Controllers
{
public class Student
{
public string Name { get; set; }
}
}