Copy all dependencies from .Net Standard libraries to .Net Framework Console application

After going through an article by Scott Hanselman, below solution worked like a charm.

Using .NET Standard requires you to use PackageReference to eliminate the pain of “lots of packages” as well as properly handle transitive dependencies. While you may be able to use .NET Standard without PackageReference, I wouldn’t recommend it.”

Add below line in the first “PropertyGroup” tag of the .net framework console application’s “.csproj” file

<RestoreProjectStyle>PackageReference</RestoreProjectStyle>

There will not be any need to add again the .net standard projects’ nuget dependencies in the console application.

Leave a Comment