使用MSTest的结构图 [英] Using structure map with MSTest

查看:181
本文介绍了使用MSTest的结构图的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经创建了一个测试项目,其中有一个测试。在TestInitialize方法中,我试图调用我的StructureMap设置方法,其中我设置哪些具体实例应用于哪个接口。



然而,一旦测试尝试运行我得到一个{操作可能会破坏运行时的稳定性}异常。没有使用结构图,它可以正常工作(但是我很需要它在那里)。



任何人都可以指出正确的方向可能导致这种异常? p>

解决方案

发生了很多麻烦之后,我发现我需要做的只是右键点击StructureMap dll,然后点击取消阻止权限被排序。


I have created myself a test project with a single test in it. Within the "TestInitialize" method I'm trying to call my StructureMap setup method where I set which concrete instances should be used for which interfaces.

However as soon as the test tries to run I get a {"Operation could destabilize the runtime."} exception. Without using structuremap it works fine (but obiviously I need it in there).

Can anyone point me in the right direction as to what might be causing this exception?

解决方案

After a lot of messing around, I discovered that all I needed to do was to right-click on the StructureMap dll and click "Unblock" and the permissions were sorted.

这篇关于使用MSTest的结构图的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