I have a VS 2010 solution with a number of projects. Projects refer to other projects as part of the solution. I noticed that when I have the wrong project link path in the csproj file, like this:
<ProjectReference Include="..\..\..\..\WrongFolder\OtherProject.csproj"> <Project>{CD795AA6-9DC4-4451-A8BA-29BACF847AAC}</Project> <Name>OtherProject</Name> </ProjectReference>
Visual studio will fix this when opening the solution:
<ProjectReference Include="..\..\..\..\RightFolder\OtherProject.csproj"> <Project>{CD795AA6-9DC4-4451-A8BA-29BACF847AAC}</Project> <Name>OtherProject</Name> </ProjectReference>
I assume that it uses the GUID from the Project element to uniquely identify the project as part of a solution that allows it to correct the path.
MSBuild, on the other hand, does not seem to fix this path, and solution creation fails.
Is there a way to get MSBuild to fix the path, or to do it as a pre-build step using some other tool or command so that the solution builds correctly?
Thanks!
source share