When developing Web Part's for SharePoint 2007 (WSS 3.0) in Visual Studio 2008 and referencing the Microsoft.SharePoint.dll sometimes when running the code you will get the following error:-
Could not load file
or Assembly 'Microsoft.SharePoint.Search, Version=126.96.36.199, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with and incorrect format.
To Fix this add the following to the Projects Post-build event command line:-