1

I would have been glad to comment on an answer to this question visual studio 2010 conditional references but for some reason I cannot find this feature, thus a new question.

My problem is that the conditional reference only works correctly starting from the second startup. On the first startup of the solution, or if I remove the *.suo file, the conditional references are not processed and the solutions fails to build. My condition is this one:

<Choose>
<When Condition=" '$(Configuration)'=='DebugUsingDLL' or '$(Configuration)'=='ReleaseUsingDLL' ">
  <ItemGroup>
  <ProjectReference>...</ProjectReference>
  </ItemGroup>
</When>
</Choose>

I understand that the selected Configuration is stored in the *.suo file, which is why this works fine as long as the *.suo exists on the disk.

However, because we are using solutions to automate our builds , we always check out the source in a new folder, but the *.suo file must not be check in because it is user dependent.

To better understand, we use four configurations "Debug" "Release" "DebugUsingDLL" and "ReleaseUsingDLL", and we have different projects for DLLs and for static libraries: thus the references must change based on that.
I tried to only have DebugUsingDLL and ReleaseUsingDLL in the solution, which would mean the test should always yield true for this solution, but the reference are not processed correctly either.

Can you confirm this looks like a bug in the IDE ? Can you suggest an alternative ?

Community
  • 1
  • 1
davidf
  • 151
  • 3

0 Answers0