visual-studionugetgitversion

How to interact with GitVersion init in Visual Studio Package Manager Console


When using GitVersion you interact by using gitversion init to access the executable available via NuGet.

However it looks like the package manager console does not register keypresses when running a command. The navigation works by numbers (eg: 2) Run wizard)

How do you interact with the number menu gitversion init in Visual Studio 2022??


Solution

  • When using the Package Manager Console in Visual Studio, certain interactive console applications might not behave as expected due to the limitations of the console. The Package Manager Console is designed primarily for NuGet operations and PowerShell scripts, so it doesn't handle interactive applications in the same way a standard terminal or command prompt would.

    I think what you need is terminal window:

    enter image description here

    It can achieve your requirement:

    enter image description here

    Notice: You need to add the tool path to the system environment variable, after that, you will be able to use the tool in the terminal window.

    I create a folder named 'gitversion_test' in 'C:\Users\Administrator.nuget\packages', so the path is 'C:\Users\Administrator.nuget\packages\gitversion_test', and then extract package content to this path(download the package here, and rename it to xxx.zip, after that you could extract the content).

    After the above step, configure path to system environment variable:

    enter image description here

    Detailed configuration steps please refer to this:

    How to properly decompile c# dlls for debugging with Visual Studio 2022 and .net 4.8

    You need to close VS and then reopen it, then the new VS instance could be able to use the tool in terminal.