如何免费编写、编译和运行 C#(在 Windows 中)

声明:本页面是StackOverFlow热门问题的中英对照翻译,遵循CC BY-SA 4.0协议,如果您需要使用它,必须同样遵循CC BY-SA许可,注明原文地址和作者信息,同时你必须将它归于原作者(不是我):StackOverFlow 原文地址: http://stackoverflow.com/questions/741422/
Warning: these are provided under cc-by-sa 4.0 license. You are free to use/share it, But you must attribute it to the original authors (not me): StackOverFlow

提示:将鼠标放在中文语句上可以显示对应的英文。显示中英文
时间:2020-08-04 23:22:49  来源:igfitidea点击:

How to write, compile and run C# for free (in Windows)

c#deploymentide

提问by Peter

Is it possible to use C# for free? Which tools would you use?

是否可以免费使用 C#?你会使用哪些工具?

  1. For fun/studying: I'm pretty sure you can, but still, the tools question remains.
  2. For programs you wish to sell?
  1. 为了好玩/学习:我很确定你可以,但工具问题仍然存在。
  2. 对于您希望出售的程序?

The tools I'm looking for:

我正在寻找的工具:

  1. IDE (as complete as possible: debugging, refactoring, libraries, IntelliSense etc.) - also, if it's not included in the IDE, compiler.
  2. Unit Testing,
  3. Documenting (extracting comments as with JavaDoc),
  4. Deploying.
  1. IDE(尽可能完整:调试、重构、库、IntelliSense 等) - 此外,如果 IDE 中未包含,编译器。
  2. 单元测试,
  3. 记录(像 JavaDoc 一样提取注释),
  4. 部署。

Other suggestions for nice free tools are also welcome.

也欢迎其他关于不错的免费工具的建议。

Note that IMO, Visual Studio Express is NOT offering all these tools.

请注意,IMO、Visual Studio Express 不提供所有这些工具。

采纳答案by Jozef Izso

IDEs:

IDE:

standalone compiler:

独立编译器:

  • csc.exe, vbc.exe and msbuild.exe are a part of .NET Framework. Windows SDK tools is also free. Or you can use compiler from Mono project.
  • csc.exe、vbc.exe 和 msbuild.exe 是 .NET Framework 的一部分。Windows SDK 工具也是免费的。或者您可以使用Mono 项目中的编译器。


Unit Testing:

单元测试:

  • NUnit, mbUnit, xUnit and many, many others.
  • NUnit、mbUnit、xUnit 等等。

Documenting: (extracting comments JavaDoc-style)

记录:(提取 JavaDoc 风格的注释)

Deploying:

部署:

回答by hahuang65

You can download Visual Studio Express. It includes all that you are asking for. Here is the linky :)

您可以下载 Visual Studio Express。它包括您所要求的一切。这是链接:)

Good luck!

祝你好运!

http://www.microsoft.com/express/download/

http://www.microsoft.com/express/download/

回答by Quan Mai

Visual Studio 2008 Express, (or Visual C# 2008 Express, if you don't want to use other languages) is a good choice. It's free.

Visual Studio 2008 Express(或 Visual C# 2008 Express,如果您不想使用其他语言)是不错的选择。免费。

Non-Microsoft, try SharpDevelop

非微软,试试SharpDevelop

Edit: if you are a student, and your university is MSDN AA certificated, you can get Visual Studio 2008 Professional for free. Yes, free.

编辑:如果您是学生,并且您的大学获得 MSDN AA 认证,则可以免费获得 Visual Studio 2008 Professional。是的,免费。

回答by Simon Broadhead

Look at Visual C# Expressfor your IDE and compiler, NDocfor your documentation, MbUnitor NUnitfor unit testing, and I believe C# Express will handle deployment as well.

看看你的 IDE 和编译器的Visual C# Express,你的文档的NDoc,单元测试的MbUnitNUnit,我相信 C# Express 也可以处理部署。

回答by user88637

  1. Visual C# express edition
  2. Visual C# express edition
  3. Nunit
  4. SandCastle
  5. Don't know , I'll let someone else answer that.
  1. Visual C# 速成版
  2. Visual C# 速成版
  3. 纽特
  4. 沙堡
  5. 不知道,我让别人回答。

回答by Steve

Also look at WiXfor deploying - this allows you to create MSI files.

另请查看用于部署的WiX- 这允许您创建 MSI 文件。

回答by Bevan

While OP says:

虽然 OP 说:

Visual Studio Express is NOT offering all this tools as claimed!

What doesn't C# Express provide that you want?

serious deploying, unit testing, documenting

Visual Studio Express 并未提供声称的所有这些工具!

C# Express 没有提供您想要的什么?

认真部署、单元测试、记录

Yet, IMO you cando that with Visual Studio Express.

然而,IMO 你可以用 Visual Studio Express 做到这一点。

Deployment

部署

Visual Studio Deployment projects are certainly missing from Visual Studio Express, but frankly that's not much of an omission. The whole feature is half baked, good enough to tick off a feature list, good enough for toy deployments but, arguably, not really up to the rigors of the real world.

Visual Studio Express 中肯定缺少 Visual Studio 部署项目,但坦率地说,这并不是什么遗漏。整个功能是半成品,足以勾出功能列表,足以用于玩具部署,但可以说,并没有真正达到现实世界的严格要求。

Windows Installer XML(WiX) is an open source toolkit from Microsoft for creating installers. The installer for Microsoft Office 2007 was reportedlybuilt with WiX, so it's reasonable to believe that it can handle any smaller case.

Windows Installer XML(WiX) 是 Microsoft 的一个开源工具包,用于创建安装程序。据报道,Microsoft Office 2007 的安装程序是用 WiX 构建的,因此有理由相信它可以处理任何较小的情况。

Another installation tool is the Nullsoft Scriptable Install System, perhaps easier to understand than WiX, but also not using with the MSI technology built into Windows and therefore harder to manage in the Enterprise case.

另一个安装工具是Nullsoft Scriptable Install System,它可能比 WiX 更容易理解,但也不与 Windows 内置的 MSI 技术一起使用,因此在企业案例中更难管理。

Unit Testing

单元测试

The Microsoft testing framework is MSTest, and while it's up to the task, it's not the leader of the pack. In fact, if you google around for reactions to MSTest, you'll find many who think it a ripoff of NUnit.

Microsoft 测试框架是MSTest,虽然它可以胜任任务,但它并不是领导者。事实上,如果你在 google 周围搜索对 MSTest 的反应,你会发现很多人认为它是NUnit 的翻版

There was a time that you could integrate any of the test tools into Visual Studio Express, using Test Driven.Net, though that no longer works.

曾几何时,您可以使用Test Driven.Net将任何测试工具集成到 Visual Studio Express 中,尽管这不再有效。

What doeswork is to use the external runner programs for your unit testing tool - all of the major unit testing frameworks come with them. When using VS Express myself, I tend to have the test runner hanging around in the background; rerunning tests then just involves a task switch.

什么的工作就是使用你的单元测试工具外亚军的程序-所有主要的单元测试框架来与他们的。当我自己使用 VS Express 时,我倾向于让测试运行器挂在后台;重新运行测试然后只涉及任务切换。

NUnit is the grandaddy of the .NET testing frameworks, and it works very well. There are others around though, such as mbUnitand xUnit.

NUnit 是 .NET 测试框架的鼻祖,它运行良好。不过还有其他的,比如mbUnitxUnit

Documentation

文档

No version of Visual Studio has a good story for documentation. In fact, they all have the same story- a compiler switch to generate XML files based on the documentation comments.

没有哪个版本的 Visual Studio 有好的文档故事。事实上,它们都有相同的故事——编译器开关以根据文档注释生成 XML 文件。

To convert those XML files into real documentation, you need other tools. NDocused to be the standard, but that project is unfortunately now dead (quite a sad tale). Sandcastle(another Microsoft Open Source project) is likely to become the new gold standard, but the tool isn't yet as mature and easy to use as we would like. DocUis a new release in this field, might be worth followup.

要将这些 XML 文件转换为真正的文档,您需要其他工具。NDoc曾经是标准,但不幸的是,那个项目现在已经死了(一个悲伤的故事)。Sandcastle(另一个 Microsoft 开源项目)很可能成为新的黄金标准,但该工具还没有我们希望的那样成熟和易于使用。DocU是该领域的新版本,可能值得跟进。

Conclusions

结论

As you can see, there are good ways to achieve the goals you want, even using Visual Studio Express. In fact, there are only two things you'll gain from moving up to a paid version of Visual Studio.

如您所见,即使使用 Visual Studio Express,也有一些很好的方法可以实现您想要的目标。事实上,升级到付费版本的 Visual Studio 只会带来两件事。

  1. You'll get MSTest, if you want it.
  2. You'll be able install extensions/plugins like TestDriven.NET and Resharper.
  1. 如果需要,您将获得 MSTest。
  2. 您将能够安装扩展/插件,如 TestDriven.NET 和 Resharper。

For someone getting started, I don't think the value proposition is there. Start with the free tools and spend money when you have enough experience to spend it well.

对于刚入门的人,我认为不存在价值主张。从免费工具开始,当您有足够的经验来花好钱时再花钱。

回答by NileshChauhan

  1. IDE (as complete as possible, debugging, refactoring, libraries, intellisense, ...)
    => Sharpdevelop (#develop)an Open Source IDE for .Net with support for multiple languages.
  2. If not in IDE, compiler
    => As mentioned by Jozef
  3. Unit Testing
    => Sharpdevelop, NUnit integrated inside
  4. Documenting (extracting comments eg, cf javadoc)
    => Sharpdevelop, SandCastleand SHFBintegrated
  5. Deploying
    => Sharpdevelop, WIXintegrated.
  1. IDE(尽可能完整,调试,重构,库,智能感知,...)
    => Sharpdevelop (#develop)一个支持多种语言的 .Net 开源 IDE。
  2. 如果不在 IDE 中,编译器
    => 正如 Jozef 所提到的
  3. 单元测试
    => Sharpdevelop,NUnit 集成在里面
  4. 记录(提取评论,例如,cf javadoc)
    => Sharpdevelop、SandCastleSHFB集成
  5. 部署
    => Sharpdevelop,WIX集成。

Check out all the features for Shardevelop at SharpDevelop Features

SharpDevelop 功能中查看SharpDevelop 的所有功能

Its free to create programs and sell. For fun you can develop some more features inside it :)

它可以免费创建程序和销售。为了好玩,您可以在其中开发更多功能:)