在 Visual Studio Code 中设置“outDir"属性 [英] Setting the 'outDir' attribute in Visual Studio Code

查看:73
本文介绍了在 Visual Studio Code 中设置“outDir"属性的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

当我尝试调试 C++ 程序时,我继续收到此错误:can't launch program 'c:\Users\'my username'\Desktop\C++\';设置outDir"属性可能会有所帮助

I continue to get this error when I attempt to debug a C++ program: can't launch program 'c:\Users\'my username'\Desktop\C++\'; setting the 'outDir' attribute might help

我尝试了各种语法组合来满足条件,但没有成功.我花了几个小时试图找到正确的语法,但我不知道我的问题是什么.我在运行 JavaScript 应用程序方面取得了成功,但它们似乎不需要填充 Source maps 或 outDir 字段.我有最新版本的 Visual Studio Code,它是 0.7.10,我已经下载了节点,它似乎工作正常.这是一个屏幕截图,因此您可以了解我所看到的内容.http://i.imgur.com/wIcVoQz.png

I have tried various combinations of syntax so that it would satisfy the condition, but I have had no success. I have spent hours trying to find the proper syntax and I have no idea what my problem is. I have had success with running JavaScript applications but they don't seem to require Source maps or the outDir field to be filled. I have the latest version of Visual Studio Code which is 0.7.10 and I have node downloaded and it seems to work fine. Here is a screenshot so you can get an idea of what I'm seeing. http://i.imgur.com/wIcVoQz.png

推荐答案

VSCode 消息 Cannot launch program ... 设置 'outDir' 属性可能有帮助 可以有点误导,即使是最近的 VSCode v1.12.2.我对此持保留态度,这似乎只是意味着启动应用程序时出现问题.

The VSCode message Cannot launch program ... setting the 'outDir' attribute might help can be somewhat misleading, even as recently as VSCode v1.12.2. I would take it with a grain of salt, it seems to simply mean there was a problem launching the application.

就我而言,它是由我的 launch.json 文件中的一个小错误引起的.我有:

In my case, it was caused by a minor error in my launch.json file. I had:

        "type": "node",
        "request": "launch",
        "name": "Gulp",
        "program": "${workspaceRoot}/node_modules/gulp/bin",
        "sourceMaps": true,
        "outFiles": [
            "${workspaceRoot}/{lib,node_modules}/**/*.js",
            "!${workspaceRoot}/lib/tests/**/*.js"
        ]

我通过更改一行来修复它:

I fixed it by changing one line:

        "program": "${workspaceRoot}/node_modules/gulp/bin/gulp",

尽管该消息试图提供帮助,但 outFiles 属性可能不是必需的或没有帮助的.一旦我解决了另一个问题,调试似乎没有它就可以正常工作.

Despite the message's attempt to be helpful, the outFiles property may not be necessary or helpful. Once I fixed the other problem, debugging seems to work fine without it.

提交为 vscode 问题 6/8/2017

Filed as a vscode issue 6/8/2017

这篇关于在 Visual Studio Code 中设置“outDir"属性的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