?
Solved

Platform independent code with .NET

Posted on 2013-01-14
2
Medium Priority
?
385 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
2 Comments
 
LVL 42

Accepted Solution

by:
sedgwick earned 1500 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

Veeam Task Manager for Hyper-V

Task Manager for Hyper-V provides critical information that allows you to monitor Hyper-V performance by displaying real-time views of CPU and memory at the individual VM-level, so you can quickly identify which VMs are using host resources.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

IP addresses can be stored in a database in any of several ways.  These ways may vary based on the volume of the data.  I was dealing with quite a large amount of data for user authentication purpose, and needed a way to minimize the storage.   …
This article shows how to deploy dynamic backgrounds to computers depending on the aspect ratio of display
NetCrunch network monitor is a highly extensive platform for network monitoring and alert generation. In this video you'll see a live demo of NetCrunch with most notable features explained in a walk-through manner. You'll also get to know the philos…
Have you created a query with information for a calendar? ... and then, abra-cadabra, the calendar is done?! I am going to show you how to make that happen. Visualize your data!  ... really see it To use the code to create a calendar from a q…
Suggested Courses

800 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