使用终端命令在 VS Code 中构建的示例NotepadAndCalculatorTestdotnet build项目会引发以下错误:
C:\Program Files\dotnet\sdk\5.0.401\Microsoft.Common.CurrentVersion.targets(820,5): error : The BaseOutputPath/OutputPath property is not set for project 'NotepadCalculatorTest.csproj'. Please check to make sure that you have specified a valid combination of Configuration and Platform for this project. Configuration='Debug' Platform='AnyCPU'. You may be seeing this message because you are trying to build a project without a solution file,
and have specified a non-default Configuration or Platform that doesn't exist for this project. [C:\Users\<username>\VSCode Projects\WinAppDriverTryout\Test\Samples\C#\NotepadAndCalculatorTest\NotepadCalculatorTest.csproj]
Run Code Online (Sandbox Code Playgroud)
或者:
NotepadCalculatorTest.csproj(109,5): error : …Run Code Online (Sandbox Code Playgroud) 我正在使用 Vscode 来开发 flutter 应用程序。在我的手机上以调试模式运行应用程序并停止调试,然后在手机上打开应用程序后,它会加载以前的版本而不是当前版本。
几个月来,我在 VSCode 中使用虚拟环境、python 笔记本和 jupyter 时遇到了问题,由于某种原因,很多时候,它找不到我添加的内核,即使我在运行时可以看到它们jupyter kernelspec list。它们是否出现似乎是随机的。重新加载屏幕并重新启动 vscode 没有帮助,禁用和重新启用 python 和 jupyter 扩展也没有帮助。我通过按钮、选择内核和命令面板都尝试了这两种方法。我通常从命令行启动 vscode,并激活我的虚拟环境。而且,很多我很久以前删除的内核仍然出现在列表中。vscode 和笔记本电脑都是最新的。我之前遇到过集成 jupyter 笔记本的问题,起初格式化和自动完成在笔记本中不起作用(但它们在常规 python 文件中起作用)。我使用的是 MacOS,如果这很重要的话。
当我使用绝对路径时,代码工作正常,但使用相对路径会在 python 中抛出 FileNotFoundError 。
f = open("Input.txt","r")
Run Code Online (Sandbox Code Playgroud)
所以,我在 Jupyter 笔记本上使用 VSCode 已经快一年半了,它以前总是正常工作,但几天前它就坏了,我不知道为什么。这就是我的意思:
正如您所看到的,没有语法突出显示,并且自动完成根本不起作用......但是如果我运行代码,它确实可以完美运行。
但它在 Python 脚本中正常工作:
我有相关的扩展:
我还有很多其他的 C++ 和 Java 的。
另外,我注意到 Jupyter 和 Python 扩展都会出现未捕获的错误,这就是我的意思:
我不知道这意味着什么。我尝试卸载并重新安装扩展、重新安装 VSCode、重置 settings.json 并重新启动我的笔记本电脑,但没有任何效果。
任何帮助将不胜感激。谢谢
如果我有几个需要放在主包中的go文件,我如何指定它们在launch.json中编译?我会将它们重构为包。但这个项目却遭到抵制。
即要在命令行上运行它们,我必须使用:
go run main.go stuff.go other.go
Run Code Online (Sandbox Code Playgroud)
我如何将其包含在 launch.json 文件中?
{
"name": "Launch myprog",
"type": "go",
"request": "launch",
"mode": "debug",
"program": "${workspaceRoot}/cmd/myprog/main.go",
"args": ["param"]
},
Run Code Online (Sandbox Code Playgroud)
我已经尝试过明显的方法。我想做一些调试。
那么...我如何在 launch.json 中指定编译文件夹中的包而不仅仅是一个特定文件?
如果go run main.go等于"program": "${workspaceRoot}/cmd/myprog/main.go"
那么,go run .相当于什么?"program": "${workspaceRoot}/cmd/myprog/[?????]"
因为显而易见的东西对我不起作用。
谢谢
问题是我实际上可以通过 Windows CMD 访问 C:\Program Files\nodejs\node.exe,例如:node -v:
C:\Users\User>node -v
v16.13.0
Run Code Online (Sandbox Code Playgroud)
但 Visual Studio Code(已安装 Node.js 扩展包)无法识别终端中的节点。我所能发现的就是:
node : The term 'node' is not recognized as the name of a cmdlet, function, script file, or operable program. Check the
spelling of the name, or if a path was included, verify that the path is correct and try again.
At line:1 char:1
Run Code Online (Sandbox Code Playgroud) 我试图在使用 VSCode 时获取当前 Jupyter 笔记本的路径。
我尝试了这篇文章中的所有解决方案,但它们都不适用于 VSCode。我可以让他们通过 Jupyterlab 工作。
当我尝试涉及 %%javascript 魔术命令的解决方案时,该单元将成功执行,但内核不会使用包含笔记本名称的变量进行更新。
本文档的第 13 步表示“从下拉列表中选择 Debug Express 和 Angular,然后按 F5 启动调试器”。按F5得到
Error: The func task detection didn't contribute a task for the following configuration:
{
"type": "func",
"command": "host start",
"problemMatcher": "$func-watch",
"isBackground": true,
"dependsOn": "npm build",
"options": {
"cwd": "${workspaceFolder}/functions"
}
}
Run Code Online (Sandbox Code Playgroud)
相信它的意思是tasks.json,第34行。这是Angular + Node/Express的MS代码项目。导致 API 处的断点未绑定,终端显示
[HPM] Error occurred while trying to proxy request /api/vacations/
from localhost:4200
to http://localhost:7070 (ECONNREFUSED)
(https://nodejs.org/api/errors.html#errors_common_system_errors)
Run Code Online (Sandbox Code Playgroud)
如何配置task?
由于我的小部件的大小或数据(我猜),我收到多个错误。\n我尝试重新编写这部分,但它不起作用。\n是因为小部件的大小还是其他原因?
\n @override\n Widget build(BuildContext context) {\n var questionsOf = widget.setType(InputPage.topicN);\n\n CollectionReference contestantsRef =\n FirebaseFirestore.instance.collection(\'contestants\');\n\n return Scaffold(\n backgroundColor: Colors.blue,\n appBar: AppBar(\n centerTitle: true,\n ),\n body: SafeArea(\n child: Column(\n children: <Widget>[\n Flexible(\n child: Container(\n height: 100,\n child: iconCreate(),\n )),\n Container(\n child: StreamBuilder<QuerySnapshot>(\n stream: contestantsRef.snapshots(),\n builder: (BuildContext context, AsyncSnapshot asyncSnapshot) {\n List<DocumentSnapshot> listOfDocumentSnap =\n asyncSnapshot.data.docs;\n\n return ListView.builder(\n itemBuilder: (context, index) {\n return Text(\'${listOfDocumentSnap[index].data()}\');\n },\n itemCount: listOfDocumentSnap.length,\n );\n },\n ),\n ),\n SizedBox(\n height: 100,\n ),\n Flexible(\n flex: 4,\n child: Container(\n height: 200,\n margin: …Run Code Online (Sandbox Code Playgroud)