How do I install WindowsAzure.Storage in Visual Studio 2013? - c#

Note: this answer didn't help me because I don't have the same dll: System.Collections.Immutable 1.1.37
I'm using Visual Studio 2013 and .net 4.5 and following this tutorial: Get started with Azure Blob storage using .NET
I am trying to install WindowsAzure.Storage but get this error:
Attempting to resolve dependency 'Microsoft.Data.OData (≥ 5.8.2)'.
Attempting to resolve dependency 'System.Spatial (= 5.8.2)'.
Attempting to resolve dependency 'Microsoft.Data.Edm (= 5.8.2)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 6.0.8)'.
Attempting to resolve dependency 'Microsoft.Data.Services.Client (≥ 5.8.2)'.
Attempting to resolve dependency 'System.Net.Requests (≥ 4.0.11)'.
Attempting to resolve dependency 'System.ComponentModel.EventBasedAsync (≥ > 4.0.11)'.
Attempting to resolve dependency 'System.Dynamic.Runtime (≥ 4.0.0)'.
Attempting to resolve dependency 'System.Linq.Queryable (≥ 4.0.0)'.
The 'System.Linq.Queryable 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.12.0.817'.
when I upgrade Nuget per the red error in the image, it takes me to Extensions and Updates asking to update this:
I don't know the relation between what I am looking for and this, but I went ahead and followed that update anyway, but get the error:
Where should I proceed from here!?
based on comment form Simsons, I already checked that my processor supports Virtualization:

When you try to install the WindowsAzure.Storage package through NuGet, this is the key error;
Attempting to resolve dependency 'System.Linq.Queryable (≥ 4.0.0)'. The 'System.Linq.Queryable 4.0.0' package requires NuGet client version '3.0' or above, but the current NuGet version is '2.12.0.817'
Unfortunately, System.Linq.Queryable 4.0.0 requires NuGet 3.0 or above. So this isn't going to work on Visual Studio 2013.
Luckily, the newer System.Linq.Queryable 4.3.0 only requires NuGet 2.12 which is available for Visual Studio 2013.
So, to successfully install WindowsAzure.Storage in Visual Studio 2013 via NuGet:
Download and Install NuGet 2.12 if you don't already have it. (OP has confirmed already having this version)
In NuGet, Install System.Linq.Queryable 4.3.0
In NuGet, Install WindowsAzure.Storage

Open your Visual Studio 2013. Go to Tools > NuGet Package Manager > Package Manager Console
In the packet manager console type:
Install-Package NuGet.Client -Version 3.2.0
I tried this using NuGet Client version 3.2.0. The current latest version is 4.3 (beta) or 4.2. So I'm not sure if it will work for versions 4.2 and 4.3, but it surely works for NuGet 3.2.0. NuGet >3 was all I needed for SendGrid and other packages.

Clearly for Visual Studio 2013 you can only use NuGet 2.12,
https://www.nuget.org
If you want to use NuGet 3.x as well as those packages that require NuGet 3.x, you have to upgrade to Visual Studio 2015 and above.

Related

Package Microsoft.CSharp 4.5.0 not compatible with netcoreapp2.1 Error Message

I am trying to run a ASP.NET Core 2.0 app. However when I click on run in IDE (to build the app) I get this error:
Controller.csproj: [NU1202] Package Microsoft.CSharp 4.5.0 is not
compatible with netcoreapp2.1 (.NETCoreApp,Version=v2.1). Package
Microsoft.CSharp 4.5.0 does not support any target frameworks.
Controller.csproj: [NU1202] Package System.Security.Principal 4.3.0 is
not compatible with netcoreapp2.1 (.NETCoreApp,Version=v2.1). Package
System.Security.Principal 4.3.0 does not support any target
frameworks.
Thank you inadvance.
It seems you have an old version of Visual Studio. To create a net core 2.1 application you need at least Visual Studio 2017 version 15.7 or if you cannot access this version then switch to Visual Studio Code that is free.
Can you delete the reference to Package System.Security.Principal 4.3.0 and in the package manager do:
Install-Package System.Security.Principal.Windows -Version 4.6.0-preview.18571.3
Package System.Security.Principal 4.3.0 requires .NET Framework 4.5 and is not compatible with .NET Core as the error says.
I manage to solve this issue by creating a new solution and pointing to the right variables (framework and others). Thank you so much for your contribution.

SocketIoClientDotNet with Visual Studio for mac can't install

