Unable to install Microsoft.Web.RedisSessionStateProvider into my vb.net project - vb.net

Could not install package 'Microsoft.Web.RedisSessionStateProvider 4.0.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.

Related

Error NU1101: Unable to find package ProjectABC.Core.Services. No packages exist with this id in source(s)

I am trying to implement CI/CD on Azure DevOps for my Asp.net Core project.
Project having Nuget packages from three different sources:
MSBUild in Azure Pipeline is going to find nuget packages in Offline Packages or Nuget.org only but not going to find external source which i am also using:
http://dev-abc-api-nugetserver-wi.azurewebsites.net/nuget/
I have tried below code in Azure Pipeline Build but that didn't work
/p:RestoreAdditionalSources="http://dev-abc-api-nugetserver-wi.azurewebsites.net/nuget/" /t:Rebuild
But still receiving same error:
Error NU1101: Unable to find package abc.Core.Services. No packages
exist with this id in source(s): Microsoft Visual Studio Offline
Packages, nuget.org
My build pipeline:
You need to create nuget.config file (and commit/check in to your project), in the file you need specify your NuGet sources (include your external source).
In your build pipeline add .Net core task with the restore command, specify your .csproj file and check the "Feeds in my NuGet config", create a NuGet endpoint with username & password for your external nuget repo.
After this task all your packages should be downloaded and the build should be run successfully.

install System.Net.Http to .net framework 4.0 project

I need use AuthenticationHeaderValue for getting token
var token = new System.Net.Http.Headers.AuthenticationHeaderValue("Basic", Convert.ToBase64String(Encoding.UTF8.GetBytes($"{username}:{password}")));
so I have to install System.Net.Http package but when I install it via package manager console it give that error
what should I do?
what is AuthenticationHeaderValue alternative?
Could not install package 'System.Net.Http 4.0.0'. 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.
Install System.Net.http version which is compatible to your .Net Framework

Unable to Install Microsoft.Toolkit.Uwp.UI.Controls 3.0.0

Using NuGet Package Manager, I get this error message:
Could not install package 'Microsoft.Toolkit.Uwp.UI.Controls 3.0.0'.
You are trying to install this package into a project that targets 'native,Version=v0.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. 0
The app is a Blank App (C++/winRT). Visual Studio 15.8.0 Preview 4.0.(10.0.17134.0, 10.0.17704.0)
Despite it's name, the Windows Community Toolkit is only intended for C# developers.

Unable to update NuGet package

Working with VS2015 I recently updated an add-on I use, ActiveReports, to a new version. Previously I had my application set for netframework 4.0, the new update for ActiveReports required at least netframework 4.5 so I changed the project to use that version.
I am getting the following error now when I build the project:
"Some NuGet packages were installed using a target framework different from the current target framework and may need to be reinstalled. Visit http://docs.nuget.org/docs/workflows/reinstalling-packages for more information. Packages affected: Microsoft.Bcl, Microsoft.Net.Http"
I have been looking at the various options suggested to address this none have worked. The last one I tried from Tools> NuGet Package Manager > Package Manager Console resulted in the following message:
PM> Update-Package
Attempting to gather dependency information for multiple packages with respect to project 'My Project', targeting '.NETFramework,Version=v4.5'
Attempting to resolve dependencies for multiple packages.
Resolving actions install multiple packages
Resolution was successful but resulted in no action
There are no new updates available.
No package updates are available from the current package source for project 'My Project'
I can reproduce this by:
creating a new project as .NET 3.5, installing NuGet package Newtonsoft.Json" (just for example).
Changing my project to .NET 4.5
Then I receive an error:
Severity Code Description Project File Line Suppression State
Error Some NuGet packages were installed using a target framework different from the current target framework and may need to be reinstalled. Visit http://docs.nuget.org/docs/workflows/reinstalling-packages for more information. Packages affected: Newtonsoft.Json ConsoleApp7 0
To resolve:
Uninstall the existing NuGet packages (for that project), and reinstall them:
How:
Right-click your Solution:
Choose "Manage NuGet Packages for Solution..."
Navigate to the "Project" you changed to .NET 4.5
Choose "Uninstall", then try to reinstall them, using the same steps.
After re-installation of the package is complete, the build error is gone.

Nuget Package cannot be installed in NET Core v1.1 Project

Trying to build a project with a reference to a package that should be compatible with .net core 1.1 but when nuget is restoring packages (VS.NET 2017 or the command line) I an see an error message
"One or more of the packages are incompatible with netcoreapp1.1"
The package name is
Microsoft.AspNetCore.DataProtection.AzureStorage
It says it is compatible with .NET Standard v1.5
And the error relates to dependencies of the package:
Microsoft.Data.Edm
Microsoft.Data.Services.Client
Microsoft.Data.OData
Microsoft.Data.Spatial
The csproj file has a package fallback setting:
<PackageTargetFallback>
$(PackageTargetFallback);portable-net45+win8+wp8+wpa81;
</PackageTargetFallback>
Not sure what the problem is
thanks
Michael