I am building a WPF application in .NET Core 3.1 and willing to restructure my build directory. Right now it looks like this:
What I want to achieve is something like this:
The above example of I want to achieve is rather perfect, but I am not sure if it is possible at all. However, my goal is to minimize the amount of files that are kept at the output directory alongside the executable file.
I've looked up various solutions but they all seem to work only for .NET Framework. My guess is that it happens because the latter uses packages.config file and .NET Core 3.1 and above all use PackageReference formats.
What I've tried:
Installing PrettyBin NuGet package. This theoretically allows to control the structure of the output folder, but only works in .NET Framework
Following this link: Build DLL to a separate folder But, it makes use of App.config file which also exists only in .NET Framework projects.
How to save DLLs in a different folder when compiling in Visual Studio? Also makes suggestions only based on .config file as far as I understood.
This article: https://weblog.west-wind.com/posts/2019/Apr/30/NET-Core-30-SDK-Projects-Controlling-Output-Folders-and-Content I've tried that, but for some reason it was not changing the output directory as was suggested, but perhaps I was doing something wrong.
P.S: I've tried doing the same in .NET 5.0 and willing to migrate to the latter soon, so any solution for .NET 5.0 is also appreciated.