ServiceStack: nuget installation of OrmLite does not install all the pieces needed? - ormlite-servicestack

Installed package as per documentation and tried a simple query
db.SingleOrDefault<Customer>("Id={0}",id)
and got error
Could not load type 'ServiceStack.Text.PlatformExtensions' from
assembly 'ServiceStack.Text, Version=3.9.26.0, Culture=neutral,
PublicKeyToken=null'.":"ServiceStack.Text.PlatformExtensions"}
Is nuget definition missing pieces?

You are referencing old NuGet packages. The current version for all ServiceStack NuGet packages (inc ServiceStack.Text) is v3.9.43.
Clean out your old NuGet packages and re-reference them again.

Related

Unable to restore nuget/nexus packages for .netcore and .netframework in same solutions from Jenkins

In my solution, I have .NET Core and .NET Framework projects. I am facing the below error (which is a .NET Core project) while compiling the solution through Jenkins:
error NETSDK1064: Package IBM.Data.DB2.Core, version 1.3.0.100 was not
found. It might have been deleted since NuGet restore. Otherwise,
NuGet restore might have only partially completed, which might have
been due to maximum path length restrictions.
The Error Message is pretty self-explanatory. Try to restore the package by either right clicking on the solution and selecting "Restore Nuget Packages" in your IDE, or run the below command in the package manager console.
nuget restore YourSolution.sln
Alternatively, you can also install the package using the below command
Install-Package IBM.Data.DB2.Core -Version 1.3.0.100
Check for any error messages while restoring or installing packages, in case there are any file path issues.

Unable to find a version of 'Newtonsoft.Json'

My current asp.net mvc app needs 11.0.2 version of 'Newtonsoft.Json'
However, I want to add a nuget package "UmbracoCMS" that needs Newtonsoft.Json (>= 10.0.2 && < 11.0.0)'
Please let me know how I could handle this in the web.config
I tried assemblyredirect but that didn't help. Thank you.
Unable to find a version of 'Newtonsoft.Json'
This issue is not related to assembly-redirect, so you could not resolve it by web.config. That is because the prerequisite for assembly-redirect is that different versions of the Newtonsoft.Json assembly should be all acceptable for your project and we use assembly-redirect to select one of the version to our project.
Check a sample link.
However, your current question is that you can not get both versions to work for your project. Your asp.net mvc app needs 11.0.2 version of Newtonsoft.Json, but the nuget package UmbracoCMS that needs Newtonsoft.Json (>= 10.0.2 && < 11.0.0). You can not use both versions, so you can not use assembly-redirect to select one of the version to your project.
To resolve this issue, you have to resolve the reference conflict. Could you only use Newtonsoft.Json 11.0.2 for your asp.net mvc app? Can you use Newtonsoft.Json 10.0.2/10.0.3 instead? If yes, you can install Newtonsoft.Json 10.0.2/10.0.3, then you can install the nuget package UmbracoCMS. If not, I am afraid you could not install the nuget package UmbracoCMS.
Hope this helps.

Stripe.net nuget package doesn't recognize json.net 9.0.1

I'm trying to install the Stripe.net 6.12.0 nuget package in my project. It has a dependency on the Json.NET 9.0.1 nuget package which I have installed, but when I go to install stripe.net, visual studio gives me the error message: "Stripe.NET already has a dependency defined for"Newtonsoft.Json'. What do I have to do to install Stripe.NET?
Was not obvious from the error message, but the solution was simply to upgrade Nuget. Was using 2.8.xxx and upgraded to the latest which is 2.12.xxx. Restarted. Fixed the problem.

issues for NuGet after migrating a c# project

i'm trying to migrate a project into my visual studio 2012.
On the Manage NuGet Packages, I have this issue:
"Some NuGet Packages are missing from this solution. Click to restore from your online package sources"... but when i click on the restore button, it appears this issue:
"an error occurred while trying to restore packages: Unable to find version '4.1.0-alpha-121112' of package 'Microsoft.AspNet.WebApi'. "
i'm using .NET Framework 4
How can i solve?
Thanks in advance....
The problem is that version '4.1.0-alpha-121112' of package Microsoft.AspNet.WebApi does not exist on NuGet.org. It is not available on MyGet from the ASP.NET Web Stack Nightly package source either. So NuGet cannot restore it since it is no longer available.
Looking at Symbol Source it looks like this NuGet package was at one point available from the ASP.NET Web Stack Nightly package source on MyGet but it no longer seems to be available. I suspect they have deleted the old packages from that MyGet package source.
Unless you can find the original NuGet package, you will either have to manually remove the NuGet package reference, by editing the project file and packages.config file, and reinstall a version that exists.
1) Make sure you upgrade to the latest NuGet.
2) Make sure you're doing package restore "The Right Way" http://blog.davidebbo.com/2014/01/the-right-way-to-restore-nuget-packages.html
That should resolve the issue.
if still this ain't solve you can see this Rightway to migrate

