{"action":"created","issue":{"url":"https://api.github.com/repos/Microsoft/msbuild/issues/3212","repository_url":"https://api.github.com/repos/Microsoft/msbuild","labels_url":"https://api.github.com/repos/Microsoft/msbuild/issues/3212/labels{/name}","comments_url":"https://api.github.com/repos/Microsoft/msbuild/issues/3212/comments","events_url":"https://api.github.com/repos/Microsoft/msbuild/issues/3212/events","html_url":"https://github.com/Microsoft/msbuild/issues/3212","id":316058574,"number":3212,"title":"Need a performace and unified way to compare versions","user":{"login":"wli3","id":6993335,"avatar_url":"https://avatars1.githubusercontent.com/u/6993335?v=4","gravatar_id":"","url":"https://api.github.com/users/wli3","html_url":"https://github.com/wli3","followers_url":"https://api.github.com/users/wli3/followers","following_url":"https://api.github.com/users/wli3/following{/other_user}","gists_url":"https://api.github.com/users/wli3/gists{/gist_id}","starred_url":"https://api.github.com/users/wli3/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/wli3/subscriptions","organizations_url":"https://api.github.com/users/wli3/orgs","repos_url":"https://api.github.com/users/wli3/repos","events_url":"https://api.github.com/users/wli3/events{/privacy}","received_events_url":"https://api.github.com/users/wli3/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":10,"created_at":"2018-04-19T22:09:48Z","updated_at":"2018-04-19T22:30:59Z","closed_at":null,"author_association":"NONE","body":"In msbuild condition. msbuild build will try to [parse it as dec or hex ]( https://github.com/Microsoft/msbuild/blob/e8b480c373eadd9daa975c6e96e4dbbabcd9a4fe/src/Build/Evaluation/Conditionals/NumericComparisonExpressionNode.cs#L44)first. So _2.11_ will be smaller than _2.2_.\r\n\r\n```xml\r\n<Project ToolsVersion=\"15.0\" DefaultTargets=\"Try\">\r\n  <Target Name=\"Try\">\r\n   <Error Condition=\" '2.11' &lt; 2.2 \"\r\n           Text='unexpected' />\r\n  </Target>\r\n</Project>\r\n```\r\n\r\nAt the same time. If appending 0 at the end as in _2.2.0_, it will cause parse as number fail and consider it as Version. However, Version class's comparison does not consider _2.1_ and _2.1.0_ to be equal.[ In fact ](\r\nhttps://msdn.microsoft.com/en-us/library/s3bf0xb2(v=vs.110).aspx)_2.1 < 2.1.0_. This will also occur in Property Function. \r\n\r\n```xml\r\n<Project ToolsVersion=\"15.0\" DefaultTargets=\"Try\">\r\n  <Target Name=\"Try\">\r\n   <Error Condition=\" '2.1' &lt; 2.1.0 \"\r\n           Text='unexpected' />\r\n  </Target>\r\n</Project>\r\n```\r\n\r\nIt is different behavior of [NuGet version](https://docs.microsoft.com/en-us/nuget/reference/package-versioning).\r\n\r\n\r\n\r\nAlso there is performance concern.\r\n"},"comment":{"url":"https://api.github.com/repos/Microsoft/msbuild/issues/comments/382900601","html_url":"https://github.com/Microsoft/msbuild/issues/3212#issuecomment-382900601","issue_url":"https://api.github.com/repos/Microsoft/msbuild/issues/3212","id":382900601,"user":{"login":"nguerrera","id":75470,"avatar_url":"https://avatars0.githubusercontent.com/u/75470?v=4","gravatar_id":"","url":"https://api.github.com/users/nguerrera","html_url":"https://github.com/nguerrera","followers_url":"https://api.github.com/users/nguerrera/followers","following_url":"https://api.github.com/users/nguerrera/following{/other_user}","gists_url":"https://api.github.com/users/nguerrera/gists{/gist_id}","starred_url":"https://api.github.com/users/nguerrera/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nguerrera/subscriptions","organizations_url":"https://api.github.com/users/nguerrera/orgs","repos_url":"https://api.github.com/users/nguerrera/repos","events_url":"https://api.github.com/users/nguerrera/events{/privacy}","received_events_url":"https://api.github.com/users/nguerrera/received_events","type":"User","site_admin":false},"created_at":"2018-04-19T22:30:59Z","updated_at":"2018-04-19T22:30:59Z","author_association":"MEMBER","body":"Somewhat separate, but we would also like there to be a way to compare semantic/nuget versions. We set $(NETCoreSdkVersion) currently based on that and we would like customers to be able to reason about it with minimum versions. Currently, Roslyn has code that is enforcing it as an exact version, and I'd like to get them to change it to a min version, but it occurs to me that I don't know how to write that."}}
{"actor":{"display_login":"nguerrera"}}