Want to win a PS4? Go Premium and enter to win our High-Tech Treats giveaway. Enter to Win

x
?
Solved

Platform independent code with .NET

Posted on 2013-01-14
2
Medium Priority
?
389 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:
Meir Rivkin 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

Many of us here at EE write code. Many of us write exceptional code; just as many of us write exception-prone code. As we all should know, exceptions are a mechanism for handling errors which are typically out of our control. From database errors, t…
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Sometimes it takes a new vantage point, apart from our everyday security practices, to truly see our Active Directory (AD) vulnerabilities. We get used to implementing the same techniques and checking the same areas for a breach. This pattern can re…
In response to a need for security and privacy, and to continue fostering an environment members can turn to for support, solutions, and education, Experts Exchange has created anonymous question capabilities. This new feature is available to our Pr…

604 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