开发者

How to Compile the .cs file into .dll in C#.Net programatically?

开发者 https://www.devze.com 2023-01-10 17:55 出处:网络
Can any one help me in converting the .cs file into .dll programmatica开发者_运维百科lly?You\'re looking for the CSharpCodeProvider class.

Can any one help me in converting the .cs file into .dll programmatica开发者_运维百科lly?


You're looking for the CSharpCodeProvider class.

For example:

var compiler = new CSharpCodeProvider(new Dictionary<string, string> { { "CompilerVersion", "v4.0" } });
var options = new CompilerParameters { OutputAssembly = path);
var results = compiler.CompileAssemblyFromFile(options, sourceFile);


Take a look at the CSharpCodeProvider class.

0

精彩评论

暂无评论...
验证码 换一张
取 消