DLL file not referenced after publishing wpf.

Misab 21 Reputation points
2021-11-16T12:21:06.697+00:00

I am new to deploying wpf in .net. I am building a form over a previous project. It contains 2 dll files for 32 bit and 64 bit machines. I can access the dll files when debugging. But when I deploy it, its not referenced at all. I tried to reference it by clcking add references i am getting the following error.

149841-dllerror.png

can anyone help?

Windows Presentation Foundation
Windows Presentation Foundation
A part of the .NET Framework that provides a unified programming model for building line-of-business desktop applications on Windows.
2,666 questions
C#
C#
An object-oriented and type-safe programming language that has its roots in the C family of languages and includes support for component-oriented programming.
10,196 questions
0 comments No comments
{count} votes

Accepted answer
  1. Michael Taylor 47,711 Reputation points
    2021-11-16T16:09:31.877+00:00

    You cannot reference both x86 and x64 DLLs in the same process as only the DLL that shares the bitness can be loaded.

    Your specific issue is that you want to deploy binaries that may or may not be used in the app. To do that you'll need to add a post-build event to copy the DLLs that you need. This is pretty common actually especially when you're using something like DllImport.


0 additional answers

Sort by: Most helpful