When I create a WCF Service Library to target the .NET 3.5 framework in Visual Studio 2010 SP1, the WCF Service Host loads the .NET 3.5 assembly in the .NET framework 4.0.30319.237 runtime when debugging.
Since I'm referencing the SharePoint 2010 Server Object Model, I cannot have my code loaded into the .NET 4 runtime, SharePoint assemblies check the runtime version and throw an exception in this case.
The WCF Service Host must be started in the .NET runtime version 2.0.50727.5446 (which is the same runtime for .NET 3.5). Has anyone resolved this?