All nuget packages requiring net6.0 are "not compatible with net6.0" even after complete Windows reset - asp.net-core-mvc

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:

Related

Visual Studio won't accept UWP version for Nugget package?

This is driving me nuts!
I'm trying to install Microsoft.Build. Using Nugget Manager I can successfully install Microsoft.Build.Framework but not Microsoft.Build. I've upgraded to the latest version 1903 (build 18362), but still get the error:
Severity Code Description Project File Line Suppression State
Error NU1202 Package Microsoft.Build 16.5.0 is not compatible with uap10.0.18362 (UAP,Version=v10.0.18362) / win10-x64. Package Microsoft.Build 16.5.0 supports:
- net472 (.NETFramework,Version=v4.7.2)
- netcoreapp2.1 (.NETCoreApp,Version=v2.1)
But the framework requirements for both are the same? Anyone seen this or have some idea what the problem is?
thanks
The reason for your issue is that: Microsoft.Build Nugget package does not support UWP project. So you can't install the Nuget package in UWP projects.

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.

Unable to install nuget packages in xamarin android project

I am facing a very strange issue regarding installing NuGet packages in the xamarin android project. When I try to install any NuGet package in xamarin android project getting an error.
Here is the error message I am getting from the NuGet package manager.
?Restoring packages for E:\Projects\Sample\Sample1\Sample2\Smaple3\SampleApp.Android\SampleApp.Android.csproj...
NU1202: Package Microsoft.WindowsAPICodePack.Shell 1.1.0 is not compatible with monoandroid81 (MonoAndroid,Version=v8.1). Package Microsoft.WindowsAPICodePack.Shell 1.1.0 supports: net (.NETFramework,Version=v0.0)
NU1202: Package Microsoft.WindowsAPICodePack.Core 1.1.0 is not compatible with monoandroid81 (MonoAndroid,Version=v8.1). Package Microsoft.WindowsAPICodePack.Core 1.1.0 supports: net (.NETFramework,Version=v0.0)
Package restore failed. Rolling back package changes for 'SampleApp.Android'.
Time Elapsed: 00:00:01.9192186
========== Finished ==========
Installed packages in the Android project:
Remove Microsoft.WindowsAPICodePack from your PCL, since you are having a reference of it in the PCL and then your Android project refers the PCL that works like an indirect reference hence it is causing the issue.
Solution: remove the package from PCL project

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