开发者

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

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

上一篇:

下一篇:

精彩评论

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

最新问答

问答排行榜