Skip to content

Instantly share code, notes, and snippets.

@jonpryor
Created Sep 10, 2021
Embed
What would you like to do?
% 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