Private NuGet Package won't install due to version - c#

I am using the NuGet Package Explorer to package an internal library which is then published to our private NuGet Feed. The package is very simple in that it only contains a single assembly and the pdb file for said assembly. The assembly was built in .NET 4.5 and I am trying to install the package into a project that also targets 4.5.
The error I am getting is:
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.
Package explorer looks like the below image:
For those of you not familiar with package explorer, the markup of the nuspec looks like this:
Can anyone point out what I am doing wrong here?

Related

.NET Same version nuget package to two projects in one solution

We have a solution with two projects (both version .net 4.6.2).
When installing a nuget package from our private Nuget Feed to either one of the projects, it works.
If we try to install the same package version into both projects, then package gets installed into one of them, and the other one gives error : "Error Could not install package 'OurInternalPackageName 1.0.1.5'. You are trying to install this package into a project that targets '.NETFramework,Version=v4.6.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. ".
We tried installing nuget using 'Manage packages for solution' option, manage nuget packages for projects separately but the result is still the same.
Changing .NET framework versions does not help.
Clearing Nuget cache did not help as well.
The workaround we are using now: install package to one of the projects, and then install a lower version of a package to another project.
We tested this with 'Automapper' Nuget, tried to install into both projects and it worked (Same version got installed into both projects).
Any ideas would be appreciated.

Can't install Microsoft.ProjectOxford.Face NuGet into Xamarin Studio iOS project

I tried a lot, but I can't install Microsoft.ProjectOxford.Face NuGet into Xamarin Studio iOS project.
I got this error:
Could not install package 'Microsoft.ProjectOxford.Face 1.2.5.1'. You are trying to install this package into a project that targets 'Xamarin.iOS,Version=v1.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.
I tried to update all packages, also Xamarin and still same problem. Only this package does not work - other like Newtonsoft.Json, Mircosoft.Net.HTTP and many other was installed correctly. I tried to install first Microsoft.BCL also Microsoft.BCL.Build and it also does not work.
Maybe you have any thoughts what can I do to make it work?
Unfortunately this is a problem with the Microsoft.ProjectOxford.Face 1.2.5.1 NuGet package itself. Whilst it has a portable class library (PCL) folder this does not map to a valid PCL profile:
portable-net45+wp80+win8+wpa81+aspnetcore50
If the aspnetcore50 part of that folder is removed then it would install into Xamarin.iOS. As it is, NuGet will not allow you to install it.
The only thing left you can do is unzip the NuGet package and try directly using the assembly. NuGet will not allow you to install it.
I believe there are plans to update the NuGet package to fix this, but that has not yet happened.

Could not install package 'IEDriver 2.0.0'

I'm doing an UIAutomation Project in C# using Selenium. The automation is to be done in Internet Explorer. So I tried downloading IEDriver.exe from NuGet Package Manager but faced following error:
Severity Code Description Project File Line Suppression State
Error Could not install package 'IEDriver 2.0.0'. You are trying to
install this package into a project that targets
'.NETFramework,Version=v4.6.1', 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. 0
I've few confusions over this warning.
the package does not contain any assembly references or content files that are compatible with that framework
What are those assembly references and content files which are compatible for my targer gramework version v4.6.1?
If you look inside the IEDriver 2.0 NuGet package it just contains a single file: IEDriverServer.exe.
You cannot install this NuGet package into a project. It does not have any lib directories so NuGet will not be able to add it to your project.

Why can't my PCL use System.Runtime?

I have a PCL that targets the following platforms:
.NET Framework 4.5
Windows 8
Windows Phone 8.1
I need to add a reference to System.Runtime because I want to use another package that depends on it. From what I can see, version 4.0.0 appears to include the target platforms mentioned above. However, when I try installing it via NuGet, I get this stack trace:
PM> Install-Package System.Runtime -Version 4.0.0
# ...
Install failed. Rolling back...
Package 'System.Runtime 4.0.0' does not exist in project 'PclDummy'
Package 'System.Runtime 4.0.0' does not exist in folder 'C:\Users\James\Documents\Visual Studio 2015\Projects\PclDummy\packages'
Install-Package : Could not install package 'System.Runtime 4.0.0'. 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.
Why does this happen if System.Runtime supports all of the platforms my PCL does?
that targets '.NETPortable,Version=v4.5,Profile=Profile111'
Be sure to distinguish between reference assemblies and runtime assemblies. To get your PCL project compiled, you only need reference assemblies. And you already have one for System.Runtime, it is located in the C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework.NETPortable\v4.5\Profile\Profile111 directory on your machine. It is already referenced in your project so the package was correctly rejected.
These kind of crazy "but everybody already has this" Nuget packages come from the CoreCLR project. It is evolving rapidly right now with beta versions released at a very high rate. Which is one of the targets supported by Profile111, it supports an ASP.NET Core 5.0 target. Not one you listed in your question so you probably don't need it at all. But if you would then it would be that project that downloads this Nuget package. Which is entirely automatic, you don't ask for the packages explicitly.
Just stop trying to get it installed.
it seems that System.Runtime is not completely supported in version 4.5.
you can check it in the profile folder in following path:
C:\Program Files (x86)\Reference Assemblies\Microsoft\Framework\.NETPortable\v4.5\Profile\Profile111
there is a list of supported assemblies and namespaces.

cannot install NuGet package into project

I cannot install the NuGet package System.IdentityModel.Tokens.Jwt (.Net JWT Handler) into my project. If i try to install the package with NuGet, it will install into the root of the solution only (a .nuget folder is created in the root of the solution). I need to install the package in my project, not the solution.
Why would this happen? I tried passing in the project name to the Install-Package command in the Package Manager Console, and that looks like it installs correctly but no references are added to my project and the packages.config file is not updated.
My project is currently referencing .Net 4.5.1 and I have also tried with .Net 4.5.
The package I am trying to install is here:
System.IdentityModel.Tokens.Jwt
I'm having the same issue. I was trying to install the package as said in this article http://msdn.microsoft.com/en-us/library/dn205064(v=vs.110).aspx
So, I look into the package history and finally I installed the previous package
http://www.nuget.org/packages/System.IdentityModel.Tokens.Jwt/3.0.0
It works fine for me.
With NuGet, you can now specify the directory the packages are installed in.
http://docs.nuget.org/docs/release-notes/nuget-2.1
Specify ‘packages’ Folder Location
In the past, NuGet has managed a solution’s packages from a known ‘packages’ folder found beneath the solution root directory. For development teams that have many different solutions which have NuGet packages installed, this can result in the same package being installed in many different places on the file system. NuGet 2.1 provides more granular control over the location of the packages folder via the ‘repositoryPath’ element in the NuGet.config file. Building on the previous example of hierarchical nuget.config support, assume that we wish to have all projects under C:\myteam\ share the same packages folder. To accomplish this, simply add the following entry to C:\myteam\nuget.config.
The package System.IdentityModel.Tokens.Jwt 3.0.1 has some problems: the file System.IdentityModel.Tokens.Jwt.dll and System.IdentityModel.Tokens.Jwt.Xml should be put in directory lib\net45, but they are put in the root directory instead. This causes NuGet to think the package is a solution level package, and will not install the package into a project.
This problem was fixed in System.IdentityModel.Tokens.Jwt 3.0.2

Categories