.NET Framework Bookmark and Share   
 index > 64-Bit .NET Framework Development > Attempted to load a 64-bit assembly on a 32-bit platform while refering Sharepoint.dll
 

Attempted to load a 64-bit assembly on a 32-bit platform while refering Sharepoint.dll

Hi ,

From last two days i a facing one issue. I have windows 2003 64 bit server . I installed MOSS 2007. With the same I installed Vs 2008.

Now when I create a webservice application on VS 2008 and refer Sharepoint dll . It builds properly .

but as soon as i try to run it thorws an exception

Attempted to load a 64-bit assembly on a 32-bit platform. Use ReflectionOnlyLoad() instead if trying to load for reflection purposes
Anil
Anil S Doye
It seems your program is referencing a 64-bit only assembly. That should not be a problem on a 64-bit operating system, unless you haven't installed the 64-bit version of the .NET framework or you are forcing your app to run in 32-bit mode. I assume it is the latter.

Hans Passant.
nobugz
Hi Hans,

I just installed the VS 2008 . I think VS alwyas run on 32 bit only. Do you want to say that VS should be of 64 bit .

can you please let me know how to debug the .net application using 64 bit assembly ?

when i open the task manager it shows me devenv32*, it means .net runs with 32 bit.

so how can I resolve the issue. I have IIS 6 . but i dont think i am using IIS as rt now Ijust want to run my applicaton from VS run
Anil
Anil S Doye
Yes, the IDE is only available as a 32-bit process. The debugger is however available in both flavors. Necessarily so, you couldn't debug a 64-bit process otherwise. You'll find it back in Taskmgr.exe as msvsmon.exe

Hans Passant.
nobugz

HI Hans ,

Do you mean that I have to install the 64 bit debugger. If it is so, then can u please let me know is there any downloadable availabe on MS site or it by default comes with VS 2008.

I am still pulling my hairs. I am not able to get the things resolve and still searching for the perfect solution .

Please let me know is there is any setting I have to change to debug the 64 bit assembly in VS 2008.?

Thanks in advance

Anil


Anil
Anil S Doye
No, it is not a problem with your tools. Your 32-bit program is trying to load a 64-bit assembly, that's not possible. You'll have to find out which one. I suspect you'll find more help in a Sharepoint forum.
Hans Passant.
nobugz

Hi Hans,

Thanks for the reply. Just i want to know can we develop an application which will use 64 bit assembly on VS 2008 and will be able to debug it.

It is a generic query not specific to Sharepoint. So if I want to create a application on VS 2008 (which is installed on win 2k3 64 bit) which refer a 64 bit assembly and I want to debug it. Is this possible ? If yes , what setup is required.

Thanks
Anil S Doye


Anil
Anil S Doye
Of course, it is a well supported scenario for both VS2005 and 2008. Nothing special is required.

Hans Passant.
nobugz


Ya I also read the same information , but i just want toknow why i am facing this problem .


Anil
Anil S Doye


Once again I am sending the information. I have OS2003 64 bit , with MOSS 2007 and VS 2008

when i create the application in vs 2008 with a refrence to sharepoint dll . When i build it , the build get succeded but when i try to run it it thorws an exception.


Anil
Anil S Doye
We seem to be going around in circles. A 32-bit program cannot use 64-bit code. Without you telling us anything about the 32-bit program and why it isn't a 64-bit program or why it is trying to load a 64-bit assembly, we can't help you.

Hans Passant.
nobugz


Hi I am new to 64 bit OS. Till now i Develop everything on 32 bit.
I had not made any program as 32 bit. I just open the VS2008 IDE and there I select new project as Web Service Application . In webservice application I refer SharePoint Dll.

I write onewebmethod called HelloWorld() in which i just write one line code on for SharePoint
SPWeb obj = Site.OpenWeb();

Thats it.


Now where I Create a 64 bit application from Vs 2008 IDE


Anil
Anil S Doye

You can use google to search for other answers

Custom Search

More Threads

• Platform issues
• DW20.exe issues
• Visual basic 2008 64bit something wrong?
• Visual C++ .net Won't install on a 64bit platform
• Installer for pocket PC
• Windows 7 call to WTSQuerySessionInformation with WTSSessionID returns unexpected result
• OS 64bit + MOSS 64bit + VS2008 = System.BadImageFormatException
• how to do .net performance measures
• MSIL (any cpu) vs x64 compile
• Difference between x86 and x64 ?