I have a .netstandard (V2.0) project (called X) that has dependency on Newtonsoft.Json (V 13.0.1) through package reference.
There is a .net 5.0 library project (Called B) that references X. When I build the project "B", in bin folder I can see the X.dll but the "Newtonsoft.Json" dll file is not copied.
If I add "Exe" to project B, it will copy "Newtonsoft.Json" dll to bin folder.
<OutputType>Exe</OutputType>
How can I make the simple library project (B) to have X and its dependencies?
Update
The suggested approaches and answers, like "dotnet publish" and "CopyLocalLockFileAssemblies" does not work in this case. The important reason is that the library "A" should be published as Nuget package and be used in other projects. So when referenced, we need the "Newtonsoft.Json" dll be imported like A.dll.