← 输入框|github.com|刷新
Skip to content

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

Open

Description

@ioncodes

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.

Activity

  1. werdahias commented on May 31, 2017

    @werdahias

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

  2. Boddlnagg commented on May 31, 2017

    @Boddlnagg
    Contributor

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

  3. ioncodes commented on May 31, 2017

    @ioncodes
    ContributorAuthor

    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.

  4. denis-golubev commented on May 31, 2017

    @denis-golubev

    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.

  5. werdahias commented on May 31, 2017

    @werdahias

    seems to work

  6. ioncodes commented on May 31, 2017

    @ioncodes
    ContributorAuthor

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

  7. werdahias commented on May 31, 2017

    @werdahias

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

  8. werdahias commented on May 31, 2017

    @werdahias

    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.

  9. ioncodes commented on Jun 1, 2017

    @ioncodes
    ContributorAuthor

    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.

  10. werdahias commented on Jun 1, 2017

    @werdahias

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

  11. werdahias commented on Jun 1, 2017

    @werdahias

    Biuld configurations cant be edited, too.

  12. werdahias commented on Jun 1, 2017

    @werdahias

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

  13. werdahias commented on Jun 1, 2017

    @werdahias

    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

  14. werdahias commented on Jun 2, 2017

    @werdahias

    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.

  15. werdahias commented on Jun 2, 2017

    @werdahias

    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

  16. MaulingMonkey commented on Jul 1, 2017

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

  17. MaulingMonkey commented on Jul 1, 2017

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

  18. added this to the 0.2 milestone on Sep 20, 2017
  19. changed the title [-]Installed. And Now?[/-] [+]Missing VisualRust Project/Item Templates. (Originally: Installed. And Now?)[/+] on Sep 20, 2017
  20. Pzixel commented on Oct 7, 2017

    @Pzixel

    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

  21. werdahias commented on Oct 7, 2017

    @werdahias

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

  22. removed their assignment
    on Jul 25, 2019
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