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

Missing VisualRust Project/Item Templates. (Originally: Installed. And Now?) #283

Open
ioncodes opened this issue May 31, 2017 · 19 comments
Labels
Milestone

Comments

@ioncodes
Copy link
Contributor

I installed VisualRust via the latest msi installer from AppVeyor. It has been installed successfully, but if I open Visual Studio, I can't see any Templates for Rust if I open the project wizard.

@werdahias
Copy link

same problem. loading shows a possibility of .rsproj but you cant create it

@Boddlnagg
Copy link
Contributor

Boddlnagg commented May 31, 2017

Can you open a Cargo.toml file? There should also be templates in the wizard, though ...

@ioncodes
Copy link
Contributor Author

I can open the file itself, I can open any file with Visual Studio... However, if I force to open the folder (where the Cargo.toml resides), it opens up, but it doesn't offer any Rust-ish tools/features, such as debugging, syntax highlighting and autocompletion.

@denis-golubev
Copy link

I'm currently trying to use the Rust plugin with VS 2017 and still had a rsproj lying around (I think I tested the Rust plugin with VS 2015, which I do not have installed anymore ... I honestly don't know how I created that file 😆). It looks like this (perhaps you need to generate a unique guid, when you are trying to use it different projects):

<?xml version="1.0" encoding="utf-8"?>
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
  <PropertyGroup Label="Globals">
    <ProjectGuid>6449e950-4899-48a1-8681-cb5a310833fd</ProjectGuid>
    <ManifestPath>Cargo.toml</ManifestPath>
  </PropertyGroup>
  <Import Project="$(MSBuildExtensionsPath)\VisualRust\VisualRust.Rust.targets" />
  <Import Project="$(MSBuildThisFileName).InMemory.Targets" Condition="Exists('$(MSBuildThisFileName).InMemory.Targets')" />
</Project>

With this I could load the project, but the build hangs. Auto-completion worked only for local variables. I'll try to look further into it, when I have the time.

@werdahias
Copy link

seems to work

@ioncodes
Copy link
Contributor Author

@denis-golubev How can I open the rsproj file? It isn't recognized by VS

@werdahias
Copy link

new text document-> enter it select standord opening program vs

@werdahias
Copy link

it opens up, but it doesn't offer any Rust-ish tools/features, such as debugging, syntax highlighting and autocompletion. i can confirm (partly). debugging with rust doesnt work, autocompletion,too. furthermore, git doesnt really work.

@ioncodes
Copy link
Contributor Author

ioncodes commented Jun 1, 2017

After following the steps described by @CountOmega the solution opens. It looks like VS understands it's a Rust project. I had to enable "Show All Files" to see the project files... Also as described by @CountOmega all other features don't work.

@werdahias
Copy link

Cargo.toml can be opened and edited, though. But working with it is really tricky.

@werdahias
Copy link

Biuld configurations cant be edited, too.

@werdahias
Copy link

It seems that line numbers arent really visible whilst using rust. I had to switch to on manually.

@werdahias
Copy link

werdahias commented Jun 1, 2017

vs always wants to save a sln in addition to rsproj after code edits if you close vs but you have to delete it otherwise your not able to open rsproj later

@werdahias
Copy link

only a few key words are highlighted e.g. mut let pub. String and comments, too. but other rustish word like use blalba arent highlighted.

@werdahias
Copy link

werdahias commented Jun 2, 2017

so you are forced to debug with rustup using the vs developer command prompt
@echo off cd C:\Users\Count Omega\Documents\Visual Studio 2017\Projects\Inventar C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\VC\Auxiliary\Build\vcvars64.bat cls
batch script for debugging if it helps

@MaulingMonkey
Copy link
Collaborator

When attempting to build master ( f005c24 ) myself, I've noticed that src/VisualRust/VisualRust.projitems appears to incorrectly reference the templates, which may be related. This is my fix:

   <ItemGroup Condition="'$(Configuration)' == 'Debug'">