I am using Visual Studio for mac.
I tried to download SocketIoClientDotNet on nuget.
But I failed to install the package.
[MY SPEC]
Visual Studio Community 2017 for Mac
Version 7.1 (build 1297)
Runtime:
Mono 5.2.0.215 (d15-3/da80840) (64-bit)
GTK+ 2.24.23 (Raleigh theme)
Package version: 502000215
NuGet
버전: 4.3.0.2418
.NET Core
Runtime: Not installed
SDK: Not installed
MSBuild SDKs: /Library/Frameworks/Mono.framework/Versions/5.2.0/lib/mono/msbuild/15.0/bin/Sdks
Xamarin.Profiler
1.5.5
/Applications/Xamarin Profiler.app/Contents/MacOS/Xamarin Profiler
Apple Developer Tools
Xcode 8.3.3 (12175.1)
Build 8E3004b
Xamarin.Mac
Version: 3.6.0.19 (Visual Studio Community)
Attempting to gather dependency information for package 'SocketIoClientDotNet.0.9.13' with respect to project 'Chat', targeting '.NETPortable,Version=v4.5,Profile=Profile111'
GET https://api.nuget.org/v3/registration3-gz-semver2/socketioclientdotnet/index.json
OK https://api.nuget.org/v3/registration3-gz-semver2/socketioclientdotnet/index.json 1290ms
Total number of results gathered : 2
Gathering dependency information took 1.3 sec
Summary of time taken to gather dependencies per source :
https://api.nuget.org/v3/index.json - 1.3 sec
Attempting to resolve dependencies for package 'SocketIoClientDotNet.0.9.13' with DependencyBehavior 'Lowest'
Resolving dependency information took 0 ms
Resolving actions to install package 'SocketIoClientDotNet.0.9.13'
Resolved actions to install package 'SocketIoClientDotNet.0.9.13'
Retrieving package 'SocketIoClientDotNet 0.9.13' from 'nuget.org'.
For adding package 'SocketIoClientDotNet.0.9.13' to project 'Chat' that targets 'portable45-net45+win8+wpa81'.
Install failed. Rolling back...
Package 'SocketIoClientDotNet.0.9.13' does not exist in project 'Chat'
Package 'SocketIoClientDotNet.0.9.13' does not exist in folder '/Users/LSH/Work/Dev/WebServer/Chat/packages'
Executing nuget actions took 139.18 ms
Could not install package 'SocketIoClientDotNet 0.9.13'. You are trying to install this package into a project that targets '.NETPortable,Version=v4.5,Profile=Profile111', 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.
The SocketIoClientDotNet 0.9.13 NuGet package has two portable assemblies:
lib/portable-win81+wpa81
lib/portable-wpa81+wp81
These do not map to any known Portable Class Library (PCL) profile so NuGet will not allow you to install it into a portable class library project.
The latest SocketIoClientDotNet beta version 1.0.2-beta1 has no PCL assemblies. Instead it has a .NET Standard 1.3 assembly. Unfortunately you cannot use that in a PCL project either.
So either you find another NuGet package that provides what you need and also supports PCL projects or you will have to modify your project to be a .NET Standard project that targets at least .NET Standard 1.3.

Installing json.NET via NuGet error 'Newtonsoft.Json' already has a dependency defined for Microsoft C#

I'm using Visual Studio(VS) 2010 Ultimate (with .NET 4.0) to install Json.NET (10.0.2) but get failed with error message:
'Newtonsoft.Json' already has a dependency defined for
'Microsoft.CSharp'
I've tried to search solution for this and tried many ways like: update NuGet Package. but unfortunately, it didn't work.
What is to be done?
More tried update:
The version of NuGet Package: 2.8.60318.667
Install Json.net version: 9.0.1 without problem
I tried this solution and it worked for me:
Tool -> NuGet Packages Manager - Manage Nuget Package for Solution
Select Online tab and search online for Nuget.CommandLine -> install it
After installing, you can find nuget.exe in your Current Project folder -> Packages -> NuGet.CommandlineXXX
Run CMD and use command install to install latest version of Json.NET
Back to Project -> add reference - Browse for DLL file
Done!
Please check the version of .NET Framework you are using. There are chances that previous frameworks such as v3.5 or below doesn't support latest version of JSON.
Or this would help you : NuGet: 'X' already has a dependency defined for 'Y'

How to install protobuf-net on Visual Studio 2012 using NuGet?

I would like to install protobuf-net using NutGet and Visual Studio 2012.
However, if I try to install it, I got the following error message from NuGet :
'protobuf-net' already has a dependency defined for
'NETStandard.Library'.
I have tried to install NETStandard.Library but there is an error :
The 'NETStandard.Library 1.6.0' package requires NuGet client version
'2.12' or above, but the current NuGet version is '2.8.60318.667'.
I also tried to update NuGet (by uninstalling it then re-install), but it seems with Visual Studio 2012 it is stuck to 2.8 version.
I don't have Visual Studio 2012 to test, but I wonder if this is due to the way Nuget now works with the .Net Core dependencies. It should work if you install an older version of protobuf-net. You can see that the older version doesn't mention .NETStandard as a dependency. To do this, from the package manager console, type this:
Install-Package protobuf-net -Version 2.0.0.668
I found that this protobuf-portable-net works on .NET 4.5 for VS 2013 and has the same version number as above: 2.0.0.668. It's the same author and might be a better approach than intentionally installing an old version of a newer package.

Missing reference on successful NuGet package installation

I am following this guide to setup my own NuGet private server, but using Visual Studio 2010.
I have successfully added the NuGet.Server package through Package Manager Console, but when I want to build the WebApplication I got errors:
The type or namespace name 'Server' does not exist in the namespace 'NuGet' (are you missing an assembly reference?)
There is no error in the package installation, but I see that NuGet.Server is not added in the reference folder of the project, Why is that happen?
Edit : Further investigating on the package contents, I see that NuGet.Server does not have the lib for net40. I might need to fork NuGet.Server source and compile it in net40 to fix this.
Here is my logs from Package Manager Console:
PM> Install-package nuget.server
Attempting to resolve dependency 'NuGet.Core (≥ 2.10.1)'.
Attempting to resolve dependency 'Microsoft.Web.Xdt (≥ 2.1.0)'.
Attempting to resolve dependency 'Newtonsoft.Json (≥ 8.0.1)'.
Attempting to resolve dependency 'RouteMagic (≥ 1.3.0)'.
Attempting to resolve dependency 'WebActivatorEx (≥ 2.1.0)'.
Attempting to resolve dependency 'Microsoft.Web.Infrastructure (≥ 1.0.0.0)'.
Installing 'Microsoft.Web.Xdt 2.1.1'.
You are downloading Microsoft.Web.Xdt from Microsoft Corporation, the license agreement to which is available at http://go.microsoft.com/fwlink/?LinkId=273778. Check the package for additional dependencies, which may come with their own license agreement(s). Your use of the package and dependencies constitutes your acceptance of their license agreements. If you do not accept the license agreement(s), then delete the relevant components from your device.
Successfully installed 'Microsoft.Web.Xdt 2.1.1'.
Installing 'NuGet.Core 2.10.1'.
Successfully installed 'NuGet.Core 2.10.1'.
Installing 'Newtonsoft.Json 8.0.1'.
Successfully installed 'Newtonsoft.Json 8.0.1'.
Installing 'RouteMagic 1.3'.
Successfully installed 'RouteMagic 1.3'.
Installing 'Microsoft.Web.Infrastructure 1.0.0.0'.
Successfully installed 'Microsoft.Web.Infrastructure 1.0.0.0'.
Installing 'WebActivatorEx 2.1.0'.
Successfully installed 'WebActivatorEx 2.1.0'.
Installing 'NuGet.Server 2.10.3'.
Successfully installed 'NuGet.Server 2.10.3'.
Adding 'Microsoft.Web.Xdt 2.1.1' to WebApplication2.
Successfully added 'Microsoft.Web.Xdt 2.1.1' to WebApplication2.
Adding 'NuGet.Core 2.10.1' to WebApplication2.
Successfully added 'NuGet.Core 2.10.1' to WebApplication2.
Adding 'Newtonsoft.Json 8.0.1' to WebApplication2.
Successfully added 'Newtonsoft.Json 8.0.1' to WebApplication2.
Adding 'RouteMagic 1.3' to WebApplication2.
Successfully added 'RouteMagic 1.3' to WebApplication2.
Adding 'Microsoft.Web.Infrastructure 1.0.0.0' to WebApplication2.
Successfully added 'Microsoft.Web.Infrastructure 1.0.0.0' to WebApplication2.
Adding 'WebActivatorEx 2.1.0' to WebApplication2.
Successfully added 'WebActivatorEx 2.1.0' to WebApplication2.
Adding 'NuGet.Server 2.10.3' to WebApplication2.
File Conflict
File 'Web.config' already exists in project 'WebApplication2'. Do you want to overwrite it?
[Y] Yes [A] Yes to All [N] No [L] No to All [?] Help (default is "N"):A
Overwrite existing file 'Web.config'.
Successfully added 'NuGet.Server 2.10.3' to WebApplication2.
I got the same error when trying to build it with Visual Studio 2015 in a project that had the target framework set to .NET Framework 4.0. Setting the target framework to .NET Framework 4.6.1 fixed it for me.
I would suggest using a newer version of Visual Studio if possible, or compiling it with the newer framework itself via the command line. This other stack overflow answer may be of assistance if you wish to do the later. How to build .NET 4.6 Framework app without Visual Studio installed?
An option for anyone who do not want to, or cannot target a different .NET Framework version, is to install a previous version of NuGet.Server. For example, version 2.10.3 targets .NET 4.5.

Categories