Solved

Platform independent code with .NET

Posted on 2013-01-14
2
366 Views
Last Modified: 2013-02-01
Hi All

I have a Visual Studio project which handles two platform projects. One for 32 bit and one for 64 bit. I would like to keep a single project and a single setup (Deployment) to install both 64 bit and 32 bit platforms. So I am currently using "Any CPU" in the project as platform.
Most of my codes are working fine. But when I add a reference to SAP Business One DI API and UI API, this makes problems. It has both 64 and 32 bit versions.

My question is How can I use both project and setup.exe (Deployment) as a single entity with these references. That means it must run for 32 bit platform with 32 bit SAP reference and for 64 bit platform, SAP 64 bit reference?. Any kind of Conditional compilation will help on tihs?

Advance thanks for your help
Yours sincerely.
0
Comment
Question by:gopalv
2 Comments
 
LVL 30

Expert Comment

by:IanTh
ID: 38773881
0
 
LVL 42

Accepted Solution

by:
sedgwick earned 500 total points
ID: 38773891
here a full solution for your case:
Using Side-by-Side assemblies to load the x64 or x32 version of a DLL

the catch here is using custom assembly resolver which loads the right targeted dll for each platform.
0

Featured Post

Enabling OSINT in Activity Based Intelligence

Activity based intelligence (ABI) requires access to all available sources of data. Recorded Future allows analysts to observe structured data on the open, deep, and dark web.

Join & Write a Comment

A basic question.. “What is the Garbage Collector?” The usual answer given back: “Garbage collector is a background thread run by the CLR for freeing up the memory space used by the objects which are no longer used by the program.” I wondered …
Wouldn’t it be nice if you could test whether an element is contained in an array by using a Contains method just like the one available on List objects? Wouldn’t it be good if you could write code like this? (CODE) In .NET 3.5, this is possible…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…

707 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

17 Experts available now in Live!

Get 1:1 Help Now