Error When Installing NuGet Packages - entity-framework

When I try to install EF with NuGet in Visual Studio 2013 Pro, I get this error:
Attempting to resolve dependency 'EntityFramework.Commands (≥ 7.0.0-beta4)'.
'EntityFramework.Commands' already has a dependency defined for 'EntityFramework.Relational'.
When I try to install EntityFramework.Core I get this erro:
Attempting to resolve dependency 'Ix-Async (≥ 1.2.3)'.
'EntityFramework.Core' already has a dependency defined for 'Ix-Async'.
What could possibly be the problem, I've seen others with the issue, they suggested installing an upgraded NuGet, which I did. The problem persists. No other solutions have worked.
Any one have any ideas how I can fix this? It's a VSTO addin for Outlook 2013.
Thanks
EDIT:
After restarting VS2013 after updating NuGet I tried to install EF again, got a new error:
Attempting to resolve dependency 'EntityFramework.Commands (≥ 7.0.0-beta4)'.
Installing 'EntityFramework.Commands 7.0.0-beta4'.
Successfully installed 'EntityFramework.Commands 7.0.0-beta4'.
Executing script file 'C:\Users\shenk\Documents\Visual Studio 2013\Projects\Archiver\packages\EntityFramework.Commands.7.0.0-beta4\tools\init.ps1'.
Installing 'EntityFramework 7.0.0-beta4'.
Successfully installed 'EntityFramework 7.0.0-beta4'.
Adding 'EntityFramework.Commands 7.0.0-beta4' to Archiver.
Uninstalling 'EntityFramework.Commands 7.0.0-beta4'.
Successfully uninstalled 'EntityFramework.Commands 7.0.0-beta4'.
Install failed. Rolling back...
Could not install package 'EntityFramework.Commands 7.0.0-beta4'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.
However when I try to install EntityFramework.Core again, it succeeds now.
I want to use EF6, but cannot find it on NuGet, and when I try to install it with the Microsoft Download Center, it never downloads.
I'm a bit lost here so any help would be appreciated.

Upgrade NuGet to the latest version from here:
https://nuget.codeplex.com/releases/view/612846
Update:
NuGet at codeplex has been moved to https://github.com/nuget/home
Simply download latest version from:
https://www.nuget.org/downloads

The solution I found was to use IE to download things from Microsoft Download center. I was able to install EF tools for VS2012 and VS2013.
Next to install EF6 I went to Tools -> NuGet Package Manager -> Package Manager Console. In the console I entered Install-Package EntityFramework You can also do Install-Package EntityFramework -pre to get the latest release (7.0.0-beta4)
This worked for me. Unless someone else has a better solution I will accept this one in a day or so.

Related

Installing Nuget Gets Dependencies Only

I have a .NET Framework 4.5 project. I'm trying to install Microsoft.NET.Test.Sdk. This should be possible as per https://www.nuget.org/packages/Microsoft.NET.Test.Sdk/
I ran the following command, but get the dependencies only. I tried installing via the Nuget Package Manager too. Finally... I see the package inside my packages.config file, but don't see it in my references. Any suggestions?
Install-Package Microsoft.NET.Test.Sdk -Version 15.7.0
I ended up using Microsoft.VisualStudio.TestTools.UnitTesting.

Nuget Package Manager for single project fails to load after adding RingCentralSDK

I'm on VS 2015, targeting .net 4.5.2, my "Nuget Package Manager for Visual Studio" in Extensions and Updates shows 3.4.4.1321.
I added all dependencies of RingCentralSDK package separately:
Microsoft.Bcl
Microsoft.Bcl.Async
Microsoft.Bcl.Build
Microsoft.Net.Http
Newtonsoft.Json
Portable.BouncyCastle-Signed
PubnubPCL
Then I right click on my project, pick "Manage Nuget Packages...", the tab opens, in the "Installed" subtab I can see the 7 packages.
Now, I install the RingCentralSDK package. My output is fine:
Attempting to gather dependency information for package 'RingCentralSDK.1.0.0' with respect to project 'MyProj', targeting '.NETFramework,Version=v4.5.2'
Attempting to resolve dependencies for package 'RingCentralSDK.1.0.0' with DependencyBehavior 'Lowest'
Resolving actions to install package 'RingCentralSDK.1.0.0'
Resolved actions to install package 'RingCentralSDK.1.0.0'
Adding package 'RingCentralSDK.1.0.0' to folder 'C:\code\packages'
Added package 'RingCentralSDK.1.0.0' to folder 'C:\code\packages'
Added package 'RingCentralSDK.1.0.0' to 'packages.config'
Successfully installed 'RingCentralSDK 1.0.0' to MyProj
========== Finished ==========
Now, I check again the Manage Nuget Packages for this specific project, and instead of seeing the list of packages, I get a yellow band:
Error occured Show erros in output Dismiss
And in the "Package Manager" output, the error is:
ZIP archive contains unsupported data structures.
In my packages folder, the folder "RingCentralSDK.1.0.0" seems ok, but then I don't anything about nuget packages format.
I cannot uninstall RingCentral via the package manager as it's not showing, not any other one, which is really annoying. I had an error when trying to do it via the command line. I reverted my changes (or remove the line in packages.config for my project), and the Nuget Package Manager tab works fine again. This is also affecting the "Managet Nuget Packages for Solution".
What can I do to fix this?
Fixed in RingCentralSDK 1.0.1-alpha1
It turns out that the NuGet package created on Mac is not compatible with Visual Studio NuGet GUI tool.
You can install the latest version by
Install-Package RingCentralSDK -Pre
Or if you prefer GUI:
Update:
For projects which already have 1.0.0 version installed, how to upgrade?
Today I did some testing and I came to the following conclusion:
New project will have no problem with 1.0.1 version or later
For old project which have 1.0.0 installed. You need to follow the following steps:
UnInstall RingCentralSDK 1.0.0
Close VS
Delete packages folder in your project
Delete packages folder in ~/.nuget/
Launch VS
Install RingCentralSDK 1.0.1
I need to do the above because nuget has cache. If I don't do it the problem just persists. I don't know the exactly reason but the above steps did work for me.

