Logo
PRB: Build solution platforms cannot be added / deleted from a Visual Studio add-in

Author: Carlos J. Quintero (Microsoft MVP) Applies to: Microsoft Visual Studio 2005
Date: June 2013   Microsoft Visual Studio 2008
      Microsoft Visual Studio 2010
      Microsoft Visual Studio 2012
Introduction

This article describes the lack of support in the automation model (EnvDTE80) to add or delete solution platforms programmatically.

More Information

The automation model of add-ins (EnvDTE / EnvDTE80) provides a way to add or delete build solution configurations ("Debug", "Release", etc) as explained in the article HOWTO: Add / delete build solution configurations from a Visual Studio add-in. However, it doesn't provide a way to add or delete build solution platforms ("Any CPU", "x86", "x64").

The automation model EnvDTE of Visual Studio .NET 2002/2003 didn't have the concept of solution platforms, which were introduced in Visual Studio 2005. However, no support was provided to add or delete solution platforms programmatically in the EnvDTE80 automation model:

  • While the EnvDTE automation model had an EnvDTE.SolutionConfigurations.Add method to add solution configurations, the automation model EnvDTE80 of Visual Studio 2005 didn't introduce an EnvDTE80.SolutionConfigurations2 type with AddConfiguration and AddPlatform methods.
  • The way to delete solution configurations in the EnvDTE automation model was to locate the EnvDTE.SolutionConfiguration in the EnvDTE.SolutionConfigurations collection, and call the EnvDTE.SolutionConfiguration.Delete() method (notice that the EnvDTE.SolutionConfigurations type lacks a Delete(configurationName) method). Since there were no platforms, this approach worked correctly. The EnvDTE80 automation model of Visual Studio 2005 didn't introduce an EnvDTE80.SolutionConfigurations2 type with AddConfiguration / AddPlatform methods to add configurations / platforms respectively and Delete / DeletePlatform methods to delete configurations / platforms. Rather, the existing EnvDTE.SolutionConfiguration.Delete() method deletes all the configurations (!) in the EnvDTE.SolutionConfigurations that share the solution configuration name for the different solution platforms, and no way is provided to delete all the configurations that share the same platform.

Related articles


Go back to the 'Resources for Visual Studio .NET extensibility' section for more articles like this


Top