How to update dotnet core package - .net-core

A vulnerability found in my project is below
Then tried to find this version of the project. but I didn't find any package directly using in my dotnet core project.
Then I found some dependency package in obj/project.assets.json
something like below
Then I again searched Microsoft.AspNetCore.Authentication.Core in visual studio manager. But not found any package.
My question is how to update this package in my dotnet core project ?

Related

EntityFrameworkCore nuget packages confusion in Asp.net Core

I'm trying to create a web application / api using the dot net core.
for the database I choose Microsoft SqlServer, and EntityFrameworkCore as ORM
in previous versions like Asp.Net MVC 5 i used like this:
Install-Package EntityFramework
and i was able to work with Migrations, DbContexts ...
but now with dot net core I saw that I have to install multiple EntityFramework nuget packages, I saw this in multiple tutorials and also in real world.
developers installing the following packages without explaining why:
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.Design
Microsoft.EntityFrameworkCore.Relational
Microsoft.EntityFrameworkCore.SqlServer
Microsoft.EntityFrameworkCore.Tools
I googled it so it turns out that I need only these:
Microsoft.EntityFrameworkCore
Microsoft.EntityFrameworkCore.Sqlserver
Microsoft.EntityFrameworkCore.Tools
because the Tools package brings up the Design package from this post : Purpose of package "Microsoft.EntityFrameworkCore.Design"
the question is which packages do we need in dot net core to use entityframeworkcore in our project?
You only need:
Microsoft.EntityFrameworkCore.Sqlserver
(It depends on .Relational)
If you need to run EF Core commands in VS Package Manger console install:
Microsoft.EntityFrameworkCore.Tools
If you want the dotnet CLI EF Core tools run:
dotnet tool install --global dotnet-ef
If you are using .net 5 you need to specify the version that the package is for.
But first you need to open the package manager console. That is from View->Other Windows->Package Manager Console. There you need to make sure that the default project is the project you want to work with.
Like this
Then run these commands in the package manager console:
1.
Install-Package Microsoft.EntityFrameworkCore.Tools -Version 5.0
Install-Package Microsoft.EntityFrameworkCore.SqlServer -Version 5.0
Install-Package Microsoft.EntityFrameworkCore.SqlServer.Design
(for the SqlServer.Design you don't need to specify the version)
(if you are using .net 6 just remove the "-Version 5.0" from the commands)

Which version of Microsoft.AspNet.Mvc is supported by .NETCoreApp v2.2?

I am working on a Ubuntu 18.04 environment using Visual Studio Code and .NET Core v2.2.
After including a few existing projects into a solution that I'm working on, I ran into errors when I tried to compile stating that the namespace "Microsoft.AspNet.Mvc" could not be found.
So, I added a package reference for the projects that were complaining by using the dotnet CLI:
dotnet add package Microsoft.AspNet.Mvc --version 3.0.20105.1
But now when I try to dotnet restore or dotnet msbuild the solution file, I'm getting warnings reporting that:
warning NU1701: Package 'Microsoft.AspNet.Mvc 3.0.20105.1' was
restored using '.NETFramework,Version=v4.6.1' instead of the project
target framework '.NETCoreApp,Version=v2.2'.
This package may not be fully compatible with your project.
I would like to figure out which package version of Microsoft.AspNet.Mvc I need to install in order to be compatible with .NET Core v2.2.
I realize that this is just a warning and using the .NETFramework v4.6.1 may be okay, but I have been debugging a very strange issue that is only happening on a Ubuntu environment, so I would like to determine whether package versioning is a problem.
I have tried Google searching to determine which version of MVC is compatible with .NET Core 2.2, but I have yielded any useful results.
Does anyone know the answer to this question? Or would you be able to point me in the direction of a source that can answer it?

Using .netstandard2.0 NuGet with .NetFramework4.6.2

I have a project in .NetStandard2.0 and this has to be used as a nuget in 2 projects, one in .NetCore2.2 and the other in .NetFramework4.6.2. Installing the nuget in .NetCore2.2 had no issues, but when I'm trying to install this package in the other project, I'm getting the following error -
Could not install package 'packageName'. 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.
I also tried changing the target framework of this project from .NetFramework4.6.2 to .NetFramework4.7.2, but I'm getting the same error. Am I doing something wrong?
I had opened the Framework project in Visual Studio 2015 and this was causing the issue on trying to install the nuget package which was created in .NetStandard2.0. It was successfully installed when I tried it in Visual Studio 2017.

List all the nuget packages with "dependencies recursively" for a given project/Solution for .NET Core project in VS2017

I want to list down all the nuget packages along with its dependencies recursively.
Project is in VS2017 and .NET Core.
I tried with Get-Package -ProjectName "Your.Project.Name" it displays all the nuget packages in project. I want all the dependencies also printed.
You can use the dotnet cli: dotnet list package --include-transitive. The dotnet-outdated global tool probably has similar functionality.

Not able to Install Unity in VS2010

I am trying to install Unity from Nugget in VS2010 and receiving following error:
Could not install package 'Unity 3.5.1404.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. For more information, contact the package author.
Any Idea what could be Wrong?
I understand this package is not for VS2010 but for VS2012 or later. What is the way to get this package for VS2010 or VS2008?
Cheers
The problem is that Unity 3.5 requires .NET 4.5.

Resources