我試圖使用Visual Studio開發和調試使用SharePoint 2007 API的Web應用程序。到目前爲止,我一直在32位服務器上完成這項工作。今天我已經搬了64位開發服務器,當我嘗試運行項目出來VS中,我得到:嘗試在64位系統上爲Microsoft.SharePoint.Search.dll加載格式不正確的程序
Could not load file or assembly 'Microsoft.SharePoint.Search, Version=12.0.0.0, Culture=neutral, PublicKeyToken=71e9bce111e9429c' or one of its dependencies. An attempt was made to load a program with an incorrect format.
我已引用Microsoft.SharePoint.dll的和Microsoft.SharePoint.intl。這臺機器上的GAC的dll。當我運行它時,它會自動從Microsoft.SharePoint.Search.dll中複製(即使複製本地參數爲false)。我的項目Platform Target是「任何CPU」。我得到與x86相同的錯誤。如果我更改爲x64,我會得到Could not load file or assembly 'MyProjects.dll'...incorrect format.
。我也試過在啓動後從bin中刪除Microsoft.SharePoint.Search.dll,但後來我發現一個SharePoint錯誤,指出我的URL中的網站無法找到,我認爲這也是一個點點問題。我不太確定問題是什麼,但希望能夠使用Visual Studio運行此應用程序。我怎樣才能使它工作?
感謝您的回覆。我發現在哪裏下載這些,但我很努力去理解這個問題。我現在已經在同一臺服務器上部署並運行了IIS應用程序,推測使用相同的SharePoint.dll文件。在Visual Studio中運行它導致衝突的是什麼? – xr280xr 2014-09-16 16:46:57