llypb
llypb

Reputation: 71

Versioning information could not be retrieved from the NuGet package repository

In visual studio code (Mac), the Nuget Package extension does not work. I want to know if there is a way I can modify the "get package url api".

Mac, vscode

Upvotes: 6

Views: 12519

Answers (4)

Jibril
Jibril

Reputation: 21

What worked for me was simply navigating to the directory containing the Program.cs file, and running the NuGet installation package command.

Upvotes: 0

Pavel
Pavel

Reputation: 31

You can also add the Package with the dotnet add command:

dotnet add package System.Text.Json

(Obviously I asume you have dotnet working ! Or download here)

Upvotes: 2

petemyron
petemyron

Reputation: 796

for windows, the path is something like C:\Users\[user]\.vscode\extensions\jmrog.vscode-nuget-package-manager-1.1.6\out\src\actions\add-methods\fetchPackageVersions.js and the change is on line 15 (version 6.0.10),

original:

node_fetch_1.default(`${versionsUrl}${selectedPackageName}/index.json`, utils_1.getFetchOptions(vscode.workspace.getConfiguration('http')))

updated:

node_fetch_1.default(`${versionsUrl}${selectedPackageName.toLowerCase()}/index.json`, utils_1.getFetchOptions(vscode.workspace.getConfiguration('http')))

Upvotes: 22

zhangzhen
zhangzhen

Reputation: 181

Go to the following location in your file directory using cd command and modify the js file:

cd /Users/UserName/.vscode/extensions/jmrog.vscode-nuget-package-manager-1.1.6/out/src/actions/add-methods/fetchPackageVersions.js

Add the toLowerCase() method to the selectedPackageName and then restart the VS Code.

Upvotes: 18

Related Questions