We're upgrading from Dev Studio 2005 to Dev Studio 2010. I opened my 2005 solution in Visual Studio 2010 and went through the conversion process keeping all projects targeted at .NET 2.0. When I try to build the project, my references to Rhino.Mocks.dll are failing to be used. I see errors like this:
DalDiscoveryTest.cs(7,7): error CS0246: The type or namespace name 'Rhino' could not be found (are you missing a using directive or an assembly reference?)
I went into my project and removed the reference to Rhino.Mocks.dll and attempted to re-add it. Then I get a dialog that reads:
'Rhino.Mocks.dll', or one of its dependencies, requires a later version of the .NET Framework than the one specified in the project. You can change the .NET Framework target by clicking Properties on the Project menu and then selecting a new target in the '.NET Framework' dropdown box. ...
I'm using "Rhino Mocks 3.5 for .NET 2.0" available at http://www.ayende.com/projects/rhino-mocks/downloads.aspx. This project builds fine in Dev Studio 2005 using .NET 2.0. The only was around the issue that I've found is to change the target of the test projects to .NET 3.5, but I'm wanting to minimize changes initially.
Is there any way around this problem besides changing the target to a newer version of .NET?
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.
<Reference Include="Rhino.Mocks, ...">
, add the following line: <SpecificVersion>True</SpecificVersion>
.This worked for me.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With