简体   繁体   English

从C#构建命令行

[英]command line building from C#

I would like to make a C# app, that automatize .cs files building, using cmd.exe. 我想制作一个C#应用程序,该应用程序使用cmd.exe自动构建.cs文件。 I've learned that a line like this "%windir%\\Microsoft.NET\\FrameWork\\v3.5\\csc.exe /target:exe +.cs file's location" builds the file, and that works fine manually of course. 我了解到,像这样的行“%windir%\\ Microsoft.NET \\ FrameWork \\ v3.5 \\ csc.exe / target:exe + .cs文件的位置”将构建文件,并且当然可以手动正常运行。 How ever from a C# code i haven't managed to build any yet. 但是从C#代码开始,我还没有建立任何代码。

Can somebody please help in this problem? 有人可以帮忙解决这个问题吗? Or is there another way this is done? 还是有其他方法可以做到这一点?

Thank you! 谢谢!

总有Proces.Start(Environment.ExpandEnvironmentVariables(String.Format(@"%windir%\\Microsoft.NET\\FrameWork\\v3.5\\csc.exe /target:exe {0}", filepath)));

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM