Nuget Package Installation Error - Invalid URI: Failed to Parse Admin / Node

I use NuGet in Visual Studio 2017 to try installing the package in an older Web Forms project, and it does not work with the following error:

Invalid URI: The Authority/Host could not be parsed 

This only happens when you try to install the package on a website that displays in IIS (other projects work fine), so the project name is http: // localhost ... etc., and that’s what I think u him parsing problems. It worked fine until a few days ago, and I'm not sure what changed it. Here is the complete message I receive:

 Resolved actions to install package 'Newtonsoft.Json.10.0.3' Found package 'Newtonsoft.Json 10.0.3' in 'd:\packages'. Package 'Newtonsoft.Json.10.0.3' already exists in folder 'd:\packages' Install failed. Rolling back... Package 'Newtonsoft.Json.10.0.3' does not exist in project 'http://localhost:89/' Executing nuget actions took 71.95 ms Failed to add reference to 'Newtonsoft.Json'. Invalid URI: The Authority/Host could not be parsed. 

Another related key is that when I open "Manage NuGet Pacakges ..." in a website project, it does not show anything as installed, although the packages.config file clearly exists in this project with several specific links.

My environment is as follows:

Visual Studio Professional 2107 Version 15.5.2, Microsoft.NET Framework version 4.7.02556, NuGet Package Manager Version 4.5.0, and my NuGet repository is installed for installation in D: \ packages

Does anyone have any advice on what settings I can change to work again?

+5
source share
4 answers

NuGet does not seem to work for local IIS website projects in VS 15.5.1 through 15.5.5 (inclusive).

Workaround:

  • Close VS
  • (just in case) make a backup copy of the .sln file (solution file)
  • In a text editor, open the .sln file and find the line:

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://www.devsite.com", "http://www.devsite.com", "{A8837508-9BC1-482A-86EF-4B3156CAFDBE}"

  1. Change the second parameter and save:

Project("{E24C65DC-7377-472B-9ABA-BC803B73C61A}") = "http://www.devsite.com", "DevWebsiteFolderName", "{A8837508-9BC1-482A-86EF-4B3156CAFDBE}"

  1. Discover your solution.
  2. Use NuGet on your own :-)

Additionally:

  1. Close VS
  2. Discard the .sln change.
  3. Open VS

For a loan and additional information:

NuGet Error for Web Site Projects Hosted on Local IIS

Nuget is looking for the wrong location for the .config package in an IIS website

+6
source

It drove me crazy ... I spent hours trying to install the Authorize.net nuget package in VS2017, and he kept throwing the same error.

I finally opened my project in VS2015 and installed it without any problems.

Hope this helps.

  • Jason
+1
source

Given that we did not receive any help from Microsoft, we accepted an agreement to do something like what Barry Kay suggested, but for the second parameter we simply replaced it with one period. ""

0
source

This issue seems to be fixed in 15.6.0. Try updating this version if you can.

-1
source

Source: https://habr.com/ru/post/1274115/


All Articles