我在azure上托管了一个全新的应用程序,使用的是Azure中托管的SQL数据库。我已经进行了身份验证(使用ASP.NET标识),并且我的第一个表包含一些数据(我首先设计了数据库)。我使用EF的generate Context from database-first,它创建了我的模型类和上下文。现在我已经准备好添加第二个表了,但是我想我应该先试着用代码添加。
我转到包管理器控制台,输入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.1WebAPI
发布于 2016-05-11 00:52:06
这最终成为Visual Studio 15预览版的一个问题。当我尝试使用VS2015启用迁移时,它工作得很好。
https://stackoverflow.com/questions/37143922
复制相似问题