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

deprecated api version? #380

Closed
ludos1978 opened this issue Mar 16, 2021 · 9 comments
Closed

deprecated api version? #380

ludos1978 opened this issue Mar 16, 2021 · 9 comments

Comments

@ludos1978
Copy link

Description

I'm encountering and error when installing a package. Other packages work. The package i am trying to install causes a nuget server response that it's using a deprecated api.

--- ERRORMESSAGE #1 ---
Unable to retrieve package list from http://www.nuget.org/api/v2/FindPackagesById()?id='SharpDX.DXGI'&$orderby=Version asc
System.Net.WebException: The remote server returned an error: (400) Bad Request.
at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x00058] in :0
at System.Net.HttpWebRequest.GetResponse () [0x0000e] in :0
at NugetForUnity.NugetHelper.RequestUrl (System.String url, System.String userName, System.String password, System.Nullable1[T] timeOut) [0x000b9] in <ebb7710be32040ba9a0cb144ce2a8967>:0 at NugetForUnity.NugetPackageSource.GetPackagesFromUrl (System.String url, System.String username, System.String password) [0x0006c] in <ebb7710be32040ba9a0cb144ce2a8967>:0 at NugetForUnity.NugetPackageSource.FindPackagesById (NugetForUnity.NugetPackageIdentifier package) [0x000ee] in <ebb7710be32040ba9a0cb144ce2a8967>:0 UnityEngine.Debug:LogErrorFormat(String, Object[]) NugetForUnity.NugetPackageSource:FindPackagesById(NugetPackageIdentifier) NugetForUnity.NugetPackageSource:GetSpecificPackage(NugetPackageIdentifier) NugetForUnity.NugetHelper:GetOnlinePackage(NugetPackageIdentifier) NugetForUnity.NugetHelper:GetSpecificPackage(NugetPackageIdentifier) NugetForUnity.NugetHelper:InstallIdentifier(NugetPackageIdentifier, Boolean) NugetForUnity.NugetHelper:Install(NugetPackage, Boolean) NugetForUnity.NugetHelper:InstallIdentifier(NugetPackageIdentifier, Boolean) NugetForUnity.NugetWindow:DrawPackage(NugetPackage, GUIStyle, GUIStyle) NugetForUnity.NugetWindow:DrawPackages(List1)
NugetForUnity.NugetWindow:DrawOnline()
NugetForUnity.NugetWindow:OnGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--- END ERRORMESSAGE 1 ---

--- ERRORMESSAGE 2 ---
Could not find SharpDX.DXGI [4.2.0, ) or greater.
UnityEngine.Debug:LogErrorFormat(String, Object[])
NugetForUnity.NugetHelper:InstallIdentifier(NugetPackageIdentifier, Boolean)
NugetForUnity.NugetHelper:Install(NugetPackage, Boolean)
NugetForUnity.NugetHelper:InstallIdentifier(NugetPackageIdentifier, Boolean)
NugetForUnity.NugetWindow:DrawPackage(NugetPackage, GUIStyle, GUIStyle)
NugetForUnity.NugetWindow:DrawPackages(List`1)
NugetForUnity.NugetWindow:DrawOnline()
NugetForUnity.NugetWindow:OnGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--- END ERRORMESSAGE 2 ---

--- ERRORMESSAGE 3 ---
Unable to install package SharpDX.Direct3D11 4.2.0
System.Exception: Failed to install dependency: SharpDX.DXGI [4.2.0, ).
at NugetForUnity.NugetHelper.Install (NugetForUnity.NugetPackage package, System.Boolean refreshAssets) [0x001a1] in :0
UnityEngine.Debug:LogErrorFormat(String, Object[])
NugetForUnity.NugetHelper:Install(NugetPackage, Boolean)
NugetForUnity.NugetHelper:InstallIdentifier(NugetPackageIdentifier, Boolean)
NugetForUnity.NugetWindow:DrawPackage(NugetPackage, GUIStyle, GUIStyle)
NugetForUnity.NugetWindow:DrawPackages(List`1)
NugetForUnity.NugetWindow:DrawOnline()
NugetForUnity.NugetWindow:OnGUI()
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr)
--- END ERRORMESSAGE 3 ---

  • NuGet Package: [What is the name and version of the NuGet package you are installing?]
    SharpDX.Direct3D11
  • NuGetForUnity Version: [What version of NuGetForUnity are you running?]
    3.0.1 from UnityPackage
  • Unity Version: [What version of Unity are you using?]
    2019.3.2f1
  • Operating System: [What OS are you on?]
    Windows 10
@dmacd
Copy link

dmacd commented Mar 21, 2021

FWIW I'm seeing the same thing for packages CsvHelper and Newtonsoft.Json.
On version 3.0.0 on Unity 2019.4.20f1

@dmacd
Copy link

dmacd commented Mar 21, 2021

Update: Just noticed the 3.0.1 unitypackage release. This resolved Bad Request issue for me.

@DWishR
Copy link
Contributor

DWishR commented Apr 7, 2021

I'm still getting this error on version 3.0.1 for System.Numerics.Vectors attempting to install as a dependency for System.Memory (4.5.4)

System.Net.WebException: The remote server returned an error: (400) Bad Request.
  at System.Net.HttpWebRequest.EndGetResponse (System.IAsyncResult asyncResult) [0x00058] in <14e3453b740b4bd690e8d4e5a013a715>:0 
  at System.Net.HttpWebRequest.GetResponse () [0x0000e] in <14e3453b740b4bd690e8d4e5a013a715>:0 
  at NugetForUnity.NugetHelper.RequestUrl (System.String url, System.String userName, System.String password, System.Nullable`1[T] timeOut) [0x000b9] in <ebb7710be32040ba9a0cb144ce2a8967>:0 
  at NugetForUnity.NugetPackageSource.GetPackagesFromUrl (System.String url, System.String username, System.String password) [0x0006c] in <ebb7710be32040ba9a0cb144ce2a8967>:0 
  at NugetForUnity.NugetPackageSource.FindPackagesById (NugetForUnity.NugetPackageIdentifier package) [0x000ee] in <ebb7710be32040ba9a0cb144ce2a8967>:0 
   ...

@jwittner
Copy link
Collaborator

jwittner commented Apr 8, 2021

This is fixed in latest master with #384, and has a more optimal/performant fix coming with #385. If you test against source and still see the issue please do let me know. Any help reviewing #385 is much appreciated. =)

@jwittner jwittner closed this as completed Apr 8, 2021
@ludos1978
Copy link
Author

I tested #384 and #385 on osx. I was able to install the package that failed previously. Also #385 feels a lot faster, but i didnt test it extensively. Thanks a lot for your work

@DWishR
Copy link
Contributor

DWishR commented Apr 8, 2021

I merged #385 into my local off master. Still experiencing issues:
System.Numerics.Vectors silently fails to install via the GUI or by adding it to packages.config (This appears to be correct as System.Numerics.Vectors is included by Unity)

This appears related to #375 and not due to API versioning, but leaving here for posterity.
Google.Protobuf loudly fails to install with the following errors:

System.UnauthorizedAccessException: Access to the path 'C:\Dev\NuGetForUnity\Assets\Packages\Google.Protobuf.3.15.8\lib\' is denied.
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean anonymous, System.IO.FileOptions options) [0x000e0] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.IO.FileOptions options) [0x00000] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at System.IO.FileStream..ctor (System.String path, System.IO.FileMode mode, System.IO.FileAccess access, System.IO.FileShare share, System.Int32 bufferSize, System.Boolean useAsync) [0x00000] in <e1319b7195c343e79b385cd3aa43f5dc>:0 
  at (wrapper remoting-invoke-with-check) System.IO.FileStream..ctor(string,System.IO.FileMode,System.IO.FileAccess,System.IO.FileShare,int,bool)
  at System.IO.Compression.ZipFileExtensions.ExtractToFile (System.IO.Compression.ZipArchiveEntry source, System.String destinationFileName, System.Boolean overwrite) [0x00024] in <76d9a00775ca40f2b0898a0852fe66aa>:0 
  at NugetForUnity.NugetHelper.Install (NugetForUnity.NugetPackage package, System.Boolean refreshAssets) [0x00484] in C:\Dev\NuGetForUnity\Assets\NuGet\Editor\NugetHelper.cs:1408 
UnityEngine.Debug:LogErrorFormat(String, Object[])
NugetForUnity.NugetHelper:Install(NugetPackage, Boolean) (at Assets/NuGet/Editor/NugetHelper.cs:1441)
NugetForUnity.NugetHelper:InstallIdentifier(NugetPackageIdentifier, Boolean) (at Assets/NuGet/Editor/NugetHelper.cs:1249)
NugetForUnity.NugetWindow:DrawPackage(NugetPackage, GUIStyle, GUIStyle) (at Assets/NuGet/Editor/NugetWindow.cs:903)
NugetForUnity.NugetWindow:DrawPackages(List`1) (at Assets/NuGet/Editor/NugetWindow.cs:580)
NugetForUnity.NugetWindow:DrawOnline() (at Assets/NuGet/Editor/NugetWindow.cs:546)
NugetForUnity.NugetWindow:OnGUI() (at Assets/NuGet/Editor/NugetWindow.cs:434)
UnityEngine.GUIUtility:ProcessEvent(Int32, IntPtr) (at C:/buildslave/unity/build/Modules/IMGUI/GUIUtility.cs:179)

Package could not be read: C:\Dev\NuGetForUnity\Assets\Packages\Google.Protobuf.3.15.8\Google.Protobuf.3.15.8.nupkg
UnityEngine.Debug:LogErrorFormat(String, Object[])
NugetForUnity.NuspecFile:FromNupkgFile(String) (at Assets/NuGet/Editor/NuspecFile.cs:152)
NugetForUnity.NugetPackage:FromNupkgFile(String) (at Assets/NuGet/Editor/NugetPackage.cs:155)
NugetForUnity.NugetHelper:CheckForUnnecessaryPackages() (at Assets/NuGet/Editor/NugetHelper.cs:1610)
NugetForUnity.NugetHelper:Restore() (at Assets/NuGet/Editor/NugetHelper.cs:1583)
NugetForUnity.NugetHelper:.cctor() (at Assets/NuGet/Editor/NugetHelper.cs:129)
UnityEditor.EditorAssemblies:ProcessInitializeOnLoadAttributes() (at C:/buildslave/unity/build/Editor/Mono/EditorAssemblies.cs:168)

@shadiakiki1986
Copy link

shadiakiki1986 commented Apr 15, 2021

@jwittner @ludos1978 @DWishR could you share some instructions on how to build nugetforunity from master? Also needed in #383 with @tobias-tengler to test

Update: check DWishR reply here on 383

@DWishR
Copy link
Contributor

DWishR commented Apr 15, 2021

You can use the build.ps1 script in the root folder if you're ok with that. I had already made a build off my pull request, so I just added it as a comment here.

...looks like you beat me to it, @shadiakiki1986 [:

@jwittner
Copy link
Collaborator

Sorry that the build process isn't documented - I've captured that need in #386

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

5 participants