1

I have a project with a CLI application and a DLL, which is a dependency of the CLI application.

The DLL project contains a native DLL, which is used by means of P/Invoke. This DLL is marked as Content. When I build my project, the DLL is copied to the output directory and my application runs fine.

When I publish a ClickOnce deployment. The DLL is not included in the resulting package and my application will fail to run correctly.

Answers to similar questions always recommend setting the file to Content, which I already have and which has no effect on the issue. Other answers suggest to make sure the file is included in the Application Files section of the publishing options, but the file is not listed there.

3
  • If the file isn't listed in the Application Files section, then that's a problem. Try ticking "Show all files" and see if you can find it in the list - if you can, change the publish status to include, the download group to required and the hash to include. Mar 31, 2016 at 9:22
  • @MatthewWatson "Show all files" only lists the .pdb files. Mar 31, 2016 at 9:26
  • have same issue!
    – dimzon
    Aug 15, 2019 at 10:17

1 Answer 1

0

I found Why doesn't ClickOnce in Visual Studio deploy content files from dependent assemblies? and tested proposed solutions. None of them worked for me.

I then realized that the behavior was probably broken in a Visual Studio update after reading Click-once publish addtional files stopped with VS 2012.

So, in the end, the only thing that worked for me was to simply add the DLL to my main CLI application. Which is very frustrating.

3
  • We have a number of ClickOnce applications that use unmanaged DLLs and install the files automatically if we add them to the project as you are doing. They all work fine (we're using VS2015, but it also works with VS2012 and VS2013), so I'm not sure why it's not working for you... Mar 31, 2016 at 10:47
  • @MatthewWatson It works just fine if the file is added to the published project. It's not working when the file is added to a referenced dependency. Mar 31, 2016 at 11:29
  • Oh! Sorry, I misunderstood that part. Then that's how we have to do it: We need to add the DLL to the ClickOnce application explicitly, like you do. Mar 31, 2016 at 11:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.