I'm making a WiX/MSI installer that uses a custom action DLL written in C#. Inside that custom action I'm pinvoking a native/unmanaged DLL. Here's an example:

```
    [DllImport("log.dll",
        CharSet = CharSet.Unicode,
        SetLastError = true,
        CallingConvention = CallingConvention.StdCall)]
    static extern int CloseLog(IntPtr hLog);

```

The problem is that when my MSI runs and I invoke the custom action my call to `CloseLog` throws the `DllNotFoundException` exception.

I can manually add a link to `log.dll` into my custom action C# DLL project:

[![enter image description here](https://i.stack.imgur.com/BYtmW.png)](https://i.stack.imgur.com/BYtmW.png)

But the problem is that there's no way to specify which build of the `log.dll` to use from a C# project, i.e. x86/x64/debug/release.

So any suggestions how to do it?