Have visual studio copy x64 DLL or x86 DLL when building a C# project

Posted by MrPurpleStreak on Stack Overflow See other posts from Stack Overflow or by MrPurpleStreak
Published on 2010-04-28T09:26:51Z Indexed on 2010/04/28 9:33 UTC
Read the original article Hit count: 229

Filed under:
|
|

We're building a C# app that uses an external DLL for Sqlite.NET. This is a .NET dll but it embeds a C dll inside it and so it comes in x86 and x64 flavours.

We add a reference to the x86 version in the project so when we build and run on x86 it's fine. Visual studio copies the dll to the bin folder and runs.

On x64 it still copies the x86 version of course and then when it runs it fails to load it. We get round this by temporarily setting our project to be x86 only, but ideally we'd like to tell visual studio to copy the correct version depending on which flavour of machine it is.

Any ideas how?

© Stack Overflow or respective owner

Related posts about visual-studio

Related posts about x64