EnvDTE: ArgumentException when accessing the ActiveConfiguration
        Posted  
        
            by Smith
        on Stack Overflow
        
        See other posts from Stack Overflow
        
            or by Smith
        
        
        
        Published on 2010-03-31T19:19:42Z
        Indexed on 
            2010/03/31
            19:23 UTC
        
        
        Read the original article
        Hit count: 569
        
Hello,
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.
Any help would be greatly appreciated.
© Stack Overflow or respective owner