I'm writing an addin for Visual Studio 2008. At some point in my code, I'm attempting to access the current active configuration for a project:
var configName = _Project.ConfigurationManager.ActiveConfiguration.ConfigurationName;
Sometimes, in some very obscure cases, the getter for ActiveConfiguration throws an ArgumentException. Nothing in the documentation says anything about this (but given the very poor quality of the documentation, it was to be expected), and the exception's message is not helping at all. Also, ConfigurationManager is an interface, and I don't know what's the real implementation behind it, so I can't simply disassemble it in Reflector to know the cause.