嵌套结构图嵌套容器

我们正在asp.net Web api项目中使用嵌套容器,但是,当尝试使用GetInstance解析对象时,我们看到此异常抛出

ObjectDisposedException(“ StructureMap嵌套容器”);

看来assertNotDisposed抛出此异常,但我不明白为什么会导致该异常,我们无法在本地重现此问题,它仅在负载下发生。有帮助吗?

为什么容器会被放置在http请求的中间?

private void assertNotDisposed()
    {
        if (!_disposedLatch) return;
        switch (Role)
        {
            case ContainerRole.Root:
                throw new ObjectDisposedException("StructureMap Application Root Container");
            case ContainerRole.nested:
                throw new ObjectDisposedException("StructureMap nested Container");
            case ContainerRole.ProfileOrChild:
                throw new ObjectDisposedException("StructureMap Child/Profile Container");
        }
    }
akinschen 回答:嵌套结构图嵌套容器

暂时没有好的解决方案,如果你有好的解决方案,请发邮件至:iooj@foxmail.com
本文链接:https://www.f2er.com/2306726.html

大家都在问