.netvisual-studio-2012msbuildcsprojmsbuild-propertygroup

Changes to csproj not taking effect


In an attempt to make my references update based on my configuration, I've tweaked my .csproj file by adding a property and changing all the references to use it as follows:

<PropertyGroup>
    <ReferencePath Condition=" '$(Configuration)' ==  'Release'">foo\release\1.0.0.9\bin\</ReferencePath>
    <ReferencePath Condition=" '$(Configuration)' == 'Debug'">bar\debug\</ReferencePath>
</PropertyGroup>

<Reference Include="BasicControls, Version=5.0.53.0, Culture=neutral, PublicKeyToken=25ad4b03c913ffff, processorArchitecture=MSIL">
  <SpecificVersion>False</SpecificVersion>
  <HintPath>$(ReferencePath)\BasicControls.dll</HintPath>
</Reference>

Something is wrong and preventing the changes from propagating. Nothing I do to the .csproj file changes the paths of the references - no matter what I do, right-clicking on the reference and looking at its Path in the properties shows the same path it showed before I started editing the file.

All of the references in the .csproj use the $(ReferencePath) setup, and neither of my ReferencePaths use the original path.

What am I missing? Is it something in the way I'm using the Property?


Solution

  • As I mentioned in the comments, I think stijn has provided a lot of good information on how to debug issues with a .csproj file. Some of his more basic ones helped me resolve my issue. Since stijn hasn't posted all the information in the comments as an answer for me to accept, I'm summarizing it and making it a community wiki.

    where MyRefPath is the variable you are interested in looking at. It will then appear in your output log when you build, if you set the output log filter to Normal or higher.

    Of these, the most useful tips for me were setting the output log verbosity and exiting VS instead of closing the solution.