Using structure map with MSTest

a 夏天 提交于 2020-01-05 04:09:18

问题


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?


回答1:


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.



来源:https://stackoverflow.com/questions/7104424/using-structure-map-with-mstest

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!