'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



Solution 1:[1]

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.

Solution 2:[2]

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')))

Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source
Solution 1 janw
Solution 2 petemyron