Notes on VS 2022 - KineticTheory/Linux-HPC-Env GitHub Wiki

Install VS2022

  • Hacks:
    • I had an issue where VsDevCmd.bat was printing a lot of Debug info to the screen and this caused VS to report failed builds. To fix this, I edited these two files
      • C:\Program Files\Microsoft Visual Studio\2022\[Preview|Community|Professional]\VC\Auxiliary\Build\vcvarsall.bat
@REM Parse command line arguments.  This implementation does not care about
@REM argument order.
+if "%VSCMD_DEBUG%" GEQ "1" (
+    @echo [DEBUG:%~nx0] VSCMD_DEBUG = %VSCMD_DEBUG%. Reset to 0.
+)
+@set VSCMD_DEBUG=0
if "%VSCMD_DEBUG%" GEQ "1" (
    @echo [DEBUG:%~nx0] init with arguments '%*'
)
  • C:\Program Files\Microsoft Visual Studio\2022\[Preview|Community|Professional]\Common7\Tools\VsDevCmd.bat
+@set VSCMD_SKIP_SENDTELEMETRY=0

@if NOT "%VSCMD_DEBUG%" GEQ "3" @echo off

@REM If in debug mode, we want to log the environment variable state
@REM prior to VSDevCmd.bat being executed. This is disabled by default
@REM and is enabled by setting [VSCMD_DEBUG] to some value.
-if "%VSCMD_DEBUG%" NEQ "" (
+if "%VSCMD_DEBUG%" NEQ "0" (
        @echo [DEBUG:%~n0] Writing pre-initialization environment to %temp%\dd_vsdevcmd16_preinit_env.log
        set > %temp%\dd_vsdevcmd16_preinit_env.log
)

@REM Dump the pre-initialization environment if debug level is 2 or greater (detailed or full trace).
---
@REM is disabled by default and will only be enabled by setting of [VSCMD_DEBUG]
@REM in the environment
-if "%VSCMD_DEBUG%" NEQ "" (
+if "%VSCMD_DEBUG%" NEQ "0" (
    @echo [DEBUG:%~n0] Writing post-execution environment to %temp%\dd_vsdevcmd16_env.log
    set > "%temp%\dd_vsdevcmd16_env.log"
)