Nuget not reinstalling packages

I have modified the target .net framework to use 4.5 from 4.0. I got a message from nuget that packages need to re-installed so ran Update-Package -Reinstall -ProjectName https://localhost/SomeWebProject/. As nuget was executing, it spitted out yellow warning signs that looked like this:
Skipped reinstalling package 'NLog 3.1.0.0' in project 'SomeWebProject' because the package does not exist in the package source.
Why aren't my packages being reinstalled? I went into my packages folder and verified NLog 3.1.0.0 exist!
Turns out the solution is hiding in plain sight.
All we have to do is set the Package Source in the Package Manager Console window. (Credits to Matt Ward for pointing it out.)
Or you may run the following NuGet Package Management command:
'Update-Package -reinstall'
This command will reinstall all your solutions NuGet packages without updating the version(s) of existing packages.

DotNetOpenAuth NuGet Install - but Samples are problematic

I installed DotNetOpenAuth using NuGet and downloaded the 4.1 zipfile with samples, but am having difficulty trying to incorporate the Facebook.aspx sample into the new project. The sample code-behind refers to DotNetOpenAuth.OAuth2, but I cannot seem to resolve this reference with the NuGet install. What am I missing?
Note that I built the DotNetOpenAuth.ApplicationBlock sample and added the refernce into the new project.
Please run this NuGet command to install the DotNetOpenAuth.OAuth2.Client package:
PM> Install-Package DotNetOpenAuth.OAuth2.Client -Pre

Nuget package dependencies. Does it work the way it should?

RavenDb latest version is installed as a nuget package. It references Newtonsoft.Json 4.0.2.
I'm trying to install TweetSharp. I get this log:
M> Install-Package TweetSharp
Attempting to resolve dependency 'Hammock (≥ 1.2.3)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 4.0.1)'.
Successfully installed 'Hammock 1.2.6'.
Successfully installed 'Newtonsoft.Json 4.0.3'.
Successfully installed 'TweetSharp 2.0.8'.
Install failed. Rolling back...
Install-Package : Updating 'Newtonsoft.Json 4.0.2' to 'Newtonsoft.Json 4.0.3'
failed. Unable to find a version of 'RavenDB-Embedded' that is compatible with
'Newtonsoft.Json 4.0.3'.
As you can see, even if TweetSharp just needs 'Newtonsoft.Json (≥ 4.0.1)', nuget wants to install version 4.0.3 which can not work with RavenDb.
I tried to install previous versions of TweetSharp but it does not change anything.
Any way to circumvent this?
Sounds like a possible bug in NuGet. Please log an issue in the NuGet bug tracker: http://nuget.codeplex.com/workitem/list/basic
If TweetSharp is fine with NewtonSoft.Json 4.0.2, then the install should not have failed. In your bug, can you post the exact versions that caused this problem. For example:
List of installed packages with exact version installed.
List of dependencies for each package and the specific version range they specify.
And the exact version of TweetSharp you're trying to install. That'll help us look at the issue more quickly. Thanks!
My guess is we have some default logic that tries to upgrade packages to the latest bug fix release. In this case, we tried that, but it causes another dependency to fail. In that case, we should have known that and not tried to upgrade.
This is down to the semantic versioning that NuGet has had since (I think) 1.6. It's explained in more detail here but the basic idea is that if your dependency hasn't updated either the major or the minor revision number then they'll assume that it's a bugfix and not a breaking change.
So in this case the decision to install 4.0.3 instead of 4.0.1 was made.
You can run install-package with -ignoredependencies I would have thought that if you'd had 4.0.2 installed it wouldn't try to update you (because 4.0.2 satisfies the dependency).