Unable to add Rhino Mocks 3.5 to a .NET 2.0 project in Visual Studio 2010

跟風遠走 提交于 2019-12-04 09:07:20

I contacted MSDN support directly to try to get a hotfix for this issue. They were able to reproduce this problem in Visual Studio 2008 and 2010. There isn't a hotfix, but there is a relatively simple fix you can do by modifying your project's settings.

  1. Add the reference to the third-party DLL (Rhino.Mocks.dll) into the project and ignore the warning by clicking "Yes".
  2. Click on the project reference and in the property window modify the "Specific Version" of Rhino.Mocks to "True".
  3. Right click on the project node in the solution explorer in Visual Studio 2010 and select "Unload Project".
  4. Right click on the project node and select "Edit Your Project Name Here".
  5. After the line starting with <Reference Include="Rhino.Mocks, ...">, add the following line: <SpecificVersion>True</SpecificVersion>.
  6. Reload the project by right clicking the project node and select "Reload".
  7. Rebuild your project.

This worked for me.

Marc

I just ran into this issue as well. After a bit of searching I found this post from Chris May (Thanks Chris!)

I guess there's a conflict between the static method and the extension method both named "Expect".

As per the post, I fully qualified the expects method and it fixed problem #1. Then changing the <SpecificVersion /> issue, fixed the other build issues I was having.

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