Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

NuGet.targets error : '.', hexadecimal value 0x00, is an invalid character after upgrade to .Net Core 2.1.1

after upgrade to .Net Core 2.1.1 I got this error:

  C:\Program Files\dotnet\sdk\2.1.301\NuGet.targets(114,5): error : An error 
occurred while retrieving package metadata for 'System.IO.4.3.0' from source
     'C:\Program Files\dotnet\sdk\NuGetFallbackFolder'. 
    C:\Program Files\dotnet\sdk\2.1.301\NuGet.targets(114,5): error :   '.', 
hexadecimal value 0x00, is an invalid character. Line 1, position 1. 

not able to solve it using

nuget.exe locals -clear global-packages
nuget.exe locals -clear packages-cache
nuget.exe locals -clear http-cache

or

nuget.exe locals -clear all

thanks for any help

like image 645
mrapi Avatar asked Jun 23 '18 06:06

mrapi


People also ask

What is hexadecimal value 0x00?

Hexadecimal value 0x00 is a invalid character, line 1, position nnnnn. But its not consistent. Sometimes some 'blank' data will work. The 'faulty' data works on some PCs, but not others. In the database, the data is always a blank string.

How to CLEAR NuGet CACHE?

Open Visual Studio, go to Tools -> NuGet Package Manager -> Package Manager Settings menu. Click Clear All NuGet Cache(s) button in options dialog then clearing process is started. Once NuGet cache location is cleared, click ok button.


1 Answers

In my case it was simple, I just did the following:

  • In Visual Studio, click: TOOLS > NUGET PACKAGE MANAGER > PACKAGE MANAGER SETTINGS
  • Select Option NUGET PACKAGE MANAGER > GENERAL
  • In General, click on button CLEAR ALL NUGET CACHE(S) await a few seconds
  • After this , close all windows and go to TOOLS > NUGET PACKAGE MANAGER > PACKAGE MANAGER CONSOLE
  • type dotnet restore
  • done =)
like image 59
Adriano Heissig Avatar answered Oct 26 '22 01:10

Adriano Heissig