以下是我在 Visual Studio 2022 下的Rust项目信息:
的数据
Cargo.toml
:
[workspace]
[package]
name = "my_rust_workspace"
version = "4.0.0-dev"
edition = "2021"
description = "Provides the package"
license = "Apache-2.0"
[dependencies]
[[bin]]
name = "main_executable"
path = "./main.rs"
字符串
main.rs
:
fn main() {
let c1 = 5;
let c2 = 10;
let _c3 = c1 + c2;
let _c4 = 200;
}
型
tasks.js.jason
{
"version": "2.0.0",
"tasks": [
{
"label": "cargo build",
"dependsOn": [
"cargo build example"
]
},
{
"label": "cargo build release",
"dependsOn": [
"cargo build example release"
]
},
{
"label": "cargo build example",
"type": "cargo",
"command": "build",
"args": [],
"problemMatcher": [
"$rustc"
],
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"label": "cargo build example release",
"type": "cargo",
"command": "build",
"args": [
"--release"
],
"problemMatcher": [
"$rustc"
],
"options": {
"cwd": "${workspaceFolder}"
}
},
{
"type": "cargo",
"command": "build",
"problemMatcher": [
"$rustc"
],
"group": "build",
"label": "rust: cargo build"
},
{
"taskLabel": "task-Rust - vs2022 debug",
"appliesTo": "/",
"type": "launch"
}
]
}
型
launch.vs.json
{
"version": "0.2.1",
"defaults": {},
"configurations": [
{
"type": "native",
"name": "C:\\git\\Rust - vs2022 debug",
"project": "",
"projectTarget": ""
}
]
}
型
我右键单击cargo.toml
文件并将其选择为启动项。
当我想调试时,我会看到以下内容:
的
这实际上是我的项目目录以前的名称。
我将其重命名为Rust - vs2022 debug
。然而,旧的名字仍然出现。
现在,我找不到那个旧名字存在的位置。因此,我无法更改名称。
我该如何解决此问题?
1条答案
按热度按时间mf98qq941#
我解决了这个问题。
我删除了**
C:\git\Rust - vs2022 debug\.vs
目录下的slnx.sqlite
**文件。现在,这个错误消失了。