我有一個新的ASP.net 5 dnx類庫,我用於實體框架。我需要定位EF 6,因爲我需要的一些功能不在EF 7中。EF 6與dnx項目
首先,EF工具(如enable-migration)不在那裏。我添加了一箇舊式的類庫並安裝了EF 6,現在這些命令就在那裏。
當我運行允許遷移我得到這個錯誤:
PM> Enable-Migrations
Exception calling "SetData" with "2" argument(s): "Type 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation.Package.Automation.OAProject' in assembly 'Microsoft.VisualStudio.ProjectSystem.VS.Implementation, Version=14.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' is not marked as serializable." At D:\Projects\Rebus\FMS\Code\Current\FMSSupport\FMSSupport\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:720 char:5 + $domain.SetData('startUpProject', $startUpProject) + ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + CategoryInfo : NotSpecified: (:) [], MethodInvocationException + FullyQualifiedErrorId : SerializationException System.NullReferenceException: Object reference not set to an instance of an object. at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetProjectTypes(Project project, Int32 shellVersion) at System.Data.Entity.Migrations.Extensions.ProjectExtensions.IsWebProject(Project project) at System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName, Boolean useContextWorkingDirectory) at System.Data.Entity.Migrations.EnableMigrationsCommand.FindContextToEnable(String contextTypeName) at System.Data.Entity.Migrations.EnableMigrationsCommand.<>c__DisplayClass2.<.ctor>b__0() at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command) Object reference not set to an instance of an object.
我已經嘗試了啓用遷移不同的選項,如指定一個啓動項目或將ContextTypeName。
任何想法?
我用一個普通的ASP.NET項目得到了這個...... – leppie
呵呵,'啓動'引起了我的注意。我將web項目設置爲啓動項目,然後運行:D – leppie
您是否找到解決方案?我希望EFCore目前不支持的ComplexType支持。自動取款機我正在尋找不得不手動展開復雜類型以使用EFCore :( – Ilan