Undoubtedly 64bit is the future of the software, however the transition from 32bit won’t be painless. As some of you may be thinking about moving to 64bit platform for SharePoint development or have already taken the plunge here are some lessons learned and frustrations from building SharePoint solutions on 64bit Windows 2003 using VS.NET 2005 + SP1 and Microsoft.NET Framework 2 + SP1 (32 and 62 bit)
1) First of all you should know that VS.NET 2005 is a 32 bit application. It will not work flawlessly on 64bit so be prepared that it will not behave. For example if you are running more than one instance of VS.NET in the same machine (even in different desktop sessions) sometimes it will just crash.
2) The Visual Studio 2005 extensions for Windows SharePoint Services 3.0 don’t have 64bit support at all, which means that you won’t be able to use any of the SharePoint projects for VS.NET in 64bit environment.
3) If you are building “ASP.NET Web Site” or “ASP.NET Web Service” then you may get this error:
Could not load file or assembly ‘Microsoft.SharePoint.Search, Version=18.104.22.168, Culture=neutral, PublicKeyToken=71e9bce111e9429c’ or one of its dependencies.
If you just copy the 64bit version of Microsoft.SharePoint.Search.dll assembly from the SharePoint 2007 hive to your application BIN folder this will make the things even worse and you will start getting random errors. Some of them may be:
Attempted to load a 64-bit assembly on a 32-bit platform. Use ReflectionOnlyLoad() instead if trying to load for reflection purposes.
There is a circular dependency in the target dependency graph involving target “Build”.
aspnet_compiler.exe” exited with code -2146233082.
Failed to create AppDomain.
Attempted to read or write protected memory. This is often an indication that other memory is corrupt.
In order to solve the error you have to copy the 32bit version of the Microsoft.SharePoint.Search.dll (from a 32bit deployment of SharePoint) and copy it to your web site BIN folder as this is suggested in the following post.
A better solution could be to use an “ASP.NET Web Application” / “ASP.NET Web Service Application” projects instead of “ASP.NET Web Site” / “ASP.NET Web Service”. These project are available from File -> New -> Project -> Visual C#/VB.NET -> Web.