Try adding a link to a C ++ project to a C # project after clearing the solution. This works for me, although I accidentally stumbled upon this “workaround”.
It seems to me that Visual Studio is checking the build product of the mentioned project, and when it notices the incompatibility, it will refuse to add the link. If, however, the build product does not validate (since you cleared the solution), Visual Studio is happy to add the link.
I tested the resulting solution both in Visual Studio and on our TFS build server (in which AFAIK uses MSBuild ), and in both cases the build dependencies were evaluated correctly.
In your question, you also note that manually editing the .csproj file .csproj not help. I can’t confirm this. I was able to add the following link and again got a positive build result:
<ProjectReference Include="..\Foo\Foo.vcxproj"> <Name>Foo</Name> <ReferenceOutputAssembly>false</ReferenceOutputAssembly> <Private>False</Private> </ProjectReference>
I am adding a ReferenceOutputAssembly element because this blogs.msdn.com article offers this. However, in my experience, assembly also works without an element. The article is still worth reading because it explains why MSBuild does not comply with the dependencies defined in the solution.
For completeness: I am running Visual Studio 2010, Version 10.0.40219.1 SP1Rel .
source share