Quantcast
Channel: Visual Studio Integrate forum
Viewing all articles
Browse latest Browse all 4410

VS 2008 Add In, Acessing a specific Project Configuration item

$
0
0

Hello All,

I've been working on an addin that modifies certain project configuration items of all the projects in the currently loaded solution.

My method consisted of the following :

Project prj;
Configuration config;
Properties configProps;
Property prop;
string intermediate, output, preprocessor;
if (_applicationObject.Solution.Projects.Count > 0)
{
   int project_count = _applicationObject.Solution.Projects.Count;
   for (int i = 1; i <= project_count-1; i++)
   {
      prj = _applicationObject.Solution.Projects.Item(i);
      config = prj.ConfigurationManager.ActiveConfiguration;
      configProps = config.Properties;
      prop = configProps.Item("OutputDirectory");
      prop = configProps.Item("PreprocessorDefinitions");
   }
}

Except, the call to retrive the "PreprocessorDefintions" property throws an exception. What I'm trying to do is get the value of the Configuration Properties->C\C++->Preprocessor:Preprocessor Definitions.

Can anyone see what I'm doing incorrectly?

Thanks.



Viewing all articles
Browse latest Browse all 4410

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>