5

I built an application in dotnet core 3.1 and after build i see in bin folder Lots of dlls and xmls here screen shot dll hell

And I want it to look like this enter image description here

someone can please help me :-((((

doronazu
  • 140
  • 1
  • 6
  • 1
    You have 2 answers under this link https://stackoverflow.com/questions/1996358/how-to-move-all-referenced-dlls-into-seperate-folder-in-c – BlueCompany Jul 23 '20 at 22:43
  • @Adriani6 I think he wanted to structurize his output, not just change output folder path. Or I am missing something? – BlueCompany Jul 23 '20 at 22:46
  • @BlueCompany No, I missed the exe in the root directory on the screenshot, good spot though :) – Adrian Jul 23 '20 at 22:58
  • BlueCompany -- i tried this 2 but i have dot net core not dot net framework so my app work with out app.config and PrettyBin not working – doronazu Jul 23 '20 at 23:09
  • Found another source: https://weblog.west-wind.com/posts/2019/Apr/30/NET-Core-30-SDK-Projects-Controlling-Output-Folders-and-Content but is to late for me to test it. Nice question tho. – BlueCompany Jul 23 '20 at 23:43
  • (a) I would strongly suggest not messing with it and adding another layer of possible issues. (my opinion)....but (b) consider this :: dotnet publish /p:PublishSingleFile=true for your released code – granadaCoder Jul 24 '20 at 19:22

1 Answers1

2

In .net framework you can use AssemblyBinding probing in app.exe.config and use Post Build Events Command Line in Visual Studio to move your dll and xml in the custom folder.

In .net core 3.1 additionalProbingPaths seems doesn't work fine but you can still use Post Build Events Command Line to move your xml in the custom folder.

Note:
1. AssemblyBinding probing and additionalProbingPaths will affect your assembly load dll location.
2. If you don't know Post Build Events Command Line see the guide line.

See the below issues about probing path.
Additional probing paths for .NET Core 3 migration
donet/sdk issue.

Finally I found nulastudio.NetCoreBeauty library which seems like you want feature.

Changemyminds
  • 1,147
  • 9
  • 25