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

No Rust installation detected (rustup-init.exe, VisualRust 0.1.2, VS 2015) #263

Open
Byron-Miles opened this issue Jan 3, 2017 · 13 comments
Labels
Milestone

Comments

@Byron-Miles
Copy link

Byron-Miles commented Jan 3, 2017

This is similar to previous issues and seems to be fixed in the lastest (but not released as of 3 Jan 2017) code, but considering it took me over 2 hours and some digging through old (VisualRust 0.1.2) code to work out a straight answer I thought I might save someone time and post the solution here:

Basically you need to point VisualRust at your install (.cargo) directory using a registry key:

  1. Run regedit.exe
  2. Navigate to HKEY_LOCAL_MACHINE\SOFTWARE
  3. Create a 'Mozilla Foundation' key (assuming it doesn't exist) under the 'SOFTWARE' key
  4. Create a 'Rust' key under the 'Mozilla Foundation' key (note: technically it only needs to start with 'rust', so you can use something like 'Rust Stable' if you like)
  5. Create another key under the 'Rust' key; pretty sure the name doesn't matter, so your installed rustc.exe version is a good choice (e.g. '1.14.0'). Your full registry path should look something like: HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Foundation\Rust\1.14.0
  6. Create an 'InstallDir' String Value under that key with the value being the install path (e.g. C:\Users\User\.cargo\ )

Good luck.

@tyoc213
Copy link

tyoc213 commented Jan 3, 2017

When will be published? This plugin suport rustup? (I mean if I change global version or per project/dir)??

@jujis008
Copy link

Works for me with above solution, thanks a lot. But how did the VR fixed the dependency problem? Any idea is welcome for such a greenhand like me.

@holland01
Copy link

@Byron-Miles

Were you running the 64-bit install when you tried this?

@Xanewok
Copy link

Xanewok commented Jan 31, 2017

@holland01
Not sure about @Byron-Miles, but I think I did. Running Windows 10 64 bit.

And I encountered the same problem as OP (registry key fix also helped - no error and VS properly compiles the project).

@huettenhain
Copy link

Same as @Xanewok here. Since I have to fix this on more than one machine, I translated @Byron-Miles solution to a console command (admin required). Works as long as you used the default rustup installation path:

REG ADD "HKLM\SOFTWARE\Mozilla Foundation\Rust\current" /v InstallDir /t REG_SZ /d "%USERPROFILE%\.cargo"

@Pzixel
Copy link

Pzixel commented Feb 22, 2017

Just tried same registry fix, repaired VisualRust installation, but still getting the same error. VS2015U3, Rust 1.15.1. Path is configured, rustc is working from command prompt just fine, so completely dunno what's wrong.

@Ustimov
Copy link

Ustimov commented Mar 9, 2017

@Pzixel, I think you made some kind of mistake or doesn't restart VS after registry edit. This works for me with Win10Pro, VS2015U3 and Rust 1.15.1.

@Pzixel
Copy link

Pzixel commented Mar 9, 2017

@Ustimov I always restart the whole PC after registry edit. That's quite easy to say I have the same leg and it's ok but it's not an answer.

@OrkanCom
Copy link

OrkanCom commented Mar 23, 2017

For lazy persons like me;
Regedit_Rust_1.16.0_InstallDir.txt

  1. Just download this txt file,
  2. Change your Rust Version Number ( in my case it's 1.16.0 ) and Windows's "User" name,
  3. Rename it to filename.reg and run it.

Txt file contains this;

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Foundation\Rust\1.16.0]
"InstallDir"="C:\\Users\\YOURUSERNAME\\.cargo\\"

Tested on Windows 8.1 64bit, Visual Studio 2015 Update3, Visual Rest VS Extension 0.1.2
( No need to restart VS or OS )

@dimant
Copy link

dimant commented May 13, 2017

bump

@keerthivasan-r
Copy link

Yeah, No restart required. Works fine! @huettenhain Thanks for the console command. Cheers

@ShiqiAi
Copy link

ShiqiAi commented Feb 27, 2018

also works for me on 1.24.0 today

@whidbey
Copy link

whidbey commented Jul 29, 2019

For lazy persons like me;
Regedit_Rust_1.16.0_InstallDir.txt

  1. Just download this txt file,
  2. Change your Rust Version Number ( in my case it's 1.16.0 ) and Windows's "User" name,
  3. Rename it to filename.reg and run it.

Txt file contains this;

Windows Registry Editor Version 5.00

[HKEY_LOCAL_MACHINE\SOFTWARE\Mozilla Foundation\Rust\1.16.0]
"InstallDir"="C:\\Users\\YOURUSERNAME\\.cargo\\"

Tested on Windows 8.1 64bit, Visual Studio 2015 Update3, Visual Rest VS Extension 0.1.2
( No need to restart VS or OS )

works form e

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

No branches or pull requests