Search code examples
c#wpfcom.net-4.5powerpoint

Application is not being deployed with a needed DLL


My WPF application uses Microsoft.Office.Core module. I had to add a proper reference which, in my case, was "Microsoft.Office 16.0 Object Library".

From my experience with Visual Studio adding a reference to a project is a way to ensure that needed DLLs will be copied while deploying the application. For all other references, which were not in the COM tab, it works like that. However this office library is not being shipped with the application. The result is that my app crashes if office is not installed in the system.

Why needed DLLs are not copied after adding a reference to them?


Reference manager in my Visual Studio looks similar to this one. Right clicking does not seem to do anything.

Reference manager image

I am using Visual Studio 2013 Express for Window Desktop


Solution

  • Right click this dll in reference, choose Properties, set "Embed Interop Types" to False, and set the "Copy Local" property to true.

    See this picture for more detail