1

I have built and published a nuget package from a netStandard2.0 project containing unmanaged runtime specific dlls. I did this by adding following ItemGroup to my csproj file.

  <ItemGroup>
    <Content Include="x64\**" PackagePath="runtimes\win-x64\native" Visible="true" />
    <Content Include="x86\**" PackagePath="runtimes\win-x86\native" Visible="true" />
  </ItemGroup>

It creates me a nice nuget package with all may native dlls on board.


Then I reference the package in a WPF application (net48) and everything works as expected. When I build the project for x64, only the dlls from the runtimes\win-x64\native folder are copied to the projects build output directory. Same for x86. This is exactly what I want.

But when I publish the app as ClickOnce the unmanaged dll's are missing in the Application Files folder of the ClickOnce Installer.

All I get is a warning: MSB3331: Unable to apply publish properties for item "vcruntime140". (for the vcruntime140.dll as example)

Is there a way how I can get the native dll's into the ClickOnce installer?

Quergo
  • 888
  • 1
  • 8
  • 21
  • 1
    Go to the `Publish` tab in the project properties, click on `Application Files...` and include the missing files. You may need to check the `Show all files` checkbox –  Jul 16 '19 at 01:06
  • Checked that at first. The files were all included by default. – Quergo Jul 16 '19 at 09:15

0 Answers0