Veri hizmeti olarak ASP.NET Web API'sini ve istemci olarak bir Xamarin taşınabilir uygulaması kullanacak bir proje geliştiriyorum. VS 2015 ASP.NET Web API'sı (EF6) & Xamarin Enable-Migrations başarısız olur
ben web uygulamasında göçler etkinleştirmek için çalışıyorum, ancak aşağıdaki hatayı alıyorum: Gördüğünüz gibiEnable-Migrations -enableautomaticmigrations -ContextTypeName MyProject.Models.ApplicationDbContext -ProjectName MyProject -StartupProjectName MyProject.App -Verbose
Using StartUp project 'MyProject.App'.
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 C:\Users\weitz\.nuget\packages\EntityFramework\6.1.3\tools\EntityFramework.psm1:718 char:5
+ $domain.SetData('project', $project)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SerializationException
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 C:\Users\weitz\.nuget\packages\EntityFramework\6.1.3\tools\EntityFramework.psm1:719 char:5
+ $domain.SetData('contextProject', $contextProject)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : SerializationException
System.NullReferenceException: Object reference not set to an instance of an object.
at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetPropertyValue[T](Project project, String propertyName)
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.
**PM>**
, ben açıkça başlangıç proje belirterek denedim ama görünmüyor enable-migrations komutu gibi bu konuda çok mutlu.
Tam .NET kullanan bir projedir (EF Core'un desteklemediği TPT/TPH modeline bağlıyım), bu nedenle EF sürümü 6.1.3 hedefleme .NET 4.6.1'dir.
VS Topluluk 2015 Güncelleştirme 3 Sürüm 14.0.25431.01'deyim.
Güncelleme
yeniden alamazsın ama bir kukla başlatmak projeyi eklerken sorun bile olmuyor.
Çapraz yayınlanmış sorun here, lütfen oylarınızı deneyin ve paylaşın.
Başlangıç projeniz veritabanına bağlanmak için kullandığınız app.config veya web.config içeriyor mu? Ayrıca dbcontext'i içeren projeyi başlangıç projesi olarak da kullanabilirsiniz. – jomsk1e
Bağlantı dizesini saklamak için appsettings.json'u kullanır. Ancak bağlantı dizesini app.config dosyasına eklemeyi denedim ve yardımcı olmadı. – Shimmy