gpt4 book ai didi

entity-framework - Service Fabric 和 Entity Framework 迁移

转载 作者:行者123 更新时间:2023-12-04 08:30:29 28 4
gpt4 key购买 nike

我将 Service Fabric 与 Entity Framework 6.1.3 结合使用。当我尝试使用“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 C:\repos\Gsa.Pops.Bookings\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.

我想 EF 找不到连接字符串,因为起始项目是一个 Service Fabric 应用程序(所以没有 web.config,而是一个 ApplicationManifest.xml 和多个环境配置)

有什么线索吗?谢谢,阿尔贝托

最佳答案

您可以将连接字符串存储在 Azure 的 KeyVault 中,然后从那里提取您的基础设施项目。

关于entity-framework - Service Fabric 和 Entity Framework 迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40419652/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com