NuGet: 'X' already has a dependency defined for 'Y'

I'm getting the following error in NuGet while trying to install package Microsoft.AspNet.Server.IIS
Attempting to resolve dependency 'Microsoft.AspNet.Loader.IIS.Interop (≥ 1.0.0-alpha4-10330)'.
Attempting to resolve dependency 'Microsoft.AspNet.Loader.IIS (≥ 1.0.0-alpha4-10330)'.
'Microsoft.AspNet.Loader.IIS' already has a dependency defined for 'Microsoft.AspNet.FeatureModel'.
How to resolve it?
UPDATE:
Also, I'm getting the following:
Attempting to resolve dependency 'Microsoft.Framework.DependencyInjection (≥ 1.0.0-alpha4-10326)'.
'Microsoft.Framework.DependencyInjection' already has a dependency defined for 'Microsoft.Framework.ConfigurationModel'.
This was resolved by installing the latest NuGet Package Manager:
https://visualstudiogallery.msdn.microsoft.com/4ec1526c-4a8c-4a84-b702-b21a8f5293ca
Don't forget to restart Visual Studio.
I fixed a similar issue in my solution by:
Opening up a command prompt
Navigating to the .nuget folder in my solution
Running nuget update -self
This upgraded the copy of NuGet.exe that was in my solution from 2.8.0 to 3.4.4, which fixed the 'X' already has a dependency defined for 'Y' error that was stopping it from downloading SSH.NET automatically before building.
(If your solution doesn't have a copy of NuGet.exe in it - and it might not - then you should try the solution in TN's answer instead)
I tried the update, but it did not work for me. Helped:
Uninstall NuGet => Tools => Extensions and update => Installed
Install NuGet
Reload Visual Studio
I faced this error on outdated version of Visual Studio 2010. Due to project configuration I was not able to update this version to newer. Therefore, update of NuGet advised above did not fix things for me.
Root reason for the error in this and similar situations is in dependencies of the package you try to install, which are not compatible with .NET version available in your project.
Universal solution is not obligatory update of Visual Studio or .NET but in installation of older NuGet versions of the same package compatible with your system.
It is not possible to tell for sure, which of earlier versions will work. In my case, this command installed the package without any NuGet updates.
Install-Package X -Version [compatible version number]
I was getting this issue on our TeamCity build server. I tried updating NuGet on the build server (via TC) but that didn't work. I finally resolved the problem by changing the "Update Mode" of the Nuget Installer build step from solution file to packages.config.
I was getting the issue 'Newtonsoft.Json' already has a dependency defined for 'Microsoft.CSharp' on the TeamCity build server.
I changed the "Update Mode" of the Nuget Installer build step from solution file to packages.config and NuGet.exe to the latest version (I had 3.5.0) and it worked !!
Go to the link https://www.nuget.org/packages/ClosedXML/0.64.0
Search your NuGet packages
See the all version of related packages
Install the lower version of packages
In my case I had to delete the file NuGet.exe in the Project folder/.nuget and rebuild the project.
I also have in NuGet.targets the DownloadNuGetExe marked as true:
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">true</DownloadNuGetExe>
Hope it's helps.
The only solution that worked for me was to uninstall nuget completely from Visual Studio 2013 and then install it again with the obligatory restart of VS in between.
Go to Tools.
Extensions and Updates.
Update Nuget and any other important feature.
Restart.
Done.
In a project using vs 2010, I was only able to solve the problem by installing an older version of the package that I needed via Package Manager Console.
This command worked:
PM> Install-Package EPPlus -Version 4.5.3.1
This command did not work:
PM> Install-Package EPPlus -Version 4.5.3.2

Resources