Caliburn.Micro NuGet Install Fails on Portable Class Library Project - xamarin

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.

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.

All nuget packages requiring net6.0 are "not compatible with net6.0" even after complete Windows reset

After booting up my PC I tried to continue using a previous project I had been working on:
ASP.NET MVC Core 6.0.
All of a sudden Microsoft.EntityFrameworkCore was not installed in the solution.
After trying to reinstall the Microsoft.EntityFrameworkCore nuget package I received the following errors:
Package restore failed. Rolling back package changes for 'BulkyBook' (my project)
NU1202: Package Microsoft.Extensions.Logging 6.0.0 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Microsoft.Extensions.Logging 6.0.0 does not support any target frameworks.
NU1202: Package Microsoft.Extensions.Options 6.0.0 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Microsoft.Extensions.Options 6.0.0 does not support any target frameworks.
... for all dependencies AND
NU1202: Package Microsoft.EntityFrameworkCore 6.0.5 is not compatible with net6.0 (.NETCoreApp,Version=v6.0). Package Microsoft.EntityFrameworkCore 6.0.0 does not support any target frameworks.
When trying to install ANY nuget packages requiring net6.0 I get the same issue.
I have done a reset of Windows (keeping files but losing all programs) and fully reinstalled Visual Studio 2022.I still have the same issue.
This is killing me, I'm willing to try anything.
Image for proof:

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

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

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.

Resources