使用VSCode在Ubuntu上编译C#项目

前端之家收集整理的这篇文章主要介绍了使用VSCode在Ubuntu上编译C#项目前端之家小编觉得挺不错的,现在分享给大家,也给大家做个参考。
我根据 documentation中提供的各种教程在Ubuntu 14.04上设置了VSCode – 我尽可能多地尝试了一些。编辑运行没有问题,(在使用Mono版本差异后)提供了与我认为的大多数替代方案相比较优越的编码体验。

尝试编译我的C#项目时出现问题。这是我在完成入门指南时所预期的功能。在按Ctrl键B之后,我最初被提示创建一个tasks.json文件,该文件可以提供项目特定的短键动作配置。从最初的tasks.json生成的注释中,它似乎是针对Windows,并引用一个tsc.exe程序,它是一个TypeScript编译器。

我在同一台笔记本电脑上花了一点时间在MonoDevelop上构建项目,但从来没有必要设置编译步骤。假设这应该是开箱即用的功能错误,或者我错过了正确处理C#项目的步骤?

昨天晚上查看默认的tasks.json文件时,我一定不耐烦。有一个引用msbuild的部分(向下):
  1. // Uncomment the section below to use msbuild and generate problems
  2. // for csc,cpp,tsc and vb. The configuration assumes that msbuild
  3. // is available on the path and a solution file exists in the
  4. // workspace folder root.
  5. /*
  6. {
  7. "version": "0.1.0","command": "msbuild","args": [
  8. // Ask msbuild to generate full paths for file names.
  9. "/property:GenerateFullPaths=true"
  10. ],"taskSelector": "/t:","showOutput": "silent","tasks": [
  11. {
  12. "taskName": "build",// Show the output window only if unrecognized errors occur.
  13. "showOutput": "silent",// Use the standard MS compiler pattern to detect errors,warnings
  14. // and infos in the output.
  15. "problemMatcher": "$msCompile"
  16. }
  17. ]
  18. }
  19. */

只需注释文件的其余部分,取消注释上述JSON文本,并将“命令”从“msbuild”更改为“xbuild”(Mono等效文件)。现在按ctrl shift B成功编译项目。

希望这个手动修改配置文件将不再需要或乏味,一旦预览。

编辑

将此标记为现在的答案。如果产品发展过程中会发生变化,会更新或接受更好的答案。

猜你在找的Ubuntu相关文章