Skip to content

The expression "[MSBuild]::VersionGreaterThanOrEquals('', 9.0)" cannot be evaluated. Version string was not in a correct format on old C++ project #11302

@HO-COOH

Description

@HO-COOH

Issue Description

I am looking into this sample project provided by Microsoft, and got this error when I try to build it

Steps to Reproduce

  1. Clone https://github.com/microsoftarchive/msdn-code-gallery-microsoft
  2. cd into Official Windows Platform Sample/Direct2D basic image effects sample/[C++]-Direct2D basic image effects sample/C++
  3. Build the project either with visual studio 2022, or msbuild from native x64 tool command prompt

Expected Behavior

Builds fine.

Actual Behavior

D:\[C++]-Direct2D basic image effects sample\C++>msbuild
MSBuild version 17.12.12+1cce77968 for .NET Framework
Build started 1/20/2025 1:06:16 AM.

Project "D:\[C++]-Direct2D basic image effects sample\C++\D2DEffectsHelloWorld.sln" on n
ode 1 (default targets).
ValidateSolutionConfiguration:
  Building solution configuration "Debug|Win32".
Project "D:\[C++]-Direct2D basic image effects sample\C++\D2DEffectsHelloWorld.sln" (1)
is building "D:\[C++]-Direct2D basic image effects sample\C++\D2DEffectsHelloWorld.vcxpr
oj" (2) on node 1 (default targets).
C:\Program Files\Microsoft Visual Studio\2022\Community\MSBuild\Microsoft\VisualStudio\v
17.0\AppxPackage\Microsoft.AppXPackage.Targets(225,25): error MSB4184: The expression "[
MSBuild]::VersionGreaterThanOrEquals('', 9.0)" cannot be evaluated. Version string was n
ot in a correct format. [D:\[C++]-Direct2D basic image effects sample\C++\D2DEffectsHell
oWorld.vcxproj]
Done Building Project "D:\[C++]-Direct2D basic image effects sample\C++\D2DEffectsHelloW
orld.vcxproj" (default targets) -- FAILED.

Analysis

No response

Versions & Configurations

No response

Metadata

Metadata

Assignees

Labels

Type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions