6

I setup a Nexus repo recently. I see the expected result if I type the URL into a browser: enter image description here

I've successfully added this nuget server as a source to my VS2022 package manager on one machine. On my other machine, however (also with VS2022 installed), I get an error when trying to browse this repo in the package manager:

Error  [sourcename] Unable to load the service index for source [url].
The content at '[url]' is not a valid JSON object.
Unexpected character encountered while parsing value: <. Path '', line 0, position 0.

It looks like the package manager is expecting JSON, but the nuget server is sending XML. How can I fix this?

stevep
  • 167
  • 1
  • 7

1 Answers1

17

On Windows in configuration AppData/Roaming/Nuget/Nuget.config remove protocol version or change to 2 for your feed. Probably you have protocolVersion="3".

Dziuniek
  • 186
  • 1
  • 3
  • 3
    That fixes it! I removed the protocol version from that element instead of changing to "2" since none of my other package sources specify a protocol version. Thanks - SP – stevep Mar 03 '22 at 13:31
  • 1
    I also deleted the protocol version, restarted VS and everything worked just fine – HumanHickory May 27 '22 at 13:21