Could not install package MvvmCross.PortableSupport 3.2.1 at Visual Studio 2013 for PCL Profile 158 - xamarin

I have the following setup and still couldn't add mvmcross libraries to my project:
VS2013 Update 3
Nuget Package Manager 2.8.50313.46
PCL Profile 158 (I also tried other like 78, etc)
Install log is below:
Attempting to resolve dependency 'MvvmCross.HotTuna.StarterPack (≥ 3.2.1)'.
Attempting to resolve dependency 'MvvmCross.HotTuna.MvvmCrossLibraries (≥ 3.2.1)'.
Attempting to resolve dependency 'MvvmCross.HotTuna.CrossCore (≥ 3.2.1)'.
Attempting to resolve dependency 'MvvmCross.PortableSupport (≥ 3.2.1)'.
Installing 'MvvmCross.PortableSupport 3.2.1'.
Successfully installed 'MvvmCross.PortableSupport 3.2.1'.
Installing 'MvvmCross.HotTuna.CrossCore 3.2.1'.
Successfully installed 'MvvmCross.HotTuna.CrossCore 3.2.1'.
Installing 'MvvmCross.HotTuna.MvvmCrossLibraries 3.2.1'.
Successfully installed 'MvvmCross.HotTuna.MvvmCrossLibraries 3.2.1'.
Installing 'MvvmCross.HotTuna.StarterPack 3.2.1'.
Successfully installed 'MvvmCross.HotTuna.StarterPack 3.2.1'.
Installing 'MvvmCross 3.2.1'.
Successfully installed 'MvvmCross 3.2.1'.
Adding 'MvvmCross.PortableSupport 3.2.1' to ClassLibrary1.
Uninstalling 'MvvmCross.PortableSupport 3.2.1'.
Successfully uninstalled 'MvvmCross.PortableSupport 3.2.1'.
Install failed. Rolling back...
Could not install package 'MvvmCross.PortableSupport 3.2.1'. You are trying to install this package into a project that targets 'portable-net45+win+wp80+Xamarin.iOS10+MonoAndroid10+MonoTouch10', 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 changed the profile to 259 and it is working.
And in case anyone doesn't know how to change the profile:
In Solution Explorer, right click on the project name and select Edit Project Profile. Look for the line:
<TargetFrameworkProfile>Profile158</TargetFrameworkProfile>
and change Profile158 to Profile259. Make sure that the line below it:
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
is set to v4.5 and not v4.0, or you will get an error message when trying to reload the project. To reload the project just right click on the project name again in Solution Explorer and select reload project.

The problem is that the Xamarin.iOS framework, which is a new framework for iOS Unified projects, is not treated as an optional framework by NuGet 2.8.2 (2.8.50313.46) or older when installing a Portable Class Library (PCL) assembly into a PCL project. NuGet 2.8.2 treats MonoAndroid and MonoTouch as optional but not Xamarin.iOS.
So your options are one of the following:
Install NuGet 2.8.3 alpha.
Remove the new Xamarin.iOS PCL profile xml files (Xamarin.iOS.Unified.xml).
NuGet 2.8.3 alpha has been modified so it is aware of the Xamarin.iOS framework and treats it as optional.
The new Xamarin.iOS PCL profile xml files were installed by one of the older Xamarin 3.6 releases. The latest Xamarin 3.6 release does not install the new iOS unified PCL profile xml files and requires a second installer which installs NuGet 2.8.3 alpha and the new profile xml files.
If you go for option 2) please be aware that doing so will prevent the installation of NuGet packages, such as MvvmCross.PortableSupport into a Xamarin.iOS Unified project.

Related

Failed to install ClosedXML dependency

I need to install ClosedXML dependency to build a C# project with .net framework 4.7.2 but when trying to install I always get the same error: "Cannot resolve dependency 'SixLabors.Fonts'. Sources used: 'nuget.org', 'Microsoft Visual Studio Offline Packages'"
I have tried everything to install from the nuget package manager
What version are you trying to install? I think you should install SixLabors.Fonts first and then install ClosedXML, as the newer versions of ClosedXML depend on it.
I faced the same proplem when trying to install ClosedXML today. ClosedXML depends on the SixLabors.Fonts library which is only available in beta at the moment.
To find the library with the NuGet Browser, make sure to check the "Include prerelease" box. You should then be able to find it listed below. After installing SixLabors.Fonts, you should be able to install ClosedXml without any further issues.

Nuget Visual Studio 2022 control dependency version

