Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Install dotnet-script fail #746

Open
anw194rb opened this issue Nov 17, 2023 · 2 comments
Open

Install dotnet-script fail #746

anw194rb opened this issue Nov 17, 2023 · 2 comments

Comments

@anw194rb
Copy link

Hi all,

I have a pipeline YAML that is attempting to install dotnet-script, but it fails. My YAML for this is:

steps:
- task: UseDotNet@2
  displayName: 'Use .NET 6'
  inputs:
    version: 6.x

- task: DotNetCoreCLI@2
  displayName: 'Prepare Phrase SAAS'
  inputs:
    command: 'custom'
    custom: 'tool'
    arguments: 'update --global dotnet-script'
    includeNugetOrg: true

But I get the following error from Azure...


Tool 'dotnet-script' failed to update due to the following:
The tool package could not be restored.
Tool 'dotnet-script' failed to install. This failure may have been caused by: ...

I'm new to Azure pipelines, first time, so any help appreciated!

@filipw
Copy link
Member

filipw commented Nov 17, 2023

if it's an install, should you not be calling dotnet tool install instead of update?

@anw194rb
Copy link
Author

Possibly, I'd read that 'update' will do both, but 'install' would fail if already present, so tried it out. I also moved the nuget restore to before the script call and it gets past this (also added the ignore-failed-sources toggle).

steps:
- task: UseDotNet@2
  displayName: 'Use .NET 6'
  inputs:
    version: '6.x'

- task: NuGetToolInstaller@1
   
- task: NuGetCommand@2
  displayName: 'Restore Packages'
  inputs:
    restoreSolution: '$(solution)'
    feedsToUse: config
    nugetConfigPath: NuGet.config
    includeNugetOrg: true

- task: DotNetCoreCLI@2
  displayName: 'Prepare Phrase SAAS'
  inputs:
    command: 'custom'
    custom: 'tool'
    arguments: 'install --global dotnet-script --ignore-failed-sources'

Still get an issue later, when it gets to the actual build, but this change managed to fix my original problem.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants