From: Kan Yabumoto <yabumoto @ datman.com> 630-369-7112
To: Microsoft Visual Studio developer team
Subject: A bug in Configuration setting
Date: 2013-02-14
===================================================================================
Here's a sequence with Visual Studio 2010 (and earlier versions
and also possibly with VS2012 which I have not tested) that causes
a nagging inconvenience that I believe is a bug in VS2010.
* * *
The problem is with regard to a semi-deleted "configuration" settings
that causes funny things and inconveniences if not a fatal problem.
It is something to do with a deleted "configuration" that could not
be completely removed (until today when I succeeded in cleaning the
situation up).
* * *
The steps to create a new project (solution) of a brand new "myproject" product.
Steps
1. Visual Studio 2010 (without an argument)
2. File > New > Project > Win32_Console_Application
Location: c:\mydir (can be any directory, select this first )
Name: myproject (the name of the desired project)
[ ] Create directory for solution
[ ] Add to source control
The directory (c:\mydir) should exist but should not
contain a directory whose name is the same as the desired project name
(or, if it exists, it should be empty). This new directory will be
temporary anyway. You may move the entire project directory to anywhere
else because all project-related files are relative to the project directory.
which is completely "portable".
Click [OK]
3. Win32 Application Wizard > Application Settings
4. (o) Console Application
[v] Empty project
Click Finish
5. At this point, you will find the following files created by VS
in the newly created project directory:
c:\mydir\myproject\myproject.sdf
c:\mydir\myproject\myproject.sln
c:\mydir\myproject\myproject.suo
c:\mydir\myproject\myproject.vcxproj
c:\mydir\myproject\myproject.vcxproj.filters
c:\mydir\myproject\myproject.vcxproj.user
c:\mydir\myproject\myproject.opensdf (will go away when vs2010 is closed)
8. Now, let's set up the solution configuration and platforms
for all the variations in the product with minor variations
which will be differentiated via a few complile-time variables
(such as NDEBUG, _DEBUG, FREE_VERSION, PRO_VERSION)
Build > Configuration Manager...
Here's the initial settings (provided by VS2010 by default)
Active solution configuration: Active solution platform:
Debug Win32
Release <New...>
<New...> <Edit...>
<Edit...>
That is, there are two entries (Debug and Release) for solutions
and one entry (Win32) for platforms.
To be continued to Part 2
Part 2
9. Let me add a new entries into the solution configuration (and also
remove the "Debug" and "Release" configurations (that becomes
inconsistent to our configuration-naming convention).
Note: sometimes, the listbox for Active solution configuration (or for
that matter, the listbox for Active solution platform) stops
responding to your mouse-clicks. If so, click some empty spot
within the Project context table, first, to bring back the "focus".
This is also a (minor) bug of VS2010 that annoys us. This seems to
happen when you open the Configuration Manager dialog box
(by Build > Configuration Manager...) and then, go elsewhere on
the Desktop (say, open an Internet Explorer display and browse
a site by mouse clicks elsewhere) and come back by clicking the
the word "Debug" on the listbox labeled "Active solution configuration:".
While the listbox changes color as if it has the "focus" but
the listbox does not drop down with the list.
Inside the Active solution configuration listbox, selct <New...> and
Name: dbg_FreeVersion
Copy settings from: Debug
[v]Create new project configurations
click [OK]
Inside the Active solution configuration listbox, selct <New...> and
Name: dbg_ProVersion
Copy settings from: Debug
[v]Create new project configurations
click [OK]
Inside the Active solution configuration listbox, selct <New...> and
Name: rel_FreeVersion
Copy settings from: Release
[v]Create new project configurations
click [OK]
Inside the Active solution configuration listbox, selct <New...> and
Name: rel_ProeVersion
Copy settings from: Release
[v]Create new project configurations
click [OK]
At this point, we have added four configurations that bring up the total
to be six including the original Debug and Release configurations.
You may verify this at the listbox of "Active solution configuration".
The listbox drops down as follows:
dbg_FreeVersion
dbg_ProVersion
Debug
rel_FreeVersion
rel_ProVersion
Release
<New...>
<Edit...>
The same list can be viewed inside the Project contexts table below.
At this point, there is only one raw in the table that lists
"myproject" under the project column. And, you can see the
currently selected configuration in the Configuration column.
Here, you should be able to view the existing configurations by
clicking on the colume. The list is identical to what was shown
above...
dbg_FreeVersion
dbg_ProVersion
Debug
rel_FreeVersion
rel_ProVersion
Release
<New...>
<Edit...>
10. Now, the six configurations within the project can also be examined in
the Batch Build list.
Build > Batch Build...
(You can see the six configurations (when we add the x64 platform),
the total number doubles with the counterparts under the x64 platform.)
To be continued to Part 3
Part 3
11. Here is a sequence that creates the funny (buggy) limbo state that
has plagued me for years with Visual Studio.
Let us delete the default configuration settings under
"Debug" and "Release". To do so,
Build > Configuration Manager...
Inside Active solution configuration listbox, select <Edit...>
and highlight "Debug" and click [Remove].
Dismiss the confirmation prompt by clicking [Yes].
Do the same thing for the "Release" configuration by selecting
<Edit...> in the Active solution configuration listbox and
select "Release" and click [Remove]. Again, click [Yes]
at the confirmation prompt.
Now, there are only four configurations left, right?
Well, we are not sure about that at this point.
Let's finalize the change by exiting Visual Studio 2010.
File > Exit
This will give me another warning prompt for saving the change
on the following items:
myproject.sln
myproject
Click [Yes] and that is that.
12. The above sequence has been what I have been dealing with. But, you may
know something is wrong with the setting as a result of the above sequence.
Let us bring up the previous state by running VS2010 with the save sln file
(myproject.sln).
By examining the "configuration" listbox in the ToolBar section, you can
confirm there are only four configurations in this project.
However, in the Batch Build section, there are still six configurations.
Build > Batch Build...
The list in the Batch Build dialog clearly shows that the
"Debug" and "Release" configurations are not gone!!!
13. Today, with more tests and analysis, I finally figure out the way to remove
the "Debug" and "Release" configuration from the project. Here is how...
Build > Configuration Manager...
Confirm that there are only four configurations in the project by
expanding the listbox at Active solution configuration:
But, you can find all six configurations inside the Project context table.
Click at the item of Configuration column inside the Project Context
(right hand side to the project name, "myproject"). There, you can
see a total of six configurations including "Debug" and "Release" that
we thought we killed.
The solution has now become obvious. Expanding the listbox and select
<Edit...> and proceed to remove them. Highlight "Debug", click [Remove]
and dismiss the confirmation dialog (this time, the dialog box is not
as elaborate as before,.. Oh, well.)
You can confirm the result by visiting the Batch Build dialog.
Build > Batch Build...
You can now see only four entries in the configurations.
Kan Yabumoto
Pixelab, Inc.