EF-Migrations-Script-Generator-Task icon indicating copy to clipboard operation
EF-Migrations-Script-Generator-Task copied to clipboard

Installing version undefined of dotnet-ef as global tool.

Open jaltenbernd opened this issue 3 years ago • 1 comments

I've been using this nice tool for a year and it has worked fine. But, last Friday it broke on every single pipeline and still can't get it to work. What changed? Getting this error:

Starting: Generate Migration Scripts
Task : Entity Framework Core Migrations Script Generator
Description : Tool for projects that use Entity Framework Core Code-First. Generates migration scripts which can be used to update a database (for instance with the task ‘Azure SQL Database Deployment’).
Version : 1.0.2
Author : PEK’s Productions
Help : [More Information](https://github.com/pekspro/EF-Migrations-Script-Generator-Task)
Project path: D:\a\1\s\DLR.k12PlanningTool.Data
Start-up project path: D:\a\1\s\DLR.k12PlanningTool.UI
Target folder: D:\a\1\a/migrations
Number of database contexts: 1
All migrations will be used.
Checking of dotnet-ef is installed.
“C:\Program Files\dotnet\dotnet.exe” tool list --global
Package Id Version Commands
nbgv 3.4.255 nbgv
Parsing output: "Package Id Version Commands
nbgv 3.4.255 nbgv
"
Installing version undefined of dotnet-ef as global tool.
Will use NuGet configuration file: D:\a\1\s\nuget.config
“C:\Program Files\dotnet\dotnet.exe” tool install --global dotnet-ef --configfile D:\a\1\s\nuget.config
C:\Program Files\dotnet\sdk\6.0.201\NuGet.targets(130,5): error : Failed to retrieve information about ‘dotnet-ef’ from remote source ‘https://pkgs.dev.azure.com/dlrgroupdevops/f5a818e9-e793-450c-8e53-531c8c5623cd/_packaging/d9e143aa-e075-4ada-92b1-cddd6ccf16a0/nuget/v3/flat2/dotnet-ef/index.json’. [C:\Users\VssAdministrator\AppData\Local\Temp\fu3wdffo.stt\restore.csproj]
C:\Program Files\dotnet\sdk\6.0.201\NuGet.targets(130,5): error : Response status code does not indicate success: 401 (Unauthorized). [C:\Users\VssAdministrator\AppData\Local\Temp\fu3wdffo.stt\restore.csproj]
The tool package could not be restored.
Tool ‘dotnet-ef’ failed to install. This failure may have been caused by:

You are attempting to install a preview release and did not use the --version option to specify the version.
A package by this name was found, but it was not a .NET tool.
The required NuGet feed cannot be accessed, perhaps because of an Internet connection problem.
You mistyped the name of the tool.
For more reasons, including package naming enforcement, visit https://aka.ms/failure-installing-tool
##[error]The process ‘C:\Program Files\dotnet\dotnet.exe’ failed with exit code 1
Finishing: Generate Migration Scripts
[Screen Shot 2022-03-22 at 11.01.34 AM.png](https://aka.ms/dc/file?name=B25ae712cdcd3493cb4aa6da729325869637835617721111721_Screen_Shot_2022-03-22_at_11.01.34_AM.png&tid=25ae712cdcd3493cb4aa6da729325869637835617721111721)

jaltenbernd avatar Mar 28 '22 15:03 jaltenbernd

Sorry for the late reply.

I used this tool myself last week and haven't had any issues. My guess is that you have some issue reaching the NuGet source. My advice is that you try to install the tool manually earlier in the process. It would be interesting if you run one of these commands to see if there is a difference:

dotnet tool install -g --ignore-failed-sources dotnet-ef

dotnet tool install -g --add-source 'https://api.nuget.org/v3/index.json' --ignore-failed-sources dotnet-ef

Maybe you also find more inspiration here https://docs.microsoft.com/en-us/dotnet/core/tools/troubleshoot-usage-issues#nuget-feed-cant-be-accessed

pekspro avatar Mar 31 '22 17:03 pekspro