I want publish .NET Core 3.1 project as self-contained. All build, saves, but in root folder so many dll like System.Collection.dll
, System.IO.dll
etc. How put these libs in custom folder?
Visual Studio publish self-contained, put .NET dll's in different folder
Asked Answered
That doesn't work without extra work on your end to find them again later. It's best (and by far easiest) if you just leave it the way it is. Why do you care? –
Solicit
Pre .NET Core you were able to use the probing paths in the .exe.config. IIRC that doesn't work in .NET core anymore but there seems to be a workaround. –
Reba
Sad news that is doesn't work... Ok, thanks! –
Knickerbocker
@PMF, I care because I'm going to hand this off to somebody, and it is a huge pain to say, "Go find this one .exe to run amid the clutter." If I could push all of those runtime DLLs to another location, like a lib folder or something, the burden on people using it is easier because there's like one Program.exe (or at least far fewer files). I think there's an extremely compelling reason to care. –
Paryavi
I see, that makes sense. Have you tried single-file-publishing? learn.microsoft.com/en-us/dotnet/core/deploying/single-file/… I have not used this before, so I don't know how well it works. –
Solicit
I think this is quite an important issue: having your root folder with all these runtime assemblies is not user friendly. Why not add the possibility of creating a subfolder for the self-contained runtime? –
Multinuclear
Using the nuget package 'NetBeauty' does exactly what is asked here. https://github.com/nulastudio/NetBeauty2
© 2022 - 2025 — McMap. All rights reserved.