【问题标题】:Unable to set the current stack frame无法设置当前堆栈帧
【发布时间】:2015-04-28 11:09:50
【问题描述】:
我在 Visual Studio 2015 CTP 中打开命令窗口并给出以下命令
>k ef migration add [migration name]
>k ef migration apply
回复消息为Unable to set the current stack frame.
如何解决上述问题。
我正在为挂起的模型更改构建新迁移,并从命令行将它们应用到数据库。
我正在关注 View components and Inject in ASP.NET MVC 6
【问题讨论】:
标签:
c#
asp.net
asp.net-core-mvc
entity-framework-core
【解决方案1】:
在管理员命令窗口中,将目录更改为项目目录。项目目录包含 project.json 文件。
然后从那里运行命令。
所以简而言之,不要使用可视命令窗口,而是使用实际的 windows 命令窗口。
【解决方案2】:
您应该按照以下步骤安装 K 命令:
安装 K 版本管理器 (KVM)
Open a command prompt with Run as administrator.
Run the following command:
@powershell -NoProfile -ExecutionPolicy unrestricted -Command "iex ((new-object net.webclient).DownloadString('https://raw.githubusercontent.com/aspnet/Home/master/kvminstall.ps1'))"
The script installs KVM for the current user.
Exit the command prompt window and start another as an administrator (you need to start a new command prompt to get the updated path environment).
Upgrade KVM with the following command:
KVM upgrade
You are now ready to run EF migrations.
来源是您的共享链接"View components and Inject in ASP.NET MVC 6"
你需要在 cmd.exe 运行命令