1
votes

I've developed an IHttpModule for SharePoint Foundation 2010 and deployed it to the GAC and added it to the web.config of my web application, it works fine.

I plan on developing another DLL to share between multiple SharePoint projects e.g. Event Receivers, Application Pages, Web Parts etc.

I'm just wondering if these DLLs need to be compiled as 64-bit (x64) - I'm a bit of a novice when it comes to SharePoint and DLLs and the online documentation is patchy.

Please could someone confirm this for me and ideally give me a link to some good documentation on developing DLLs for SharePoint. Any other advice would be welcome.

1

1 Answers

1
votes

I recommend to compile anything SharePoint explicitly as x64. That said, You can in theory use AnyCPU (the default), but if things end up using unmanaged code under the hood it's better to eliminate any guesswork and explicitly make sure everything is x64. If everything is .net, then AnyCPU will work.

Note that at least some versions of Visual Studio create Console Applications explicitly as x86, which causes an unhelpful error message when referencing SharePoint DLLs. (Arguably, Console Apps using SharePoint DLLs directly is rare, for one-off tools)

Also, if using dependencies that are explicitly x86 (some SQLite and I think SQL Server Compact), problems will show up.

TLDR: I recommend x64, AnyCPU is most often okay, x86 is bad. This applies to SP2010 and later, because these products are exclusively 64-Bit unlike SP2007 which had both 32 and 64 Bit Versions.