Search code examples
visual-studio-2010c#-4.0xnapublish

Visual Studio 2010 does not include C++ dlls in C# project when published


I have the following dependancies:

C++ library <- C# library <- C# application

Problem: When I publish the C# application the C++ dlls are not included

How do I tell Visual Studio to also include the C++ dlls? (Note: since this is only a small project, a quick fix would already be enough)


Solution

  • You can solve this by including the C++ DLLs as files within the project. (Project->Add Existing Item)

    Then you right-click the DLL -> Properties and set the Build Action to Content, and select the Copy to Output Directory to either Copy Always or Copy if newer.