gpt4 book ai didi

.net - ReleaseHandleFailed 异常

转载 作者:行者123 更新时间:2023-12-04 06:48:02 25 4
gpt4 key购买 nike

我刚刚在一个相当简单的小程序上得到了以下该死的 MDA 异常:

A SafeHandle or CriticalHandle of type 'Microsoft.Win32.SafeHandles.SafeCapiHashHandle' failed to properly release the handle with value 0x004E48C0. This usually indicates that the handle was released incorrectly via another means (such as extracting the handle using DangerousGetHandle and closing it directly or building another SafeHandle around it.)



我从来没有见过这样的事情。我的程序代码是:
public partial class SmsEditorForm : Form
{
public SmsEditorForm()
{
InitializeComponent();
}

private void SmsEditorForm_Load(object sender, EventArgs e)
{
using (var ents = new TemplateEntities())
{
templateCombo.DataSource = ents.NotificationTemplates.OrderBy(nt => nt.TemplateName).ToList();
jobCardCombo.DataSource = ents.JobCards.Where(jc => !jc.JobDeleted && !jc.Archived).ToList();
}
}

private void smsText_TextChanged(object sender, EventArgs e)
{
charCountLabel.Text = smsText.Text.Trim().Length.ToString();
}

private void templateCombo_SelectedIndexChanged(object sender, EventArgs e)
{
using (var ents = new TemplateEntities())
{
smsText.Text = ents.NotificationTemplates.Single(nt => nt.TemplateId == (int) templateCombo.SelectedValue).ExternalRecipientSms;
}
}
}

最佳答案

看起来像是您的 SMS 库中的问题。特别是,代码的任何部分使用 SafeCapiHashHandle (这是一个加密句柄,因此,例如,通过 SSL 使用 Web 服务会导致这种情况)。

关于.net - ReleaseHandleFailed 异常,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/3512531/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com