You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We have added our private GitHub Enterprise repository and its ApiKey to Assets/NuGet.config.
We have no issues restoring from a private repository in Unity itself.
However, when we try to restore the package using the CLI we get the following error:
Unable to retrieve package from http://www.nuget.org/api/v2/Packages(Id='Private.Package',Version='1.0.0')
System.Net.WebException: The remote server returned an error: (404) Not Found.
at System.Net.HttpWebRequest.GetResponse()
at NugetForUnity.Helper.WebRequestHelper.RequestUrl(String url, String userName, String password, Nullable`1 timeOut) in /_/src/NuGetForUnity/Editor/Helper/WebRequestHelper.cs:line 57
at NugetForUnity.PackageSource.NugetPackageSourceV2.GetPackagesFromUrl(String url) in /_/src/NuGetForUnity/Editor/PackageSource/NugetPackageSourceV2.cs:line 465
at NugetForUnity.PackageSource.NugetPackageSourceV2.GetSpecificPackage(INugetPackageIdentifier package) in /_/src/NuGetForUnity/Editor/PackageSource/NugetPackageSourceV2.cs:line 187
This seems to indicate that it is trying to use the default source, and is not looking at the NuGet.config.
Hi @jbvirt
Thanks for creating the issue.
Seems strange, are you running the Command from the correct location or specified the correct project path. The error shows that it uses the V2 API witch is not the default, so there need to be a NuGet.config file that is used instead of the one with your own config.
If could also relate to not using the latest version of the CLI.
We use the command nugetforunity restore ".".
This command worked perfectly fine before we added the private NuGet package.
The CLI version is the latest, version 4.1.1.
However, updating to the V3 API solved the issue.
Feel free to close this issue, or leave it open and investigate the V2 API behavior.
Description
We have added our private GitHub Enterprise repository and its ApiKey to
Assets/NuGet.config
.We have no issues restoring from a private repository in Unity itself.
However, when we try to restore the package using the CLI we get the following error:
This seems to indicate that it is trying to use the default source, and is not looking at the
NuGet.config
.12574c32f658fa23c194357141abc3fc157ea362
CLI version 4.1.1mcr.microsoft.com/dotnet/sdk:8.0
container. So Ubuntu.Also, there is a typo in your issue template. (
enabeling
when it should beenabling
)The text was updated successfully, but these errors were encountered: