[Solved Error] An attempt was made to load an assembly with an incorrect format: C:\Program Files\Common Files\Microsoft Shared\Web Server Extensions\14\ISAPI\Microsoft.Office.Server.Search.dll
I am getting this error while build the SharePoint WSP in released mode. (debug wsp working fine). In this project, I was using the WEB service in to get the information form the userprofile web service. This web service reference is causing an issue.
To fix this issue I did the following step to fix it.
- Create the separate Class Project in Visual Studio, and take the user profiler web service in this separate project.
- Take the ref. of this dll in my existing WSP and rebuild the Solution in released mode.
- Problem Solved.