gpt4 book ai didi

c# - 系统.AppDomainUnloadedException : Attempted to access an unloaded AppDomain

转载 作者:行者123 更新时间:2023-12-02 20:47:37 24 4
gpt4 key购买 nike

创建服务总线主题时,输出窗口中出现以下异常。因此,后续构建失败,因为 vstest.executionengine.exe 进程未正确终止。必须杀死这个进程才能使其工作。如何解决这个问题?使用最新版本的servicebus 4.0

    [TestMethod]
public void TestMethod1()
{

string connectionString = "Sb-connection-string";

var namespaceManager =
NamespaceManager.CreateFromConnectionString(connectionString);

if (!namespaceManager.TopicExists("TestTopic"))
{
namespaceManager.CreateTopic("TestTopic");
}

}

Exception:
System.AppDomainUnloadedException: Attempted to access an unloaded AppDomain. This can happen if the test(s) started a thread but did not stop it. Make sure that all the threads started by the test(s) are stopped before completion.

最佳答案

我遇到了同样的问题,我看到 vstest.executionengine.x86.exe 在测试执行后未关闭,当运行测试两次时,它会启动另一个进程并收到错误,我得到的解决方案是取消选中 测试 -> Visual Studio 中名为“保持测试执行引擎运行”的测试设置

关于c# - 系统.AppDomainUnloadedException : Attempted to access an unloaded AppDomain,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/43686066/

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