Home > Software design >  Purpose of the .deps.json file in .NET and can I avoid it?
Purpose of the .deps.json file in .NET and can I avoid it?

Time:05-24

Recently we've started migrating to .NET 5/6 to get the most out of new C# versions amongst other reasons. We make WPF apps using MSI installers to distribute.

Looking at one of our projects, I noticed some new files that we may need to add into our installers. In particular, I noticed the addition of a .deps.json file in the output. My question is: is this absolutely necessary for any .NET exe application to run?

The way I see it, the end user will only have the runtime, and no Nuget to install any missing libraries. All the required dlls, either from referenced projects or packages, are included in the output folder, as is expected in .NET Framework, so surely we don't need the deps.json file just to tell .NET runtime where the dlls are?

Is there any way to avoid needing a .deps.json file? Are there any other changes we should look out for when authoring our MSIs when using .NET 5/6?

Thanks for any help.

CodePudding user response:

This file not only describes your dependencies packages but also helps to solve the dependency hell. In .Net Framework, you had an app.config file with assemblyBinding that told you what version of dependency to load. In .Net .deps.json, does this work.
You can find more info here: Deep-dive into .NET Core primitives: deps.json, runtimeconfig.json, and dll's

  • Related