How do I register a new NuGet package source with dotnet CLI on Ubuntu 14.04?

前端 未结 2 1169
醉梦人生
醉梦人生 2021-01-17 07:30

I am running .NET Core 1.1.0 on Ubuntu 14.04, with the goal of hosting my Web APIs in Docker on Ubuntu. I want to build my packages on Ubuntu, but some of the NuGet referen

2条回答
  •  我在风中等你
    2021-01-17 08:07

    After all that I quickly identified 2 problems I had missed:

    1. I had used sudo -i to run as root attempting to resolve the problem, as as a result the NuGet config I setup in my \home folder was not being picked up.
    2. Moving back to my own logon, I then got an error:

      error: Unable to load the service index for source https://theluggage-agct.gray.net/artifactory/api/nuget/nuget-institutional-development-local.
      error:   The content at 'https://theluggage-agct.gray.net/artifactory/api/nuget/nuget-institutional-development-local' is not a valid JSON object.
      error:   Unexpected character encountered while parsing value: <. Path '', line 0, position 0.
      

    Turns out that our Artifactory NuGet repo returns XML which is NuGet v2 compliant. I changed the config file to set the repo as v2 and it is now working. So, from above, edit the file at

    \home\\.nuget\NuGet\NuGet.Config
    

    adding your new repo URL, and get the version setting right:

    
    
      
        
        
      
    
    

提交回复
热议问题