Error installing nuget package Swashbuckle - rest

I'm trying to install nuget package Swashbuckle to a new project that will get me swagger things. I created the project and then tried to add project but I'm getting the error:
Severity Code Description Project File Line Suppression State
Error NU1107 Version conflict detected for Microsoft.AspNet.WebApi.Client. Install/reference Microsoft.AspNet.WebApi.Client 5.2.6 directly to project TestAPI to resolve this issue.
TestAPI -> Microsoft.AspNetCore.App 2.1.1 -> Microsoft.AspNet.WebApi.Client (>= 5.2.6 && < 5.3.0)
TestAPI -> Swashbuckle 5.6.0 -> Microsoft.AspNet.WebApi.WebHost 4.0.20710 -> Microsoft.AspNet.WebApi.Core 4.0.20710 -> Microsoft.AspNet.WebApi.Client (>= 4.0.20710 && < 4.1.0). TestAPI
How do I resolve this error? I have upgraded all packages and things I could find...

Try this:
PM> Install-Package Swashbuckle.AspNetCore --version 4.0.1
Reference : Get started with Swashbuckle and ASP.NET Core

Related

Unable to resolve dependencies. 'xxx' is not compatible with 'yyy constraint: zzz)'

We have a project that is utilizing a set of Nuget-based Azure libraries. One of them was published with a specific MIN and MAX dependency on Newtonsoft.Json (max version being 7)
This was a headache, because other libraries depend on 8+ version of Netwon and this specific Azure library is just fine working with any modern Json package.
In VS2013, we forced to install this Azure library with newer version of Json package thru nuget installer and subsequently, Nuget never gave us any issues installing/updating other libraries.
However, after upgrading to VS2017, we cannot update any package (or at least the ones that depend on Json) and we get the error below.
Unable to resolve dependencies. 'Newtonsoft.Json 8.0.3' is not compatible with 'Microsoft.Azure.Insights 0.15.0-preview constraint: Newtonsoft.Json (>= 6.0.8 && < 7.0.0)'
How do we have Nuget ignore that specific Azure library's unimportant MAX version dependence?
How do we have Nuget ignore that specific Azure library's unimportant MAX version dependence?
If you confirm that Azure library is just fine working with any modern Json package and you want use the Microsoft.Azure.Insights 0.15.0-preview and 8+ version of Newtonsoft.Json at the same time. I would like provide a workaround to you, hope this can help you.
Detailed Steps:
Install the package Microsoft.Azure.Insights 0.15.0-preview with its dependencies first.
Only uninstall the package Microsoft.Azure.Insights 0.15.0-preview, Keep dependencies installed.
Update the Newtonsoft.Json to the version 8+.
Install the package Microsoft.Azure.Insights 0.15.0-preview in the Package Manager Console with following NuGet command:
Install-package Microsoft.Azure.Insights -IncludePrerelease -IgnoreDependencies
With the option -IgnoreDependencies, NuGet will ignore that specific Azure library's unimportant MAX version dependence:
Note: Need to mention is that if you update the Newtonsoft.Json package next time, you still need to follow the steps above to upgrade your Newtonsoft.Json package.

Nuget Error "Unable to find a version of 'Unity' that is compatible with 'NakedObjects.Core 7.1.3 constraint: Unity (>= 3.5.1404 && < 4.0.0)'."

I get
Unable to find a version of 'Unity' that is compatible with
'NakedObjects.Core 7.1.3 constraint: Unity (>= 3.5.1404 && < 4.0.0)'.
When I try and update any package in VS 2017. I have the latest version of nuget. And the current version that is install in my project is indeed Unity 3.5.1404.

Nuget package RavenDB.Embedded: Unable to find a version of 'RavenDB.Database' that is compatible with 'System.Spatial 5.0.2'

In a new project when I try to add the NugetPackage : RavenDB.Embedded
I have the following error :Updating 'System.Spatial 5.2.0' to 'System.Spatial 5.0.2' failed. Unable to find a version of 'RavenDB.Database' that is compatible with 'System.Spatial 5.0.2'.
i think this is a nuget bug. try using:
Install-Package RavenDB.Embedded -DependencyVersion Highest

Unable to Use Nuget with MvvmCross - PCL

Following the tutorial for mvvmcross here: http://www.youtube.com/watch?v=_DHDMNB_IeY&list=PLR6WI6W1JdeYSXLbm58jwAKYT7RQR31-W&index=1
I've set up my PCL xml files to include MonoTouch and Mono for Android as instructed here: http://slodge.blogspot.co.uk/2013/04/my-current-pcl-setup-in-visual-studio.html
If I try to use nuget I get an error that an item with the same key has already been added:
I can add other project types to the solution and NuGet works fine, it's something specific to PCL projects. Here is the console output:
PM> Install-Package MvvmCross.HotTuna.StarterPack
Attempting to resolve dependency 'MvvmCross.HotTuna.CrossCore (≥ 3.0.8.1)'.
Attempting to resolve dependency 'MvvmCross.PortableSupport (≥ 3.0.8.1)'.
Installing 'MvvmCross.PortableSupport 3.0.8.1'.
Successfully installed 'MvvmCross.PortableSupport 3.0.8.1'.
Installing 'MvvmCross.HotTuna.CrossCore 3.0.8.1'.
Successfully installed 'MvvmCross.HotTuna.CrossCore 3.0.8.1'.
Installing 'MvvmCross.HotTuna.StarterPack 3.0.8.1'.
Successfully installed 'MvvmCross.HotTuna.StarterPack 3.0.8.1'.
Adding 'MvvmCross.PortableSupport 3.0.8.1' to BLUBCNMOBL.Core.
Uninstalling 'MvvmCross.PortableSupport 3.0.8.1'.
Successfully uninstalled 'MvvmCross.PortableSupport 3.0.8.1'.
Install failed. Rolling back...
Install-Package : An item with the same key has already been added.
At line:1 char:1
Microsoft Visual Studio Premium 2012 (Version 11.0.60315.01 Update 2)
Nuget v 2.5
My guess is that one of the XML files you added git snafu'd during copy and paste.
Try deleting whatever you added and try adding them again.
Alternatively, it could be that someone else has added conflicting files? Eg xamarin have recently added pcl support so maybe they've added files?
To try collecting more info, you could try using the nuget command line - does that give you any more diagnostic info.

Error installing Entity Framework package

I got a strange error when trying to install the latest version of EntityFramework(4.1.10715.0) from the package manager:
The 'schemaVersion' attribute is not declared.
How can I solve this?
Try to install the latest NuGet version