Migrating .NET assemblies from an application database?

I have a WinForms application with a bunch of third-party links. This makes the output folder rather confusing. I would like to put the compiled / referenced dlls in a shared subdirectory in the bin / lib output folder - whatever - and just have the executable files (+ necessary configs, etc.) located in the output folder.

After some searching, I came across assembly probing ( http://msdn.microsoft.com/en-us/library/4191fzwb.aspx ) - and confirmed that if I installed it and manually moved the assemblies my application will work if they are stored in the specified subdirectory:

<configuration>
  <runtime>
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
      <probing privatePath="bin" />
    </assemblyBinding>
  </runtime>
</configuration>

However, this does not solve the assembly part - is there a way to indicate where the link assemblies and library assembly assemblies go?

Only solutions that I can think of from my head are either post-assembly actions, or abandoning an idea, and using ILMerge or something like that.

There should be a better way to define the structure :-)

+3
source share
1 answer

If you are building in Visual Studio, you can definitely customize post-build actions — they work very well. I really don't think there are other good, documented ways to do this. Unfortunately, when you reference another assembly, there is no way to determine where to copy the DLL referenced during the assembly, I believe.

, , (app)\bin (app)\lib , .

, , , DLL .

+1

Source: https://habr.com/ru/post/1737899/


All Articles