Solved

Platform independent code with .NET

Posted on 2013-01-14
2
374 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

DevOps Toolchain Recommendations

Read this Gartner Research Note and discover how your IT organization can automate and optimize DevOps processes using a toolchain architecture.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
Access Web appliction 7 48
How to Retrieve data from SQl database into multiple Textboxes VB.net 25 36
Host asp.net pages 5 26
Get Client IP on RDS - VB.NET 15 30
Summary Displaying images in RichTextBox is a common requirement with limited solutions available. Pasting through clipboard or embedding into RTF content only support static images.  This article describes how to insert Windows control objects int…
In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This Micro Tutorial hows how you can integrate  Mac OSX to a Windows Active Directory Domain. Apple has made it easy to allow users to bind their macs to a windows domain with relative ease. The following video show how to bind OSX Mavericks to …
Both in life and business – not all partnerships are created equal. As the demand for cloud services increases, so do the number of self-proclaimed cloud partners. Asking the right questions up front in the partnership, will enable both parties …

863 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

19 Experts available now in Live!

Get 1:1 Help Now