我有幾個問題試圖獲得代碼優先的實體框架6.0與Microsoft.SQLServer.Types
建立遷移。我仍然繼續獲得:類庫,實體框架代碼第一和Microsoft.SqlServer.Types
空間類型和函數不適用於此提供程序,因爲無法找到程序集「Microsoft.SqlServer.Types」版本10或更高版本。
我到處看看他們一直在談論跑步:
SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);
或global.asax
相似。我需要在處理我的應用程序的數據層的類庫中運行它,所以沒有啓動事件。
我已經把
[assembly: PreApplicationStartMethod(typeof(Test.Startup), "Start")]
namespace Test
{
public class Startup
{
public static void Start()
{
SqlServerTypes.Utilities.LoadNativeAssemblies(AppDomain.CurrentDomain.BaseDirectory);
}
}
}
但是,這並沒有任何效果。任何人有任何其他想法?
感謝
克里斯
天才,工作就像一個魅力。謝謝克里斯 – ChrisB