PistonDevelopers / VisualRust

Visual Studio extension for Rust
MIT License
702 stars 72 forks source link

No Rust installation detected. You can download official Rust installer #303

Open stiv-yakovenko opened 7 years ago

stiv-yakovenko commented 7 years ago

I've installed visual rust 0.1.2, I have rustc.exe and some other files installed here: C:\Users\steve.cargo\bin But when I try to build rust project in msvc 2015 I get this error:

C:\Program Files (x86)\MSBuild\VisualRust\VisualRust.Rust.targets(53,5): error : No Rust installation detected. You can download official Rust installer from https://www.rust-lang.org/downloads.html

How is the installation detected? How can I fix this?

MaulingMonkey commented 7 years ago

Here is where installation paths that get checked are enumerated:

https://github.com/PistonDevelopers/VisualRust/blob/f005c247f0f30aa0d84fab655d192743de53bba8/src/VisualRust.Shared/Environment.cs#L84-L102

https://github.com/PistonDevelopers/VisualRust/blob/f005c247f0f30aa0d84fab655d192743de53bba8/src/VisualRust.Shared/Environment.cs#L115-L125

Might just need to set CARGO_HOME appropriately.

dzmitry-lahoda commented 7 years ago

Same for me with rust 1.20 on Windows 10 64bit Visual Studio 2015.

I have set CARGO_HOME to C:\Users\dzmitry_lahoda\.cargo, but still have and issues.

MaulingMonkey commented 7 years ago

Ahh, sorry, I've just noticed that the logic is different in Visual Rust 1.2.0 - it doesn't support CARGO_HOME: https://github.com/PistonDevelopers/VisualRust/blob/0.1.2/VisualRust.Shared/Environment.cs

Setting MULTIRUST_HOME to your .cargo path might work, or there are some earlier workarounds with registry keys: https://github.com/PistonDevelopers/VisualRust/issues/263 . Alternatively, grab the trunk version from https://ci.appveyor.com/project/vosen/visualrust/build/artifacts (or follow the Readme's appveyor links).

dzmitry-lahoda commented 7 years ago

Latest installation for 2015

9/16/2017 4:49:56 PM - Microsoft VSIX Installer
9/16/2017 4:49:56 PM - -------------------------------------------
9/16/2017 4:49:56 PM - vsixinstaller.exe version:
9/16/2017 4:49:56 PM - 15.0.26209.1 built by: D15REL
9/16/2017 4:49:56 PM - -------------------------------------------
9/16/2017 4:49:56 PM - Command line parameters:
9/16/2017 4:49:56 PM - C:\Program Files (x86)\Microsoft Visual Studio\Installer\resources\app\ServiceHub\Services\Microsoft.VisualStudio.Setup.Service\VSIXInstaller.exe,/admin,/logFile:C:\Users\DZMITR~1\AppData\Local\Temp\Visual_Rust_for_Visual_Studio_2015_20170916164815_002_VSIXBootstrapper.log,C:\ProgramData\Package Cache\9864EE5369359DB622D0234B6C6B7640B949140C\VisualRust.vsix
9/16/2017 4:49:56 PM - -------------------------------------------
9/16/2017 4:49:56 PM - Microsoft VSIX Installer
9/16/2017 4:49:56 PM - -------------------------------------------
9/16/2017 4:49:58 PM - Initializing Install...
9/16/2017 4:49:59 PM - Microsoft.VisualStudio.ExtensionManager.InvalidExtensionPackageException: The file is not a valid VSIX package.
   at Microsoft.VisualStudio.ExtensionManager.InstallableExtensionImpl.ReadVSIXManifestFromPackage(Stream stream, CultureInfo preferredCulture)
   at Microsoft.VisualStudio.ExtensionManager.InstallableExtensionImpl..ctor(String path, CultureInfo preferredCulture)
   at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.CreateInstallableExtension(String extensionPath, CultureInfo preferredCulture)
   at Microsoft.VisualStudio.ExtensionManager.ExtensionEngineImpl.CreateInstallableExtension(String extensionPath)
   at VSIXInstaller.App.GetInstallableData(String vsixPath, Boolean isRepairSupported, IEnumerable`1& skuData)
   at VSIXInstaller.App.Initialize(Boolean isRepairSupported)
   at VSIXInstaller.App.Initialize()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()

I have installed VS 2017 Pro and latest plugin. No install errors, but no templates in New Project.

dzmitry-lahoda commented 7 years ago

MULTIRUST_HOME seems deprecated.

MaulingMonkey commented 7 years ago

There's an unmerged pull request to fix the templates and other issues: https://github.com/PistonDevelopers/VisualRust/pull/286

ekardnam commented 6 years ago

Any news on this Issue, I'm having the same problem, even after setting the CARGO_HOME Need any help fixing this?

seechov commented 1 year ago

Solution from this bug helped me. Solution. Create file rust-win.reg with similar content (replace TODO_Place_your_username_here to your actual path.

Windows Registry Editor Version 5.00

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

Then run it by double-clicking on the file.