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

Add "-vsi" parameter to Generate-R4MVC command #145

Open
gpattersonclearwave opened this issue Apr 2, 2020 · 3 comments
Open

Add "-vsi" parameter to Generate-R4MVC command #145

gpattersonclearwave opened this issue Apr 2, 2020 · 3 comments

Comments

@gpattersonclearwave
Copy link

I have multiple instances of VS installed (2017, 2019) and I am experiencing the same issue as described in #132 and it looks like the resolution is to specify the visual studio instance being used by the underlying application with the -vsi parameter. The PowerShell wrapper command Generate-R4MVC does not expose a parameter to pass this through. This forces me to do some jumping around to get the tool to generate files correctly for my .Net Core 3 projects. Please add an optional pass-through for this parameter, defaulting to the current behavior when nothing is specified.

@gpattersonclearwave
Copy link
Author

Accidentally clicked on the close button, sorry. Reopening.

@gpattersonclearwave
Copy link
Author

I wanted to share my workaround build target for anyone else who stumbles on this.

  1. Add GeneratePathProperty="true" to the R4Mvc.Tools package reference
  2. Get the list of instances by running R4Mvc.Tools.exe vsinstances, then append the build task to your csproj:
<Target Name="GenerateR4Mvc" BeforeTargets="Build">
    <PropertyGroup>
      <R4MvcToolsExe>$(PkgR4Mvc_Tools)\tools\R4Mvc.Tools.exe</R4MvcToolsExe>
    </PropertyGroup>
    <Message Text="Running R4Mvc" Importance="high" />
    <Exec Command="$(R4MvcToolsExe) generate -p &quot;$(ProjectPath)&quot; -vsi 2" />
  </Target>

@valeriob
Copy link
Contributor

valeriob commented Nov 3, 2022

+1 to this, is very much needed with the fragmentation of dotnet versions.

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

No branches or pull requests

2 participants