Reference a .Net2.0 project from a .Net3.5 solution without upgrading project file [csproj]
I have an interesting problem.
I am developing for a .Net2.0 solution. I have finished my development and checked my source in [er, to a local Clearcase stream - don't ask, this just means I'm done dev]. This source is, and must remain .Net2.0 Vs2005 compliant.
Unit testing is somewhat more lax. I would like to take advantage of .Net3.5's lamda expressions and full range of Moq's mocking capabilities. To this end, I have created a separate solution in Vs2008 and attempted to reference the Vs2005 project - however there are problems.
Referencing the source project requires upgrading the project to Vs2008, breaking our build solution [which must remain .Net2.0 Vs2005]. I have also considered creating a parallel project but this has several drawbacks - including synchron开发者_StackOverflow社区ization and source control issues.
Ideally, I would like to reference the Vs2005 project from Vs2008 as is.
Ideas? Suggestions? Solutions? Disproof? :)
Thanks!
Ps attempted a search of SO prior to submission, but if you happen to know this is a dupe, redirection would be much appreciated! Cheers!
Since you can't reference the project you will have to reference the assembly directly. When adding the reference to the test solution, just click on the "Browse" tab and find the .dll that the vs2005 project created.
You could create a separate project for VS2008 in the same folder, and include the same files in it. VS2008 will still allow you to generate v2 assemblies, although you will introduce issues keeping the VS2005 and VS2008 projects in sync.
精彩评论