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

Could not find 'Cargo.toml' in 'C:\Users\...\Documents' #406

Tape-Worm opened this issue Aug 23, 2018 · 4 comments


None yet
4 participants
Copy link

commented Aug 23, 2018

I decided to play around with Rust last night (never used it before). So I got everything set up:

  • Rustup
  • RLS
  • VisualStudio Code (1.26.1)
  • This plug in/extension

I'm able to debug and run my application fine, but when I try to check or build the application I get this:

I have no idea why this is happening. I haven't done anything special... at least I don't think. Not sure if this is your issue or vscode. But I figured I'd try here first.

Here's my project setup:
For reference, the project is located at "D:\Code\RustTest"

It should be able to find the Cargo.toml right?

@nrc nrc added the bug label Aug 25, 2018


This comment has been minimized.

Copy link

commented Aug 25, 2018

Was D:\Code\RustTest the directory you opened in VSCode? And is that the directory with Cargo.toml in it?

It looks like something (Cargo, probably) is looking for Cargo.toml in your documents directory, I'm not sure why.


This comment has been minimized.

Copy link

commented Aug 31, 2018

Sorry for the delay, but the answer to your questions is: Yes and yes.


This comment has been minimized.

Copy link

commented Nov 22, 2018

I was having the same problem. In my case, the issue was in my Powershell profile, where I had a line that set the current path (so when I open Powershell, it opens in a more convenient directory). VSCode apparently runs your profile script when it opens a terminal, which explains why it couldn't find the Cargo.toml file. When I removed the Set-Location ... line from my Microsoft.PowerShell_profile.ps1 file, the build commands started working.


This comment has been minimized.

Copy link

commented Mar 26, 2019

Thanks for the help.

I had totally forgotten about this until a coworker and I were talking about Rust. And I went back to see if my profile script had a directory change in it, and sure enough, it did.

Removing that fixed it.

Question is, is this a vs code problem? or a problem with the plug in?

Anyway, it works now, so I guess this can be closed.

@Xanewok Xanewok closed this Apr 7, 2019

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.