-    <Content Include="$(MSBuildThisFileDirectory)..\VisualRust.Templates\bin\$(Configuration)\ProjectTemplates\Rust\127\ApplicationProject.zip">
+    <Content Include="$(MSBuildThisFileDirectory)..\..\bin\VisualRust.Templates\$(Configuration)\ProjectTemplates\Rust\127\ApplicationProject.zip">
       <Link>ProjectTemplates\ApplicationProject.zip</Link>
       <IncludeInVSIX>true</IncludeInVSIX>
     </Content>
-    <Content Include="$(MSBuildThisFileDirectory)..\VisualRust.Templates\bin\$(Configuration)\ProjectTemplates\Rust\127\LibraryProject.zip">
+    <Content Include="$(MSBuildThisFileDirectory)..\..\bin\VisualRust.Templates\$(Configuration)\ProjectTemplates\Rust\127\LibraryProject.zip">
       <Link>ProjectTemplates\LibraryProject.zip</Link>
       <IncludeInVSIX>true</IncludeInVSIX>
     </Content>
-    <Content Include="$(MSBuildThisFileDirectory)..\VisualRust.Templates\bin\$(Configuration)\ItemTemplates\Rust\127\Module.zip">
+    <Content Include="$(MSBuildThisFileDirectory)..\..\bin\VisualRust.Templates\$(Configuration)\ItemTemplates\Rust\127\Module.zip">
       <Link>ItemTemplates\Module.zip</Link>
       <IncludeInVSIX>true</IncludeInVSIX>
     </Content>

I can't spot the corresponding errors in AppVeyor, no idea what the build difference is, but this might be related to the templates being missing.

@MaulingMonkey
Copy link
Collaborator

Ahh - from that snippet you can also see the project and item templates were previously only included in Debug builds, whereas AppVeyor is only doing Release builds. I've created a fix for this in #286 .

@MaulingMonkey MaulingMonkey added this to the 0.2 milestone Sep 20, 2017
@MaulingMonkey MaulingMonkey changed the title Installed. And Now? Missing VisualRust Project/Item Templates. (Originally: Installed. And Now?) Sep 20, 2017
@MaulingMonkey MaulingMonkey self-assigned this Sep 20, 2017
@Pzixel
Copy link

Pzixel commented Oct 7, 2017

Same here. Installed latest build from AppVeyor on 2017, but no project template appeared. Then I created rsproj manually and pasted @denis-golubev 's xml and it worked. It compiles and runs, but under debugger it just fails first time:

1>Target "BeforeBuild" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\VisualRust\VisualRust.Core.targets":
1>Done building target "BeforeBuild" in project "hello_world.rsproj".
1>Target "BeforeCompile" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\VisualRust\VisualRust.Core.targets":
1>Done building target "BeforeCompile" in project "hello_world.rsproj".
1>Target "CoreCompile" in file "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\VisualRust\VisualRust.Rust.targets":
1>  Using "CargoBuild" task from assembly "C:\Program Files (x86)\Microsoft Visual Studio\2017\Community\MSBuild\VisualRust\\VisualRust.Build.dll".
1>  Task "CargoBuild"
1>    Task Parameter:ManifestPath=Cargo.toml
1>    Task Parameter:Release=False
1>    Running cargo in directory D:\Rust\hello_world
1>    C:\Users\Alex\.cargo\bin\cargo.exe build --message-format json
1>    MSBUILD : error MSB4166: Child node "2" exited prematurely. Shutting down. Diagnostic information may be found in files in the temporary files directory named MSBuild_*.failure.txt.
========== Build: 0 succeeded or up-to-date, 1 failed, 0 skipped ==========

But starts debug successfully if you run it again.

And autocomplete is not working (perhaps I didn't install something? But I ran rustup component add rust-src).

image

@werdahias
Copy link

Using this fix Autocompletion feature works, but building still crashes.

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

6 participants