How do you compile C#?

后端 未结 14 1757
日久生厌
日久生厌 2021-01-18 15:11

So, I was wondering how to compile C#. I have Windows 7 Enterprise. Is there a built-in program or do I have do download one?

If I have to download one, what do you r

相关标签:
14条回答
  • 2021-01-18 15:38

    Use the command line compiler csc

    C:\>csc file.cs
    
    0 讨论(0)
  • 2021-01-18 15:38

    I started using SharpDevelop as a portable text editor that understood ASPX files out-of-the-box (vs. Sublime, etc.), but I've build a couple of small (<10K lines) utilities using just that and CSC now. A portable copy of SharpDevelop is especially handy when you don't have the administrative permissions (or time) to install full Microsoft Visual Studio in an environment.

    Download the "XCopyable" edition to get the portable edition of SharpDevelop from here: http://www.icsharpcode.net/OpenSource/SD/Download/Default.aspx#SharpDevelop5x

    0 讨论(0)
  • 2021-01-18 15:40

    Since you're starting fresh, why not use an IDE that does it for you?

    http://www.microsoft.com/visualstudio/en-us/products/2010-editions/visual-csharp-express

    0 讨论(0)
  • 2021-01-18 15:41

    For any real development, an IDE is preferable. Microsoft offers the Visual Studio Express edition for free, which has everything you need to get started with C#.

    However, you can compile using just the command line compiler (csc.exe), which is included with the framework.

    It should be located in the .NET installation dir; for instance on my machine for .NET 4, 64 bit version, I have a csc.exe in:

    C:\Windows\Microsoft.NET\Framework64\v4.0.30319
    
    0 讨论(0)
  • 2021-01-18 15:46

    Your choices are:

    1. csc.exe (the command line compiler), which is in c:\Windows\Microsoft.Net\Framework\v4.0.30319\
    2. Install Visual Studio Express, the free edition of VS, for Windows/Console Applications, Web Applications, or Windows Phone Applications
    3. Purchase a license for Visual Studio 2010 or get an MSDN subscription
    0 讨论(0)
  • 2021-01-18 15:49

    You need Visual Studio to compile it once you have it installed. Once you have it installed you can go to Visual Studio Command Prompt and Use C# compiler csc.exe to compile it.

    Look here for more information Command-Line Building

    0 讨论(0)
提交回复
热议问题