简体   繁体   English

WPF密码箱-调试时出现内部错误?

[英]WPF Passwordbox - Internal error when debugging?

UPDATE: 更新:

Due to the help from Devid Farinelli I was able to sort it out myself. Devid Farinelli的帮助下,我得以自己解决问题。 This link helps to point out the issue but the described Workaround doesn't fit to Visual Studio 2015. If you're having the problem there, refer to this link. 链接有助于指出问题,但所描述的解决方法不适用于Visual Studio2015。如果在那里遇到问题,请参考链接。 In my specific case it was a line where I called a control property without invoking the thread before. 在我的特定情况下,这是一行,我在不调用线程的情况下调用了控件属性。 Not a big thing but with the error it was. 没什么大不了,但是有错误。 Hope this helps some others maybe. 希望这可以对其他人有所帮助。

Thanks and greetings 谢谢和问候

I'm using a PasswordBox in a UserControl. 我在UserControl中使用了PasswordBox。 To detect the user has entered both his username and a password, I'm disabling the Login button as long as one of both is empty. 为了检测用户是否已经输入了用户名和密码,只要两者之一为空,就禁用“登录”按钮。 So far, so good, all is working as expected, the button gets enabled if both are containing something. 到目前为止,一切正常,一切正常,如果两个按钮都包含某些内容,则该按钮将启用。

The thing is: I wanted to debug the method in behind code where I'm changing the button state but I'm getting an "internal error" message like: 事情是:我想在代码中调试方法,在其中更改按钮状态,但是却收到“内部错误”消息,例如:

Event-ID=0x20c. 事件ID = 0x20c。 Exception code=0xc0000005, Eip=0x7226b264. 异常代码= 0xc0000005,Eip = 0x7226b264。

That's not the usual exception message window. 那不是通常的异常消息窗口。

My method code on this is just 我的方法代码只是

        private void txtCheckLoginEnable(object sender, EventArgs e)
    {
        if (tbPassword.SecurePassword.Length > 0 && tbUser.Text != "")
            cmdLogin.SetValue(Button.IsEnabledProperty, true);
        else
            cmdLogin.SetValue(Button.IsEnabledProperty, false);
    }

The event gets called from one of both TextBoxes. 从两个TextBox之一调用该事件。 And as said, if not placing a stop point inside the method, nothing pops up. 如前所述,如果未在方法内放置停止点,则不会弹出任何消息。

Someone an idea on this? 有人对此有想法吗? I'm not sure if it's an issue functionwise but as said, I'm not getting other bugs from it. 我不确定这是否在功能上是一个问题,但是正如我所说,我没有从中得到其他错误。

UPDATE: 更新:

Due to the help from Devid Farinelli I was able to sort it out myself. 在Devid Farinelli的帮助下,我得以自己解决问题。 This link helps to point out the issue but the described Workaround doesn't fit to Visual Studio 2015. If you're having the problem there, refer to this link. 链接有助于指出问题,但所描述的解决方法不适用于Visual Studio2015。如果在那里遇到问题,请参考链接。 In my specific case it was a line where I called a control property without invoking the thread before. 在我的特定情况下,这是一行,我在不调用线程的情况下调用了控件属性。 Not a big thing but with the error it was. 没什么大不了,但是有错误。 Hope this helps some others maybe. 希望这可以对其他人有所帮助。

Thanks and greetings 谢谢和问候

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM