我想试用微软的新编辑器 - Visual Studio Code。 我想实现一个简单的应用程序(如Hello,World)并能够调试它。但经过大量的谷歌搜索和尝试,我没有设法做到这一点。那可能吗?我安装了Visual Studio 2015的Windows 10。Windows上的Visual Studio代码,C#支持
我已经尝试做的事:
1)取消注释在tasks.json文件中的以下内容:
{
"version": "0.1.0",
"command": "msbuild",
"args": [
// Ask msbuild to generate full paths for file names.
"/property:GenerateFullPaths=true"
],
"taskSelector": "/t:",
"showOutput": "silent",
"tasks": [
{
"taskName": "build",
// Show the output window only if unrecognized errors occur.
"showOutput": "silent",
// Use the standard MS compiler pattern to detect errors, warnings
// and infos in the output.
"problemMatcher": "$msCompile"
}
]
但是编译(按Ctrl-Shift-B键)失败,出现错误:“无法启动外部程序的MSBuild 产卵的MSBuild ENOENT。“
2)阅读这篇文章:http://michaelcrump.net/creating-and-debugging-console-apps-with-vscode/,但我没有任何project.json文件,也是‘dnx . run
’失败,出现错误” System.InvalidOp erationException:无法解决项目“
有没有简单的方法来在VS代码中运行简单的C#应用程序?我想知道为什么它如此复杂。可能,我错过了一些东西,欢迎任何想法。
更新1:添加的MSBuild到路径有助于
VS Code的功能还是有限的。在Visual Studio 2015中运行简单的C#应用会容易得多。 – natemcmaster
您是否对此有进一步了解?我也只是发现了VSC,这对于小的变化来说是VS的一个很好的替代方案,但是我得到了同样的错误。 – svanelten
@svanelten,不幸的是,没有。但我使用旧版本的VS Code,你有哪个版本? – pfedotovsky