Overview
gmStudio integrates with .NET SDK tools and Visual Studio (VS) to make it convenient to do build testing and open translation results in the VS IDE. 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 projectsHowever, sometimes the VS Version used when creating new projects. Sometimes support for the latest VS version lags behind what is implemented in the gmStudio user interface.
The VS version to use for your gmStudio project is specified in the DevEnv element in the gmProj file:
...
In that situation, you can manually configure gmStudio to use that VS version according..
There are two points of integration between gmStudio with Visual StudioVS:
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.Setting the operating environment before running the VS (devenv.exe) when you open the VS IDE do a build with MSBuild (e.g. running the appropriate vsvars32.bat or VsDevCmd.bat)
2) Setting version specific content when authoring .NET project files (e.g. Framework Version)
The details of the first integration are handled by a the Template command script: SetEnv.cmd. The details of the second integration are handled by a gmSl script, authorTextAuthorText.gmsl. Both of these files may be made project-specific and modified to use an alternate version of Visual Studio.
Modifying the gmStudio project file
The VS version used by your gmStudio project is specified in the DevEnv element in the gmProj file:
Code Block | ||
---|---|---|
| ||
<gmStudio>
<Name>Calculator_csh</Name>
<MigType>VBP</MigType>
<DevEnv>VS2022</DevEnv> <-- set a name for the desired VS Version here
<ProjFolder>C:\gmTestBed\Calculator\proj_csh</ProjFolder>
...
</gmStudio> |
Modifying SetEnv.cmd for VS2022
SetEnv is used to to set the environment for command line operations and for launching DevEnv. Over the years, Microsoft has used different conventions over the years for setting up the command line operating environment, so it takes some wrangling to support all the different versions and there are many ways to deal with it. You that may be installed on a machine. gmStudio ships with a Template command script, SetEnv.cmd, that sets the environment for command line build operations and for launching the VS IDE. You may modify this file to support a version of VS not offered by the gmStudio IDE. This begins by copying The first step is to Activate a project-specific copy of the default file from the installation folder to in your project workspace. The Setting form You can help you do this . from the Settings form. Next you modify the project-specific file to find and and execute the desired VS environment setup script (vsvars.bat or VSDevCmd.bat).
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)" folder and that detail must be considered when selecting an environment setup script for the desired VS. Note that the script also handles choosing the VS product tier (Community, Professional, or Enterprise).
Info | ||
---|---|---|
| ||
The SetEnv file may also be used to select MSBuild tools installed with the .NET SDK tools for command line builds. The VS IDE integration can be altered as well. In fact,. all external tools used by gmStudio may be configured in the Application Configuration File (gmStudio.cfg). Contact Great Migrations if you want help with using gmStudio with alternative tools. |
Modifying AuthorText.gmsl for VS2022
AuthorText.gmsl handles writing VS project files, assemblyInfo AssemblyInfo files, and various other .NET platform translation 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 AuthorText includes logic to set details of the project file based on the VS Version specified in your gmProj files. You may modify a project-specific copy of AuthorText.gms to support a version of VS not offered by in the gmStudio IDE. AuthorText is part of the System Translation Configuration. TThe following changes were made in AuthorText.gmsl to support VS2022:
The process for using a modified
AuthorText.gmsl is part of the System Translation Configuration. The process for customizing the System Translation Configuration is described in this article on Custom VB6 Language Replacement.
Once these changes are made, gmStudio will integrate with VS2022. Compared to VS2019, the difference from you will see is the VS2022 opens when you launch the VS IDE, the MSBuild installed with VS2022 will be used for build operations, and the .NET projects will specify FrameworkVersion=v4.8.