1

using Fody/Costura to embedding dll file to single file is ok and all works good . but if i physically put dll file in executable folder and run application , application hook dll file and when i want to edit or delete dll file it throw an exception that this file is use , is it possible to solve this problem ?

--Update using AppDomain.CurrentDomain.AssemblyResolve += CurrentDomain_AssemblyResolve; we can handle resoloving library . but if dll file exist in bin filder this method not fired to set loading library

Moslem7026
  • 3,290
  • 6
  • 40
  • 51
  • Why not use single-file deployment in .Net core 3+? looks like custora is in maintenance mode due to this. – JonasH Oct 04 '22 at 06:20
  • Well, don't run the application that is using the DLL (or exit it), and then the DLL should not be in use, allowing you to edit/delete the DLL... –  Oct 04 '22 at 06:22
  • The alternative is trying to forcefully close any file handles of this DLL file (https://stackoverflow.com/questions/26645584/how-to-close-a-system-handle-or-some-open-file-handle-in-another-process), but i can't tell if this will be easy with memory-mapped files such as DLLs. Doing this will inevitably make _any_ running apps using this DLL unstable, leading to those apps crashing when they attempt to call any code in the DLL they lost access to... –  Oct 04 '22 at 06:28
  • @JonasH I am using .net Framework – Moslem7026 Oct 04 '22 at 06:51
  • @MySkullCaveIsADarkPlace two app in some folder are usinng same library and i want to update other , at this time because library is in use . it cant modify . so i want to embedded one – Moslem7026 Oct 04 '22 at 06:53

0 Answers0