在命令工具中输入:csc /target:library /out: E:\Test\WindowsTest\xxxx.dll E:\Test\WindowsTest\xxxx.cs 。运行成功后就会在目录下生成对应的dll文件。