Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

What is dnu wrap for?

The documentation is unclear, it seems like it allows for wraping dlls and csproj for use in a Asp.Net Core 5 application. Does it allow you to use class libraries built against .Net Framework 4.6 in a .Net Core 5 website?

like image 560
rjdevereux Avatar asked Oct 30 '22 15:10

rjdevereux


1 Answers

You are correct in that dnu wrap allows you to pull in legacy code into ASP.NET 5 applications that are targeting the right frameworks. All dnu wrap is doing here is creating a project.json for the dll/csproj and if you're running via Visual Studio then also a reference to that project.json (but you can add the reference manually).

Because no code is actually changing here (or dependencies etc), you cannot use dnu wrap to pull in assemblies that target a runtime that your project does not otherwise target and expect it to build, unless of course you update your project to target that runtime and reference any required dependencies.

Thats all it does.

From dnu --help;

Wrap a csproj/assembly into a project.json, which can be referenced by project.json files.

like image 67
Stafford Williams Avatar answered Nov 15 '22 05:11

Stafford Williams