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

前端 未结 2 595
我在风中等你
我在风中等你 2020-12-05 11:45

After consuming .net standard projects in a .net framework(4.6) console application, the dependencies of the .net standard projects are not copied into the output directory.

相关标签:
2条回答
  • 2020-12-05 12:01

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

    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.

    0 讨论(0)
  • 2020-12-05 12:06

    Another answer is to publish the project:

    dotnet publish -o path/to/output/folder
    
    0 讨论(0)
提交回复
热议问题