小编Sam*_*ath的帖子

将现有的Microsoft.AspNet.Identity DB(EF 6)迁移到Microsoft.AspNetCore.Identity(EF Core)

我正在使用Microsoft.AspNet.Identity的应用程序(APS.net MVC)。现在,我想将应用程序更新为使用Microsoft.AspNetCore.Identity的 APS.net Core 。但是,这两种在每种模型中都有一些差异。是否有任何直接方法可以生成Microsoft.AspNetCore.Identit y相关更改的初始迁移,以便将现有数据库与Asp.net Core身份进行连接?

c# asp.net-mvc asp.net-identity asp.net-core asp.net-core-identity

5
推荐指数
1
解决办法
1385
查看次数

为什么在不同的线程中创建窗口时,有时会出现"无效的窗口句柄"异常

在按照以下代码Invalid window handle创建时,我会遇到" "异常Window.这是在一个单独的线程上调用的.它不是每次都抛出,而是随机发生的.此外,我无法查看异常的堆栈跟踪,它说" {Unable to evaluate expression because the code is optimized or a native frame is on top of the call stack.}"

private void ShowDialog()
{
    Thread thread = new Thread(() =>
        {
            waitContainer = MakeSimpleWindow();
            this.waitContainer.Closed += new EventHandler(waitingWindow_Closed);

            waitContainer.ShowDialog();

            System.Windows.Threading.Dispatcher.Run();
        });
        thread.SetApartmentState(ApartmentState.STA);
        thread.IsBackground = true;
        thread.Start();
}

public Window MakeSimpleWindow()
    {
        Window w = new Window(); // Exception occurs from here
        w.Title = Attributes[MessageBoxAttribute.message];            
        return w;
    }
Run Code Online (Sandbox Code Playgroud)

c# wpf multithreading

2
推荐指数
1
解决办法
1932
查看次数