【发布时间】:2018-10-16 23:57:51
【问题描述】:
我想尝试使用 Visual Studio Code 在 C# 中编译典型的“Hello World”。我做了以下事情:
- 我安装了 Visual Studio Code。
- 我为 Visual Studio Code (OmniSharp) 添加了扩展 C#。
- 我安装了 64 位 SDK 2.1.10。
- 我创建了一个文件夹来包含我要创建的项目。
- 我使用 Visual Studio Code 打开了该文件夹。在终端上我写道:
dotnet new console
但是,与我在网上看到的教程不同, 什么都没发生。该项目未创建,但我没有看到任何 错误消息。
感谢帮助我了解如何在 Visual Studio Code 中使用 C# 创建、编辑和编译项目。
【问题讨论】:
-
只是好奇,你为什么不安装visual studio社区版?它是免费的。
-
@VincentElbertBudiman 可能 OP 不是 windows 用户,或者 vsc 对他的系统来说太重了。
-
您应该按 Ctrl + K, O -> 打开您的文件夹,然后选择您的文件夹。
-
@Alberto 你安装了 dotnet core 吗?您可以在终端中尝试
dotnet new console -o myApp吗? -
您是否安装了.NET Core SDK?您是否尝试过从终端运行命令
dotnet new console,而不是在 vs 代码中从终端运行?
标签: c# .net visual-studio-code