Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"Key 'program' is not set to launch configuration and /or is not a string" #29

Open
erenturkm opened this issue Jun 19, 2023 · 7 comments
Labels
next release will be in the next release

Comments

@erenturkm
Copy link

Hi,

I am using Visual Studio 2022 (Windows) Version 17.6.3 with rust-analyzer.vs v2.0.154.

I open one of the rust files, click on run or debug I get this error.

@parthopdas
Copy link
Member

parthopdas commented Jun 19, 2023

thanks. which error?

please use https://www.screentogif.com/ to show the repro.

@erenturkm
Copy link
Author

VS2022Error
I had a similar problem with vscode and it added the launch configuration automatically.

@parthopdas
Copy link
Member

thank you for the repro. it makes sense now.

so i'll have to disable setting anything other than cargo.toml or an example rs from the "currently selected document list". mainly because a rust project may have multiple .rs files and those are not really "startup projects".

in this case do you need to select main.rs for any specific reason? could you not select the contain toml file or the containing project from the select target drop down.

@erenturkm
Copy link
Author

VS2022Error2
cargo.toml file is not on this list, selecting Exe works or selecting cargo.toml from solution explorer, right click/debug will work but these are not the default behaviors, In c# projects we are used to start debuging from the startup project file.

Probably customizing the error message to hint on what to do, instead of a cryptic message would help a lot.

@parthopdas parthopdas reopened this Jun 27, 2023
@parthopdas
Copy link
Member

customizing the error message is a good idea. it will be in the next release

@parthopdas parthopdas added the next release will be in the next release label Jun 27, 2023
@Guan-love-Ling
Copy link

Guan-love-Ling commented Aug 21, 2024

Hi,

I am using Visual Studio 2022 (Windows) Version 17.6.3 with rust-analyzer.vs v2.0.154.

I open one of the rust files, click on run or debug I get this error.

hey, guys, I get the right way to run rust-Project ,look at my picture
image
Everything is OK
image

@CaptainZippy
Copy link

I had the same issue. Setting the startup to be the projects Cargo.toml gets a little further, but now I get a very generic

Image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
next release will be in the next release
Projects
None yet
Development

No branches or pull requests

4 participants