如何在不使用 Visual Studio 的情况下编译和运行 c# 程序? [英] How can I compile and run c# program without using visual studio?

查看:77
本文介绍了如何在不使用 Visual Studio 的情况下编译和运行 c# 程序?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我对 C# 很陌生.我刚刚使用 Visual Studio 运行了 C#Hello World"程序.

I am very new to C#. I have just run C# 'Hello World' program using Visual Studio.

我可以在不使用 Visual Studio 的情况下运行或编译 C# 程序吗?

Can I run or compile a C# program without using Visual Studio?

如果可能,我应该使用哪个编译器?

If it is possible, then which compiler should I use?

谢谢

推荐答案

如果您安装了 .NET v4(因此如果您有更新的 Windows 或应用了 Windows 更新)

If you have .NET v4 installed (so if you have a newer windows or if you apply the windows updates)

C:WindowsMicrosoft.NETFrameworkv4.0.30319csc.exe somefile.cs

C:WindowsMicrosoft.NETFrameworkv4.0.30319msbuild.exe nomefile.sln

C:WindowsMicrosoft.NETFrameworkv4.0.30319msbuild.exe nomefile.csproj

如果您安装了 .NET,很可能会设置 %FrameworkDir% 变量,因此:

It's highly probable that if you have .NET installed, the %FrameworkDir% variable is set, so:

%FrameworkDir%v4.0.30319csc.exe ...

%FrameworkDir%v4.0.30319msbuild.exe ...

这篇关于如何在不使用 Visual Studio 的情况下编译和运行 c# 程序?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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