【发布时间】:2016-05-10 16:15:14
【问题描述】:
我使用托管在 Azure 中的 SQL 数据库在 Azure 上托管了一个全新的应用程序。我的身份验证(使用 ASP.NET 身份)以及我的第一个包含一些数据的表(我首先设计数据库)都可以正常工作。我使用 EF 从数据库优先生成上下文,它创建了我的模型类和我的上下文。现在我已准备好添加第二个表,但我想这次我会尝试先编写代码。
我进入包管理器控制台并输入Enable-Migrations。
我收到此错误:
Exception calling "CreateDomain" with "3" argument(s): "The domain manager specified by the host could not be instantiated."
At C:\Users\Alex\projects\SpellbookAPI\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:717 char:5
+ $domain = [AppDomain]::CreateDomain('Migrations', $null, $info)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [], MethodInvocationException
+ FullyQualifiedErrorId : TypeLoadException
还有一大堆:
You cannot call a method on a null-valued expression.
At C:\Users\Alex\projects\SpellbookAPI\packages\EntityFramework.6.1.3\tools\EntityFramework.psm1:718 char:5
+ $domain.SetData('project', $project)
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo : InvalidOperation: (:) [], RuntimeException
+ FullyQualifiedErrorId : InvokeMethodOnNull
知道是什么原因导致这些/如何解决吗?
编辑:我不知道是否需要提及,该应用程序是具有身份验证的 .NET 4.6.1 Web API
【问题讨论】:
标签: c# asp.net entity-framework azure