I am using Moles in Visual Studio 2010, and has been working very well. However, in this situation, Moles will not function. The mscorlib.Behaviors assembly references a .NET 4 assembly, even though the project is set to the .NET 3.5 (full) profile.
I have a solution originally built in .NET 4, using Visual Studio 2010. The required assemblies (System.ServiceProcess; System.Configuration.Install) function only with the .NET 4 Client Profile. Test projects may only be .NET 4 (full) Profile, and are therefore incompatible. Therefore, I changed the framework profile of both the target project and the test project to .NET 3.5 (full), since these assemblies are allowed in this profile.
The following is the compiler warning:
The primary reference "mscorlib.Behaviors, Version=0.94.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL" could not be resolved because it has an indirect dependency on the .NET Framework assembly "mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" which has a higher version "4.0.0.0" than the version "2.0.0.0" in the current target framework.
Is there some way to force Moles to stick to .NET 3.5, without having to port the application to Visual Studio 2008? I really, REALLY don't want to do that.
UPDATE:
I believe these are the same issue: Am I the only one getting "Assembly Not Available in the Currently Targeted Framework"?