AArnott / Library.Template

A template for a NuGet package with tests, stylecop, fxcop, versioning, and Azure Pipelines build ready to go.
MIT License
131 stars 26 forks source link

Install-DotNet script out of date #74

Closed jepetty closed 4 years ago

jepetty commented 4 years ago

I don't know what happened, but it just bit us today that the install URI https://dotnetcli.blob.core.windows.net/dotnet/$sdkOrRuntime/$Version/dotnet-$($sdkOrRuntime.ToLowerInvariant())-$Version-win-x64.exe no longer exists (i.e. https://dotnetcli.blob.core.windows.net/dotnet/sdk/3.1.402/dotnet-sdk-3.1.402-win-x64.exe returns 404).

I'm updating us to use https://dot.net/v1/dotnet-install.ps1, but you may want to update your template as well :)

AArnott commented 4 years ago

We use that script too:

https://github.com/AArnott/Library.Template/blob/41d2e5533ffdacbb6abf9555860bead64cbcd1ea/tools/Install-DotNetSdk.ps1#L140

We have a lot of repos that use this script and yours is the only failure I've heard. I just queued another build of this repo and it succeeds. So I wonder if the repo where you saw the failure had an outdated version of the script that we already had a fix for in this repo. Wanna try copying the latest from this repo into yours to see if it works for you?

jepetty commented 4 years ago

You were right, thanks. I don't know what update allowed my build to avoid this line but updating it did resolve my problem. Closing as not a bug. Thanks for your help!

jepetty commented 4 years ago

FYI this actually wasn't resolved for us in all cases by switching to the updated version of the script (see bug). It looks like this only affects repositories that set the DOTNET_ROOT (possibly by not using the UseDotNet task, though I haven't verified that it works in those pipelines)