9

I have a C# project (let's call it Driver) that uses an unmanaged DLL to interact with some hardware. I have another project that references Driver. When I build the project, the unmanaged DLL gets copied to the output directory as I want. However, when I publish the project as a ClickOnce application, the DLL does not get included in the application's files.

In the Application Files in project properties under Publish, I can see Driver's managed DLL, but the unmanaged DLL is not listed.

I'm certain there's an easy fix for this, but searches mostly lead to questions about including unmanaged DLLs in projects.

Thanks in advance,

Bjørn

Bjørn Madsen
  • 378
  • 2
  • 17

1 Answers1

5

After researching this some more, it seems that the solution is to add the DLL as an existing item in all the projects that use it. It seems, however, very clunky if you have multiple projects depending on it.

Bjørn Madsen
  • 378
  • 2
  • 17
  • You can add your dlls at a solution level, then add links of them in various projects, so you have the actual files only in one place – Phate01 Jun 04 '21 at 15:05