Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Publish unmanaged DLL from referenced project

Tags:

c#

dll

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

like image 567
Bjørn Madsen Avatar asked Apr 30 '12 12:04

Bjørn Madsen


1 Answers

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.

like image 183
Bjørn Madsen Avatar answered Oct 16 '22 10:10

Bjørn Madsen