.cs编译成dll文件

.cs编译成dll文件

csc /out:目标路径 /t:library 源文件路径

(例如:csc /out: bin\index.dll /t:library index.cs)

其中,bin\index.dll表示要编译的dll路径,index.cs表示要编译的源文件路径。


如果有引用,则

csc /out:目标路径 /r:引用路径 /t:library 源文件路径

(例如:csc /out: bin\index.dll /r:bin\common.dll /t:library index.cs)


注意:在Unity5.4版本以后将不支持.Net4.x

所以我们在需要编译的时候选择.Net3.5,具体操作如下:

打开命令窗口 -> 输入cmd到控制台 -> cd C:\Windows\Microsoft.NET\Framework\vx.x(例如v3.5),转到该

vs.net安装目录下(如果设置了环境变量就不需要转到这个目录了) -> 执行csc命令


C#编译:http://bbs.csdn.net/topics/360024896

猜你喜欢

转载自blog.csdn.net/u013917120/article/details/51264835