2011-07-26 60 views
2

我從https://github.com/subsonic/SubSonic-3.0下載了SubSonic 3.0.0.4源碼並使用Visual Studio 2010進行了編譯。當我將編譯後的SubSonic.Core.dll添加到我自己的項目中,並試圖使用像這樣的SimpleRepository從源碼編譯SubSonic 3.0.0.4

SimpleRepository repo = new SimpleRepository(ProviderFactory.GetProvider(connectionString, "System.Data.SqlClient"), SimpleRepositoryOptions.RunMigrations); 

的dll崩潰:

InterceptionStrategy = new DynamicProxyInterceptionStrategy(this); 

An unhandled exception of type 'System.TypeInitializationException' occurred in SubSonic.Core.dll 

Additional information: The type initializer for 'SubSonic.DataProviders.DynamicProxyInterceptionStrategy' threw an exception. 

崩潰亞音速的DbDataProvider.cs上線56時210

所有工作正常,如果我從項目的網站下載現成的SubSonic.Core.dll並使用它。但我想自己編譯它,因爲我稍後會嘗試對它進行一些修改。

感謝
巴普

回答

1

我已經成功與下載從Git的最新版本,並在現有項目升級亞音速(其中有一個Microsoft SQL數據庫)。我首先編譯了Subsonic.Core項目,將舊DLL與新版本交換,並且與您的錯誤相同。

內部異常指出它缺少對Castle.Core的引用。只需在/ lib文件夾中添加對Caste.Core的引用即可,您應該很好。

-1

添加Castle.Core.dll,爲我解決了同樣的問題。