Overview
gmStudio detects the installed Visual Studio (VS) versions and allows you to select one of them for your projects. There is also a default VS Version setting for each user that set the default when you create new projects
However, sometimes support for the latest VS version lags behind what is implemented in gmStudio.
The VS version to use for your gmStudio project is specified in the DevEnv element in the gmProj file:
<gmStudio> <Name>Calculator_csh</Name> <MigType>VBP</MigType> <DevEnv>VS2019</DevEnv> <-- here <ProjFolder>C:\gmTestBed\Calculator\proj_csh</ProjFolder> ... </gmStudio>
There are two points of integration between gmStudio with Visual Studio:
1) Running the correct version of DevEnv and MSBuild when you want to open a project or solution in the IDE, and running the correct version of MSBuild when you want to run a build
2) Authoring VS project files with the correct ToolsVersion and FrameworkVersion.
The details of the first integration are handled by a command script: SetEnv.cmd. The details of the second integration are handled by a gmSl script, authorText.gmsl.
Modifying SetEnv.cmd for VS2022
SetEnv is used to to set the environment for command line operations and for launching DevEnv. Microsoft has used different conventions over the years so it takes some wrangling to support different versions and there are many ways to deal with it. You may modify this file to support a version of VS not offered by the gmStudio IDE. This begins by copying the default file from the installation folder to your project workspace. The Setting form can help you do this.
For VS2022, the following changes were made. Note, VS2022 has finally made it into the 64-bit Program Files folder, rather than "Program Files(x86)".
Modifying AuthorText.gmsl for VS2022
AuthorText.gmsl handles writing VS project files, assemblyInfo files, and various other .NET platform content not generated from legacy code. The VS version impacts a few details in the project file set through simple lookups in the gmSL code. You may modify this file to support a version of VS not offered by the gmStudio IDE. AuthorText is part of the System Translation Configuration. The following changes were made in AuthorText.gmsl to support VS2022:
The process for using a modified AuthorText.gmsl is described in this article on Custom VB6 Language Replacement.