0

I recently upgraded a Visual Studio 2013 Solution with C++ Libraries in it to Visual Studio 2022. Everything went great except there were three major environment variables not set.

The error:

Error   MSB4044 The "SetEnv" task was not given a value for the required parameter "Value". testproject C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VC\v170\Microsoft.Cpp.DesignTime.targets  550

Because environment variables VSTEL_SolutionSessionID, VSTEL_CurrentSolutionBuildID, and ProjectGuid were not set. In a fresh solution they are, but I cannot find them defined in either the solution or the project of a new console test solution. They appear to be telemetry variables and I do not know why they are missing. Defining these variables in the system environment variables all as -1 allows the upgraded project to complete, but the root cause is unknown.

What mechanism should these variables be set with normally and what can I look for to set them?

Occurred in in the targets file:

 <Target Name="SetTelemetryEnvironmentVariables"
          Condition="'$(DesignTimeBuild)' != 'true'">

    <SetEnv Name   ="VSTEL_SolutionSessionID"
            Value  ="$(VSTEL_SolutionSessionID)"
            Prefix ="false">
    </SetEnv>
    <SetEnv Name   ="VSTEL_CurrentSolutionBuildID"
            Value  ="$(VSTEL_CurrentSolutionBuildID)"
            Prefix ="false">
    </SetEnv>
    <SetEnv Name   ="VSTEL_ProjectID"
            Value  ="$(ProjectGuid)"
            Prefix ="false">
      <Output TaskParameter="OutputEnvironmentVariable" PropertyName="VSTEL_ProjectID"/>
    </SetEnv>
  </Target>
Steve
  • 3,957
  • 2
  • 26
  • 50
  • What did you do to upgrade the solution to VS2022? I haven't found a clear answer about these variables not being set. I think it's because the version of VS2013 is too old, these variables don't apply to VS2013. – Jingmiao Xu-MSFT Sep 01 '22 at 08:10
  • @JingmiaoXu-MSFT At first just opened the project and updated parameters in VS2022 to use the newer runtime and features. I noted that didn't updated the solution file version indicated in the first 3 lines, so I manually updated those. Other sections don't appear to change. I agree on the too old part.. but I don't see where those variables are set in the new version so I confused how they are being copied in. – Steve Sep 01 '22 at 16:13

0 Answers0