Whenever I try to install any package from Nuget through Visual Studio 2022 - be it the GUI or package manager console, I can't seem to find a way to get the highest dependency version.
For example: if I add latest version 1.0.152 protobuf-net.Grpc to my project it has a dependency on Grpc.Core.Api >= 2.36.1. The current version for Grpc.Core.Api is 2.46.3...
In the GUI under options I have no option to control dependency version what so ever it seems like the Install-Package cmdlet doesn't obey -DependencyVersion Highest:
Install-Package protobuf-net.Grpc -DependencyVersion Highest
Installing NuGet package protobuf-net.Grpc 1.0.152.
Committing restore...
Successfully installed 'Grpc.Core.Api 2.36.1'
Successfully installed 'Microsoft.NETCore.Platforms 2.1.0'
Successfully installed 'protobuf-net 2.4.6'
Successfully installed 'protobuf-net.Grpc 1.0.152'
Successfully installed 'System.Memory 4.5.3'
Successfully installed 'System.Private.ServiceModel 4.5.3'
Successfully installed 'System.Reflection.DispatchProxy 4.5.0'
Successfully installed 'System.Security.Principal.Windows 4.5.0'
Successfully installed 'System.ServiceModel.Primitives 4.5.3'
How can I force Nuget to install the highest dependencies version?
According to your description here are some suggestion:
First check your project type “-DependencyVersion Highest” only used in packages.config format.
You can see the project type support about two package management formats: Projects.config and PackageReference.
Someone posted a similar issue on github, see the issue here. Hope this help you.
If you want to use “Grpc.Core.Api 2.46.3 “, you can try to delete the bin and obj folder and then go to Tools>Options>Nuget Package Manager>General>Clear All Nuget Caches.
Then you can install Grpc.Core.Api 2.46.3 package before install protobuf-net.Grpc 1.0.152

Can't Install Package

I Was Trying to Install this package but this keeps getting error. I also Tried Changing The Target Framework to 4.7 and 4.7.2
Installing 'Anviz.SDK 2.0.4'.
Successfully installed 'Anviz.SDK 2.0.4'.
Adding 'Anviz.SDK 2.0.4' to Anviz.
Uninstalling 'Anviz.SDK 2.0.4'.
Successfully uninstalled 'Anviz.SDK 2.0.4'.
Install failed. Rolling back...
Could not install package 'Anviz.SDK 2.0.4'. 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.
Moving from a comment to answer to get full resolution of the issue.
The problem is that the package in question supports netstandard2.0 and Visual Studio 2013 as a toolset does not recognize the netstandard2.0 framework. You'd need a newer Visual Studio version to take a dependency on this package.

Markdown nuget installation failed

I get this error when I try to install markdown.
Installing 'Markdown 2.2.1'.
Successfully installed 'Markdown 2.2.1'.
Adding 'Markdown 2.2.1' to SimpleCMS.
Uninstalling 'Markdown 2.2.1'.
Successfully uninstalled 'Markdown 2.2.1'.
Install failed. Rolling back...
Could not install package 'Markdown 2.2.1'. 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'm using Microsoft Visual Studio 2013 and I'm on Windows 10. I tried updating the Nuget Package Manager but to no avail.
Markdown 2.2.1 depends on .Net Framework version 4.5.1
The error suggests you're trying to install it in a project targeting .Net framework 4.5
Two options:
Install Markdown 2.1.0
Update the target .Net framework for your application. This would generally be frowned upon, if you're writing a commercial application. Fine if it's just yours.
From the package manager console, you can do:
Install-Package Markdown -Version 2.1.0

Caliburn.Micro NuGet Install Fails on Portable Class Library Project

I am attempting to instal the Caliburn.Micro-Contrib NuGet package into an empty PCL project in VS 2013 Professional.
I get the following error from NuGet when attempting to install the package:
Attempting to resolve dependency 'Caliburn.Micro (≥ 1.3.1)'.
Installing 'Caliburn.Micro 1.3.1'.
Successfully installed 'Caliburn.Micro 1.3.1'.
Installing 'Caliburn.Micro-Contrib 1.0.2'.
Successfully installed 'Caliburn.Micro-Contrib 1.0.2'.
Adding 'Caliburn.Micro 1.3.1' to ClassLibrary2.
Uninstalling 'Caliburn.Micro 1.3.1'.
Successfully uninstalled 'Caliburn.Micro 1.3.1'.
Install failed. Rolling back...
Could not install package 'Caliburn.Micro 1.3.1'. You are trying to install this package into a project that targets 'portable-net40+win+wpa81+MonoAndroid10+xamarinios10+MonoTouch10', 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.
What is the cause of the problem and how can I fix this?
Note the package installs successfully for a standard class project but not for PCL projects. The PCL is intended to be a Xamarin Android and iOS project.
It doesn't appear that Caliburn.Micro Contrib has a PCL Compatible package. It also depends on the full (not PCL) version of Caliburn Micro. Also note that it appears that Xamarin support is only available in the pre-release beta of Caliburn Micro.

Resources