且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

如何在不使用 Visual Studio 的情况下编译和运行 c# 程序?

更新时间:2022-11-03 12:55:02

如果您安装了 .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 ...