Both VC 7.1 (Visual Studio .NET 2003) and the Visual Studio Whidbey
preview (8.00.30703.27) do something annoying when upgrading a VC 6.0
.dsw/.dsp to a .sln/.vcproj that VC 7.0 did not do.
For some reason, it wants to add per-file configurations
(<FileConfiguration> elements) for *all* .cpp files, and set
"VCCLCompilerTool" options per file - even for files that did not have
unique settings in VC 6.0. These per-file configurations have been
interfering when changes to global project settings are needed.
If you upgrade a .dsw/.dsp to a VC 7.0 .sln/.vcproj, and update that
same .dsw/.dsp to 7.1 or Whidbey, there's a handful of differences, but
the spurious per-file configurations seem like a bad decision.
For example, on one project, here's what the additional
<FileConfiguration> looks like for a .cpp
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""/>
</FileConfiguration>
and for an .rc file:
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="_DEBUG;$(NoInherit)"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCResourceCompilerTool"
PreprocessorDefinitions="NDEBUG;$(NoInherit)"/>
</FileConfiguration>
Why does it do this? The 6.0 project didn't have special per-file
configurations for these files. It's problematic to go rip out the
spurious <FileConfiguration> elements, because some files actually do
need per-file configurations (like stdafx.cpp).
For example, with stdafx.cpp, here's how 7.0 upgraded the .dsp to the
.vcproj:
<File
RelativePath=".\stdafx.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
UsePrecompiledHeader="1"/>
</FileConfiguration>
</File>
and here's how 7.1 upgrades the .dsp to the 7.1 vcproj:
<File
RelativePath="stdafx.cpp">
<FileConfiguration
Name="Debug|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="0"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
BasicRuntimeChecks="3"
UsePrecompiledHeader="1"
BrowseInformation="1"/>
</FileConfiguration>
<FileConfiguration
Name="Release|Win32">
<Tool
Name="VCCLCompilerTool"
Optimization="2"
AdditionalIncludeDirectories=""
PreprocessorDefinitions=""
UsePrecompiledHeader="1"/>
</FileConfiguration>
</File>
Can this question be revisited before Whidbey or a VC 7.1 Service Pack
are released?
Thanks,
-Daniel