This may sound trivial, but I'm still trying to understand what's going on here.
My VSTO add-in contains the following projects (VS2022, .NET Framework 4.8):
- Addin (VSTO add-in, references #2)
- View (WPF control library, references #3)
- VM (Class library, references #4)
- DataAccess (Class library, references RestSharp nuget package)
When I build the project, #4 copies its DLL as well as RestSharp DLL to its output folder. Thereupon #3 copies its own DLL as well as the two DLLs coming from #4 to its output. But #2 does not copy RestSharp DLL to its output, only View, VM and DataAccess DLLs. #1 also follows the suite and ignores RestSharp DLL.
Why? Has this got anything to do with the fact that Data Access is targeting .NET Standard 2.0, unlike other layers which are targeting .NET Framework 4.8?
I have fixed the problem by adding RestSharp's NuGet reference to project #2 as well, but it feels like a hack to me. I'm just trying to understand how Visual Studio or MSBuild decides whether or not to include dependencies of referenced projects.