0

I have a WPF application which uses an external library, PDFNet. The whole project uses Wix to create MSI for x86 or x64 builds (Not AnyCpu). These MSI's are later combined with some external resources to create a single exe installer by means of InnoSetup.

The problem is that I need to include the correct version of PDFNet in the correct build, and visual studio always uses 32-bits.

Could someone please point me in the right direction on how to set it up correctly?

Thank you.

Pavel Gurov
  • 5,587
  • 3
  • 26
  • 23
Pepsin
  • 23
  • 8
  • VS does *not* mind that you create a 64-bit program. But that has to get started first by you using the correct flavor of PDFNet and setting up your project so your program actually runs in 64-bit mode. Project > Properties > Build tab, set the Platform target to AnyCPU and untick the "Prefer 32-bit" option. Look around some more, this is supposed to be discoverable. – Hans Passant Aug 25 '16 at 16:07
  • Hello, Unfortunately AnyCPU option is not possible due to the installer (not done by me, unfortunately I am begginer in installers and pressed by time, I prefer to aviod rewriting it). Only Release-x86, or Release x64-x64. I have tried to look around for some time. What puzzles me is how exactly are specific versions of PDFNet distributed to build. If I set on both of them (loader and pdf net) copy local = true, then I get wrong version. If i don't copy them, I get error that they can't be found. – Pepsin Aug 26 '16 at 07:44
  • Of course it is possible. For your 32-bit installer you can set it to x86. For your 64-bit installer you *must* set it to AnyCPU so it can run in 64-bit mode. Add a configuration to your project so you can build both flavors. You have to get the correct flavor of PDFNet copied, best to do that in a post-build event. Ask somebody in your team to help you out, not exactly beginner stuff. Or just don't bother, if it *has* to work in 32-bit mode than there is no point in also targeting x64. – Hans Passant Aug 26 '16 at 07:59
  • Unfortunately another included library, CEFSharp, didn't like Any CPU, so i am now on the way to build PDF 32-bit only. At this moment i am in process of replacing PDFLoader.... – Pepsin Aug 26 '16 at 09:15

1 Answers1

0

It seems to work. So: Whole thing was problem in wrong combination of 'copy local' seetting of PDFNet and PDFNetLoader. Correct setting of PDFNet is false in all projects and Loader true everywhere. If I understand correctly when loading of PDFNet fails, loader intervenes and loads correct version of assemlby from folder in \bin\PDFNet\PDFNet\x86 (or x64 respectively)

PS: Check whole discussion from answer above, was quite helpfull

Pepsin
  • 23
  • 8