调试程序包管理器控制台更新-数据库种子方法 [英] Debugging Package Manager Console Update-Database Seed Method

查看:73
本文介绍了调试程序包管理器控制台更新-数据库种子方法的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想在运行 Update-Database Seed()方法>从软件包管理器控制台,但不知道如何执行。我想与其他人共享解决方案,以防他们遇到相同的问题。

I wanted to debug the Seed() method in my Entity Framework database configuration class when I run Update-Database from the Package Manager Console but didn't know how to do it. I wanted to share the solution with others in case they have the same issue.

推荐答案

这里与问题,并提供了一种效果很好的解决方案。

需要 Thread.Sleep

仅使用此代码启动调试器。

Here is similar question with a solution that works really well.
It does NOT require Thread.Sleep.
Just Launches the debugger using this code.

从答案中删除

if (!System.Diagnostics.Debugger.IsAttached) 
    System.Diagnostics.Debugger.Launch();

这篇关于调试程序包管理器控制台更新-数据库种子方法的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