2011-06-30 49 views
1

我正在使用ASP.NET MVC3,StructureMap和SharpSvn。
下面是我使用的代碼:無法加載文件或程序集「SharpSvn-DB44-20-Win32.dll」

public class SvnFileReader : ISvnFileReader 
{ 
    private readonly string _svnAddress; 

    public SvnFileReader(string svnAddress) 
    { 
     _svnAddress = svnAddress; 
    } 

    public void DownloadFiles(DirectoryInfo destination) 
    { 
     using (var svnClient = new SvnClient()) 
     { 
      // checkout the code to the specified directory 
      svnClient.CheckOut(new Uri(_svnAddress), destination.FullName); 
     } 
    } 
} 

當我執行此代碼:

_svnFileReader.DownloadFiles(new System.IO.DirectoryInfo(@"d:\test")); 

我收到以下錯誤信息:

無法加載文件或程序集 'file:/// D:\ Projects \ SvnFileReaderDemo \ bin \ SharpSvn-DB44-20-Win32.dll' 或它的一個依賴關係。預計模塊 包含程序集 清單。

任何幫助將不勝感激!

回答

1

對於依賴性,您應該從StructureMap自動 assembly scanning中排除SharpSvn DLL。這是一個非託管庫,但是因爲你已經配置了StructureMap來查找所有dll中的類型,當它試圖加載它時,它會中斷。


UPDATE:

如果你正在運行在x64位的操作系統,你可以嘗試下載它採用SharpSvn-DB44-20-x64.dll具體x64 SharpSvn此代碼。

+0

請問我可以怎麼做? –

+0

@šljaker,我不知道你用什麼代碼來配置你的DI容器。 –

+0

@Darin,我編輯了我的問題。 –

相關問題