ShimNotSupportedException in MS VisualStudio 2012

陌路散爱 提交于 2019-11-29 11:02:38
Njål Arne Gjermundshaug

I had the same exact problem. Try to remove all testsettings files (both from disk and solution), and make sure your solution does not reference any testsettings files.

Also make sure you're using the visual studio testrunner (and not resharper etc. which is instrumenting the code).

I've written two blogposts about these issues which may be helpful:

Visual Studio 2012 Fakes – ShimNotSupportedException when debugging tests

Unit testing – Visual Studio 2012 Fakes in Team City

I have seen this error a number of times with different causes:

  • There is an error or problem in your fakes generation files, some of them are not correct generated. Clean the directories and remake your fake references
  • A depending dll is missing. In this case you are missing a dll on which a fakes dll depends. In one case I was shimming a webservice and missing the System.ServiceModel dll.
  • Sometimes you can fix it with changing your testsetting default processor architecure. However I do not know why, it will probably refresh some cached dlls.

The problem is related to testsettings. I´ve done what the link below suggested and it finally worked after trying lots of possible solutions

http://blog.degree.no/2012/09/visual-studio-2012-fakes-shimnotsupportedexception-when-debugging-tests/

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