Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
I am trying to run this project in my VisualStudio 2010.
it build and run fine on my 64 bit Machine.
NOTE: I have to change build Platform of my project to x86.
 
my problem is when I try to run compiled assembly (after moving Debug Folder to another 64 Bit machine) I couldn't run my project. my exe breaks down when I open it.
 

as per my understanding problem is because of three DLL used in project are 32 BIT and Machine is 64Bit.
 
NOTE: below is three DLL
Interop.Office.dll
 
Interop.VBIDE.dll
 
Interop.Word.dll
 
I googled much but couldn't found any solution?
one solution comes in my mind is manage to get 64BIT version of above DLL for that also I have googled much but couldn't get anything.
could you please help me to find solution for this problem? or is there any way to found 64BIT version of above DLL?
 
Please Help me
Posted 28-Apr-13 18:49pm
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 1

The GAC assemblies of the proper version of the instruction-set architecture are referenced if you add a reference is a correct way, via the tag ".NET" of the "Add Reference" Window. You should never try to "find" it and add reference by the file name of the assemblies executable module (PE file). The referenced to GAC assemblies are based on strong names, not locations of the file.
 
Please see:
http://en.wikipedia.org/wiki/Global_Assembly_Cache[^],
http://en.wikipedia.org/wiki/Strong_key[^],
http://msdn.microsoft.com/en-us/library/wd40t7ad.aspx[^],
http://msdn.microsoft.com/en-us/library/yf1d93sz.aspx[^].
 
All 64-bit versions of Windows can also host x86 (32-bit applications), via WoW64: http://en.wikipedia.org/wiki/WOW64[^].
 
You can always build an x86 version of your software which will run on "real" x86 or via WoW64. All you need to do is to set target CPU version to "x86" explicitly for the entry-point assembly (*.EXE, usually), leaving all other assemblies to be compiled to "AnyCPU" target. All you need to know is: you should never allow mixing assemblies compiled to different instruction-set architectures in one process. It will never work.
 
See also: http://en.wikipedia.org/wiki/Instruction_set[^].
 
—SA
  Permalink  
Rate this: bad
good
Please Sign up or sign in to vote.

Solution 2

It really has nothing to do with the bitness of the machine. It has everything to do with your code and which version of Office is installed.
 
If the user has 64-bit Office installed, the interop libraries and your code must be 64-bit also.
 
If the user has 32-bit Office installed, so must follow the libraries and your code.
 
It doesn't matter what the bitness of the machine is as 64-bit Windows will run 32-bit code just fine.
  Permalink  
Comments
Pritesh Aryan at 2-May-13 23:44pm
   
Thank you so much for answering... but one question...
the DLL whichi i have listed in my question will be placed from which .EXE executed.
so EXE will use that DLL. how can EXE will take 64 BIT DLL if i install 64Bit version of Office.?
Dave Kreskowiak at 3-May-13 7:12am
   
You need two versions of your applicaiton. One compiled for 32-bit Office and one compiled for 64-bit. You cannot rely on the AutoCPU target to tell the difference as you can have 32-bit Office installed on a 64-bit machine.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
0 OriginalGriff 190
1 Jochen Arndt 155
2 PIEBALDconsult 150
3 Afzaal Ahmad Zeeshan 120
4 DamithSL 115
0 OriginalGriff 5,695
1 DamithSL 4,591
2 Maciej Los 4,012
3 Kornfeld Eliyahu Peter 3,480
4 Sergey Alexandrovich Kryukov 3,190


Advertise | Privacy | Mobile
Web01 | 2.8.141220.1 | Last Updated 29 Apr 2013
Copyright © CodeProject, 1999-2014
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100