创建C#项目在运行时 [英] create c# project at runtime

查看:100
本文介绍了创建C#项目在运行时的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

是否有任何身体知道如何创建一个C#项目在运行时,添加类,并编译它生成一个DLL。

Does any body know how can I create a C# project at runtime, add classes to it and compile it to generate a dll.

推荐答案

如果你只是想编译code,并生成一个DLL,看到cdhowie的回答。

If you just want to compile code and generate a dll, see cdhowie's answer.

如果你想拥有在最后一个完整的项目文件,您可以创建通过XML或文本输出的csproj文件,它指向code(及其他)文件要包括,然后执行的MSBuild myproject.csproj。

If you want to have a complete project file at the end, you can create a csproj file through XML or Text output, which points to the code (and other) files you want to include, then execute "msbuild myproject.csproj".

打开一个项目,你有一个记事本文件的.csproj,结构并不复杂。

Open a .csproj file for a project you have with notepad, the structure isn't complicated.

这篇关于创建C#项目在运行时的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