Correct assembly action when adding a non-referenced DLL to a .NET project in Visual Studio

Suppose I want to include a DLL in a Visual Studio project that will not be a link. In my case, it will be a custom trace listener, but there could also be a DLL that I load through the runtime binding. I do not want to add it as a link, because I do not want to introduce the possibility of any of my code that statically refers to it by accident.

So, if I add a dll to the project, I have to set the build action as “No” or “Component”. I set the Copy to Output Directory property to Always Copy

+3
source share
1 answer

"Content" may be more appropriate, as I believe that it includes it by default when publishing a project, whether through msi (installer) or ClickOnce.

+4
source

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


All Articles