使用MSTest的结构图 [英] Using structure map with MSTest
问题描述
然而,一旦测试尝试运行我得到一个{操作可能会破坏运行时的稳定性}异常。没有使用结构图,它可以正常工作(但是我很需要它在那里)。
任何人都可以指出正确的方向可能导致这种异常? 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屋!