Skip to content

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

Open

Description

@Byron-Miles

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.

Activity

  1. tyoc213 commented on Jan 3, 2017

    @tyoc213

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

  2. jujis008 commented on Jan 10, 2017

    @jujis008

    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.

  3. holland01 commented on Jan 29, 2017

    @holland01

    @Byron-Miles

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

  4. Xanewok commented on Jan 31, 2017

    @Xanewok

    @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).

  5. huettenhain commented on Feb 20, 2017

    @huettenhain

    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"
    
  6. Pzixel commented on Feb 22, 2017

    @Pzixel

    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.

  7. Ustimov commented on Mar 9, 2017

    @Ustimov

    @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.

  8. Pzixel commented on Mar 9, 2017

    @Pzixel

    @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.

  9. OrkanCom commented on Mar 23, 2017

    @OrkanCom

    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 )

  10. dimant commented on May 13, 2017

    @dimant

    bump

  11. keerthivasan-r commented on Jul 20, 2017

    @keerthivasan-r

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

  12. added this to the 0.2 milestone on Sep 20, 2017
  13. ShiqiAi commented on Feb 27, 2018

    @ShiqiAi

    also works for me on 1.24.0 today

  14. whidbey commented on Jul 29, 2019

    @whidbey

    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

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions