System.Reactive/Rx .NET 4.0 on Nuget - c#

I am trying to add System.Reactive.Core to a .NET 4.0 project using VS2013 and getting the following error:
Could not install package `System.Reactive.Core 3.0.0`.
You are trying to install this package into a project that target
`.NETFramework,Version=v4.0`, but the package does not contain any assembly
reference or content files that are compatible with that framework.
I also cannot find the old Rx-Main packages anymore on nuget.org.
How can I get Rx Installed on .NET 4.0?
I guess I will have to manually go find the RxMain 2.x libs and reference them directly from a lib folder in my solution?

Ok I figured it out, Rx-Main has been unlisted, therefore can only install it using the following command:
Install-Package Rx-Main -Version 2.2.5
To Rx Team: You should of recreated 2.2.5 System.Reactive which allowed us to target .NET 4.0 before moving up to 3.0.0.

Related

Webdriver Driver Mananger 2.7.0 not getting installed from Nuget with .Net framework 4.5

I want to use WebDriverManager in my code when I am trying to install the reference from the Nuget Package Manager I get an error.
I have tried updating and degrading the .Net framework.
Can we use WebDriverManager 2.7.0 with .Net framework 4.5?
Error Message seen is :
Could not install package 'WebDriverManager 2.7.0'. 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.
I know this post is old but I ran into the same issue today and was able to figure it out. You need to install version 2.2.7 instead. WebDriverMangaer version 2.2.8 and above require .Net Standard 2.0 which is only compatible with .NET Framework 4.6.1 and above.

Can't Install Nuget Package

I am trying to install System.Runtime.Handles so I can use SafeAccessTokenHandle and RunImpersonated, however when I try to install the package I get the error :
Could not install package 'System.Runtime.Handles 4.3.0'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.5.2', 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.
I have done some research and I do not believe there is a .NETFramework, Version=v4.3.0. Does anybody have an idea on how to install this package?
I have done some research and I do not believe there is a .NETFramework, Version=v4.3.0. Does anybody have an idea on how to install this package?
First, you have to make sure the version of NuGet Package Manager for Visual Studio 2013 is the latest version 2.12.0.817, not the default version 2.8. You can check it from Tools->Extensions and Updates->Installed.
That because this nuget package require the NuGet 2.12 or higher.
Second, you should make sure you have installed the .net 4.6 and above. You should not change the framework version by unloading the project, opening the project file, changing the target framework, and then reloading the file. In this way, Visual Studio can not help to check if you have install that target framework. You should change it by right on the project select Properties->Application->Target framework:
If you do not have target framework .net 46, you can click the Install other frameworks to install it. For this question, you can just change your target framework to 4.7.1 directly.
Hope this helps.

Could not install package 'Microsoft.Owin 4.0.0'. Am I not able to install Microsoft.Owin packages into a .NETFramework project?

So I am working with .NETFramework,Version=v4.5 and I need to use Microsoft.Owin.Security.Google as well as Microsoft.Owin.Host.SystemWeb. However I'm getting the following error when trying to install said NuGet packages:
Could not install package 'Microsoft.Owin 4.0.0'. 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.
Is there another way to use Microsoft.Owin NuGet packages in a .NETFramework project?
Change your Framework version to v4.5.1 or later:

Restrict Dependencies to specific .NET version using NuGet

I have a C# solution targeted for framework 4.5.1 but the server I need to install this on uses 4.0 so I need to roll this back.
The developer has used NuGet (which I'm not really familiar with) for dependency management. I've seen there is a way to request specific versions of each library so I'm hoping there is a feature which allows me to restrict these to a specific .NET version.
How can I get NuGet to install the latest dependencies for .NET version 4, or is this not a feature it supports?
If you change the target framework of the project then Visual Studio will check the compatibility of the NuGet packages and tell you which ones are compatible or not and whether they need to be reinstalled. You can then reinstall them from the Package Manager console using the -reinstall option.
Update-Package –reinstall <packageName>
NuGet does not directly support a way to restrict or install NuGet packages for a specific .NET version. The NuGet package will either support that .NET version or not. You can restrict a project to a specific version of the NuGet package by using the allowedVersions attribute in the packages.config file but that is independent of the .NET version the NuGet package supports.
Nuget should install packages that are available for the targeted version of .NET
Check your packages folder, or check the documentation of each dependency for support of .NET 4.0
In some cases you may just be able to re-target your application without uninstalling any Nuget packages.
To install a specific version of a Nuget package, you can use the "-Version" flag
Example -
Install-Package AvalonDock -Version 2.0.1320
References -
http://docs.nuget.org/Consume/Package-Manager-Console
http://dutton.me.uk/2013/07/24/how-to-install-a-specific-version-of-a-package-with-nuget/

Is there a way to specify .NET Framework Version argument while using Install-Package in Nuget?

We are trying to install Microsoft.AspNet.WebApi.Client in a project that's targeting .NET Framework 4.0. Unfortunately the servers we are working on don't support .NET Framework 4.5.
When using Nuget Package Manager Console with the Install-Package command we are receiving the following error,
PM> install-package Microsoft.AspNet.WebApi.Client
Installing 'Microsoft.AspNet.WebApi.Client 5.1.1'.
.
.
.
Install-Package : Could not install package 'Microsoft.AspNet.WebApi.Client 5.1.1'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.0', 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.
How do we choose the right .NET framework is there a command-line argument where we can mention the .NET version?
Thanks,
You can't select the .NET version, but you can select the version of the NuGet package:
PM> Install-Package Microsoft.AspNet.WebApi.Client -Version <package version>
So what you'd need to do is to figure out which version was the latest version that supported .NET 4.0. IIRC, it was 4.0.30506.
So, to install version 4.0.30506, you use the command
PM> Install-Package Microsoft.AspNet.WebApi.Client -Version 4.0.30506
Some NuGet packages can contain builds for various different .NET versions (e.g. .NET 3.5, .NET 4, .NET 4.5, etc.), but ASP.NET Web API 2 only supports .NET 4.5.
ASP.NET Web API version 4.0.30506, on the other hand, corresponds to ASP.NET Web API 1, and IIRC it runs on .NET 4.0.

Categories

Resources