1

I know there's an answer for this question from 2016 but it's not working today. I have VS2013 with the latest CU installed.

My Nuget package source settings:enter image description here

I want to install the nu-get package "Serilog.Sinks.MSSqlServer". First, I ensure nuget is up to date by navigating to the ".nuget" folder of the solution's folder and running "nuget update -self":

enter image description here

Unfortunately, I still get the error when trying to add the package: enter image description here

If I try to update nuget from the "Extensions and Updates" page of VS then I get a 403 error as shown below:enter image description here

The 403 does suggest a proxy issue but other packages can be installed to the same dev box ok. I just installed "Apache log4net" from the Manage NuGet Packages window - no problem

Any ideas of a work-around for this please?

Rob Bowman
  • 7,632
  • 22
  • 93
  • 200

2 Answers2

0

This might be related to the fact that you now (with the new NuGet CLI tool version) need to use the new NuGet API.

from nuget.org

NuGet feed v3 (VS 2015 and later / NuGet v3.x and above): https://api.nuget.org/v3/index.json NuGet feed v2 (VS 2013 and earlier / NuGet 2.x): https://www.nuget.org/api/v2

You can check (and edit) your NuGet Package Sources under Tools, Options, NuGet Package Manager, Package Sources.

@Rob Bowman, in response to your comment and looking at the screenshot of your Available package sources, try edit your default nuget.org to https://api.nuget.org/v3/index.json or add a new source and make sure they're both enabled. Maybe that'll do the trick.

Update: maybe manually updating the NuGet Package Manager (since updating it through Extensions and Updates is not working) solves the problem. NuGet Package Manager for Visual Studio 2013. Going to Visual Studio menu Help, About should display the currently installed version of this extension (and others).

Emiel Koning
  • 4,039
  • 1
  • 16
  • 18
  • Thanks Emiel but it seems this is set correctly - I've updated question with a screenshot – Rob Bowman Jun 06 '17 at 09:27
  • I'm afraid adding https://api.nuget.org/v3/index.json as an additional source made no difference, when attempting to add "Serilog.Sinks.MSSqlServer" I still get "Serilog already has a dependency defined for Microsoft.CSharp – Rob Bowman Jun 06 '17 at 09:45
  • In this [StackOverflow post](https://stackoverflow.com/questions/38247961/nuget-package-manager-automapper-already-has-a-dependency-defined-for-micros#answer-38747408) someone mentions updating Visual Studio (to update 5) as the solution to a similar problem. – Emiel Koning Jun 06 '17 at 09:59
  • Could the 403 Forbidden (when trying to update the package manager) be proxy related? Maybe it is possible to manually install the extension, outside of Visual Studio from [the Visual Studio Marketplace](https://marketplace.visualstudio.com/items?itemName=NuGetTeam.NuGetPackageManagerforVisualStudio2013). – Emiel Koning Jun 06 '17 at 10:07
  • Good point - the 403 does suggest a proxy issue but other packages can be installed to the same dev box ok. I just installed "Apache log4net" from the Manage NuGet Packages window - no problem. – Rob Bowman Jun 08 '17 at 07:25
0

To fix this I had to:

Rob Bowman
  • 7,632
  • 22
  • 93
  • 200