I decided to rephrase my problem, as it seems it was not quit as clear as it should have been
I want to define a project dependency (let’s call it ProjectB) which is only used for build order and doesn’t pull in an assembly reference to the current project (let’s call it ProjectA). Manual modification of the build order via visual studio is not an option as the build order should be set from a nuget package, which as far as I know can only modify the msbuild file of the current project and not the solution file itself.
The reason behind this is, I want to create a source file which content is the result of processing the ProjectB executable. Also ProjectB is .NET 4.5 and ProjectA is .NET 2.0, so a direct reference is not possible anyhow.
I tried it with the msbuild ProjectReference tag, but this would add it to the assembly references the compiler receives (and throws an error as the versions are not compatible).
VS Version: 2012, no need for 2010 or lower compatibility.