Skip to content

Fix version comparison for dotnet tool install - #22684

Merged
joeloff merged 2 commits into
dotnet:release/6.0.2xxfrom
joeloff:toolinstall
Nov 23, 2021
Merged

joeloff merged 2 commits into
dotnet:release/6.0.2xxfrom
joeloff:toolinstall

Conversation

@joeloff

@joeloff joeloff commented Nov 19, 2021

Copy link
Copy Markdown
Member

.version file can contain semantic versions causing Version.Parse to throw an exception. Since we're only comparing against the package framework versions, we'll parse and then discard the semantic elements.

@ghost ghost added the Area-Workloads label Nov 19, 2021
@joeloff
joeloff requested a review from sfoslund November 19, 2021 00:38

@sfoslund sfoslund left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but can we add any tests?

@joeloff

joeloff commented Nov 19, 2021

Copy link
Copy Markdown
Member Author

LGTM, but can we add any tests?

I've been thinking about it. It seems none of the tests we have today cover that path because it relies on the .version file of the installed SDK. I'll see if we can add anything

@joeloff

joeloff commented Nov 22, 2021

Copy link
Copy Markdown
Member Author

@sfoslund I added a unit test (the change looks wors since I Ctrl-K+D, R+G the test code).

@sfoslund sfoslund left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Test looks good to me!

@joeloff

joeloff commented Nov 23, 2021

Copy link
Copy Markdown
Member Author

@sfoslund I'm resetting to before trying to add tests. It appears that we had code in the test project for generating the .version file, but that got removed/commented out. It seems that once we generate the file, it breaks a number of msbuild tests and without it we can't test this fix. I'll follow up with Daniel to figure this out, but I need to unblock ASP.NET

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants