I have a solution that contains several projects. One of the test projects is using .NET 4.0 due to a dependency. The deploy-able project I want to build is targeted against the .NET 3.5 compiler. Our current build script is not granular enough to target different .NET compilers on a project by project basis. Basically I can only use one compiler for every project in the solution.
Is the .NET 4.0 compiler smart enough to compile 3.5 code?
Solution Structure
- Project 1 .NET 3.5 (deploy-able)
- Project 2 .NET 4.0 (used for testing in automated build cycle)
Note: I can not just ignore Project 2, because our automated build server runs the unit tests in project 2. All tests must pass before a build is successful.
Edit:
I am not compiling this code within Visual Studio. We have a custom build script that is run external to visual studio. It is only smart enough to use 1 .NET compiler. It uses this compiler to compile all of the projects in a given solution. The build script does not care whether or not the projects are defined to be compiled against 3.5 or 4.0. Instead it compiles them with the defined compiler.
Project 1 does not reference project 2. Project 2 is a project containing unit tests. Our automated build tool compiles project 2 only to run tests.