tags:

views:

104

answers:

2

If I develop a 64 bit webpart DLL does it work with SharePoint 2007 32 bit?

+1  A: 

No can do. You can't load 64-bit DLL in a 32-bit process.

Franci Penov
ok... Is it do we need to do any settings to achieve that????
sahil
Nope, you can't force 64-bit dll in a 32-bit process. I would rather focus on ArjanP's question of why is your web-part 64-bit only? Can you install a 32-bit version of it?
Franci Penov
i want to make a generic webpart so that it should work with all machines..
sahil
Then you have to build two versions of your web part - one 32-bit and one 64-bit. Even if there was a magic setting that would allow 32-bit SharePoint to load 64-bit webparts, I would assume that it's under the control of the SP admin, not yours.
Franci Penov
+1  A: 

By default a .NET assembly will target "Any CPU" (see Build > Configuration manager in Visual Studio).

This means that the Intermediate Language (IL) code produced will be Just In Time (JIT) compiled into 32bit code when running on a 32 bit OS and 64 bit code when running on a 64 bit OS.

Unless you are doing something very funky (which is unlikely in a SharePoint web part) then you should leave it as "Any CPU" and simply not worry about it any more - it will just automagically work.

Ryan