Skip to content

Instantly share code, notes, and snippets.

@jonpryor
Created September 10, 2021 20:20
Show Gist options
  • Save jonpryor/5d4a58216f8e7e7e49f52651d9bb018b to your computer and use it in GitHub Desktop.
Save jonpryor/5d4a58216f8e7e7e49f52651d9bb018b to your computer and use it in GitHub Desktop.
% msbuild /nologo /v:m /t:Foo x.targets
IsValid=
<Project>
<PropertyGroup>
<InvalidVersion>1.2.3a4</InvalidVersion>
<IsValid Condition="$([System.Version]::TryParse(
'$(InvalidVersion)',
$([System.Version]::Parse('1.2.3.4'))
))">True</IsValid>
</PropertyGroup>
<Target Name="Foo">
<Message Text="IsValid=$(IsValid)" Importance="High" />
</Target>
</Project>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment