question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Failing to install packages

See original GitHub issue

Description

My issue is that I am not able to install the fo-dicom package. The error that I believe caused this is: Unable to install package fo-dicom 5.0.2 System.Exception: Failed to install dependency: Microsoft.Bcl.AsyncInterfaces 1.1.1.

Which is in turn caused by: Unable to retrieve package from http://www.nuget.org/api/v2/Packages(Id='Microsoft.Bcl.AsyncInterfaces',Version='1.1.1') System.Xml.XmlException: '', hexadecimal value 0x1F, is an invalid character. Line 1, position 1.

I am uncertain what is causing this error outside of a poorly sanitized request. I installed NeGetForUnity using the .unitypackage file. Is their any means that I can repair this or any idea what may have caused this?

  • NuGet Package: fo-dicom 5.0.2
  • NuGetForUnity Version: 3.0.3
  • Unity Version: 2020.3.28f1
  • Operating System: Windows

Their were a total of 3 errors thrown, in sequence they were:

Unable to retrieve package from http://www.nuget.org/api/v2/Packages(Id=‘Microsoft.Bcl.AsyncInterfaces’,Version=‘1.1.1’) System.Xml.XmlException: ‘’, hexadecimal value 0x1F, is an invalid character. Line 1, position 1. at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x00027] in <0f9699188f0c414ea6fb5557f5c16d15>:0 at System.Xml.XmlTextReaderImpl.Throw (System.String res, System.String[] args) [0x00029] in <0f9699188f0c414ea6fb5557f5c16d15>:0 at System.Xml.XmlTextReaderImpl.Throw (System.Int32 pos, System.String res, System.String[] args) [0x0000c] in <0f9699188f0c414ea6fb5557f5c16d15>:0 at System.Xml.XmlTextReaderImpl.ThrowInvalidChar (System.Char[] data, System.Int32 length, System.Int32 invCharPos) [0x0000f] in <0f9699188f0c414ea6fb5557f5c16d15>:0 at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace () [0x00139] in <0f9699188f0c414ea6fb5557f5c16d15>:0 at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x002d4] in <0f9699188f0c414ea6fb5557f5c16d15>:0 at System.Xml.XmlTextReaderImpl.Read () [0x0008c] in <0f9699188f0c414ea6fb5557f5c16d15>:0 at System.Xml.Linq.XDocument.Load (System.Xml.XmlReader reader, System.Xml.Linq.LoadOptions options) [0x00016] in <a9ef27d60e3144519c0741b6584ba229>:0 at System.Xml.Linq.XDocument.Load (System.IO.TextReader textReader, System.Xml.Linq.LoadOptions options) [0x0000f] in <a9ef27d60e3144519c0741b6584ba229>:0 at System.Xml.Linq.XDocument.Load (System.IO.TextReader textReader) [0x00000] in <a9ef27d60e3144519c0741b6584ba229>:0 at NugetForUnity.NugetPackageSource.GetPackagesFromUrl (System.String url, System.String username, System.String password) [0x00079] in <6a48cd2923ae4ff490cdbdab680b2a59>:0 at NugetForUnity.NugetPackageSource.GetSpecificPackage (NugetForUnity.NugetPackageIdentifier package) [0x0007b] in <6a48cd2923ae4ff490cdbdab680b2a59>:0 UnityEngine.Debug:LogErrorFormat (string,object[]) NugetForUnity.NugetPackageSource:GetSpecificPackage (NugetForUnity.NugetPackageIdentifier) NugetForUnity.NugetHelper:GetOnlinePackage (NugetForUnity.NugetPackageIdentifier) NugetForUnity.NugetHelper:GetSpecificPackage (NugetForUnity.NugetPackageIdentifier) NugetForUnity.NugetHelper:InstallIdentifier (NugetForUnity.NugetPackageIdentifier,bool) NugetForUnity.NugetHelper:Install (NugetForUnity.NugetPackage,bool) NugetForUnity.NugetHelper:InstallIdentifier (NugetForUnity.NugetPackageIdentifier,bool) NugetForUnity.NugetWindow:DrawPackage (NugetForUnity.NugetPackage,UnityEngine.GUIStyle,UnityEngine.GUIStyle) NugetForUnity.NugetWindow:DrawPackages (System.Collections.Generic.List`1<NugetForUnity.NugetPackage>) NugetForUnity.NugetWindow:DrawOnline () NugetForUnity.NugetWindow:OnGUI () UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Could not find Microsoft.Bcl.AsyncInterfaces 1.1.1 or greater. UnityEngine.Debug:LogErrorFormat (string,object[]) NugetForUnity.NugetHelper:InstallIdentifier (NugetForUnity.NugetPackageIdentifier,bool) NugetForUnity.NugetHelper:Install (NugetForUnity.NugetPackage,bool) NugetForUnity.NugetHelper:InstallIdentifier (NugetForUnity.NugetPackageIdentifier,bool) NugetForUnity.NugetWindow:DrawPackage (NugetForUnity.NugetPackage,UnityEngine.GUIStyle,UnityEngine.GUIStyle) NugetForUnity.NugetWindow:DrawPackages (System.Collections.Generic.List`1<NugetForUnity.NugetPackage>) NugetForUnity.NugetWindow:DrawOnline () NugetForUnity.NugetWindow:OnGUI () UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Unable to install package fo-dicom 5.0.2 System.Exception: Failed to install dependency: Microsoft.Bcl.AsyncInterfaces 1.1.1. at NugetForUnity.NugetHelper.Install (NugetForUnity.NugetPackage package, System.Boolean refreshAssets) [0x001a1] in <6a48cd2923ae4ff490cdbdab680b2a59>:0 UnityEngine.Debug:LogErrorFormat (string,object[]) NugetForUnity.NugetHelper:Install (NugetForUnity.NugetPackage,bool) NugetForUnity.NugetHelper:InstallIdentifier (NugetForUnity.NugetPackageIdentifier,bool) NugetForUnity.NugetWindow:DrawPackage (NugetForUnity.NugetPackage,UnityEngine.GUIStyle,UnityEngine.GUIStyle) NugetForUnity.NugetWindow:DrawPackages (System.Collections.Generic.List`1<NugetForUnity.NugetPackage>) NugetForUnity.NugetWindow:DrawOnline () NugetForUnity.NugetWindow:OnGUI () UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Issue Analytics

  • State:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:5

github_iconTop GitHub Comments

1reaction
ragavendranbalacommented, Feb 21, 2022

Thank you @liucl19 and Great help by @sunsetbros and @din82958. Replace the attached dll file into your unity project (in my case Unity 2020.3.29) under the location Assets->Nuget->Editor->NugetForUnity.dll

NugetForUnity.zip

1reaction
liucl19commented, Feb 21, 2022

Same problem here:

  • Unity version: 2020.3.25f1
  • OS: Win 10
  • NuGetForUnity Version: 3.0.3
System.Xml.XmlException: '', hexadecimal value 0x1F, is an invalid character. Line 1, position 1.
  at System.Xml.XmlTextReaderImpl.Throw (System.Exception e) [0x00027] in <0f9699188f0c414ea6fb5557f5c16d15>:0 
  at System.Xml.XmlTextReaderImpl.Throw (System.String res, System.String[] args) [0x00029] in <0f9699188f0c414ea6fb5557f5c16d15>:0 
  at System.Xml.XmlTextReaderImpl.Throw (System.Int32 pos, System.String res, System.String[] args) [0x0000c] in <0f9699188f0c414ea6fb5557f5c16d15>:0 
  at System.Xml.XmlTextReaderImpl.ThrowInvalidChar (System.Char[] data, System.Int32 length, System.Int32 invCharPos) [0x0000f] in <0f9699188f0c414ea6fb5557f5c16d15>:0 
  at System.Xml.XmlTextReaderImpl.ParseRootLevelWhitespace () [0x00139] in <0f9699188f0c414ea6fb5557f5c16d15>:0 
  at System.Xml.XmlTextReaderImpl.ParseDocumentContent () [0x002d4] in <0f9699188f0c414ea6fb5557f5c16d15>:0 
  at System.Xml.XmlTextReaderImpl.Read () [0x0008c] in <0f9699188f0c414ea6fb5557f5c16d15>:0 
  at System.Xml.Linq.XDocument.Load (System.Xml.XmlReader reader, System.Xml.Linq.LoadOptions options) [0x00016] in <a9ef27d60e3144519c0741b6584ba229>:0 
  at System.Xml.Linq.XDocument.Load (System.IO.TextReader textReader, System.Xml.Linq.LoadOptions options) [0x0000f] in <a9ef27d60e3144519c0741b6584ba229>:0 
  at System.Xml.Linq.XDocument.Load (System.IO.TextReader textReader) [0x00000] in <a9ef27d60e3144519c0741b6584ba229>:0 
  at NugetForUnity.NugetPackageSource.GetPackagesFromUrl (System.String url, System.String username, System.String password) [0x00079] in <6a48cd2923ae4ff490cdbdab680b2a59>:0 
  at NugetForUnity.NugetPackageSource.GetSpecificPackage (NugetForUnity.NugetPackageIdentifier package) [0x0007b] in <6a48cd2923ae4ff490cdbdab680b2a59>:0 
UnityEngine.Debug:LogErrorFormat (string,object[])
NugetForUnity.NugetPackageSource:GetSpecificPackage (NugetForUnity.NugetPackageIdentifier)
NugetForUnity.NugetHelper:GetOnlinePackage (NugetForUnity.NugetPackageIdentifier)
NugetForUnity.NugetHelper:GetSpecificPackage (NugetForUnity.NugetPackageIdentifier)
NugetForUnity.NugetHelper:InstallIdentifier (NugetForUnity.NugetPackageIdentifier,bool)
NugetForUnity.NugetWindow:DrawPackage (NugetForUnity.NugetPackage,UnityEngine.GUIStyle,UnityEngine.GUIStyle)
NugetForUnity.NugetWindow:DrawPackages (System.Collections.Generic.List`1<NugetForUnity.NugetPackage>)
NugetForUnity.NugetWindow:DrawOnline ()
NugetForUnity.NugetWindow:OnGUI ()
UnityEngine.GUIUtility:ProcessEvent (int,intptr,bool&)

Update: Fix: download source code, edit Assets/Editor/NugetPackageSource.cs, line 380:

packages = NugetODataResponse.Parse(XDocument.Load(streamReader));

change it to

string content = new string(streamReader.ReadToEnd().Where(ch => XmlConvert.IsXmlChar(ch)).ToArray());
packages = NugetODataResponse.Parse(XDocument.Parse(content));

will fix this problem.

Read more comments on GitHub >

github_iconTop Results From Across the Web

I am unable to install packages in R
3 Answers. Now try installing the package. This should solve your problem. You need to set your library path to a folder that...
Read more >
R | Unable to Install Packages RStudio Issue (SOLUTION)
Go To Tools -> Global option -> Packages. Then uncheck the option “Use secure download method for HTTP”.
Read more >
Problem Installing Packages in the RStudio IDE
If you are unable to install packages in the RStudio IDE, some common problems are outlined below: Are you able to install packages...
Read more >
Rstudio can´t install any package. I´m a beginner. How to fix?
I tried another command: install.packages (c ("devtools", "lme4")) They all give the same error message, as shown below: > ...
Read more >
Package failed to install or upgrade
Start by clearing the expired package cache by running yum clean expire-cache, then attempt to install the failed package (for example, yum install...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found