Click here to Skip to main content
13,048,406 members (146,586 online)
Rate this:
Please Sign up or sign in to vote.
See more:

I'm using VS 2012 and am trying to use DTE to change the configuration to Release and set all Project's Target Platform to Any.

Can anyone tell me how can I change the Platform, as the property is ReadOnly?

Public Sub BuildRelease()
    ' Refrence the Solution Build object
    Dim oSB = Connect.oDTE2.Solution.SolutionBuild
    ' Get the Active Configuration
    Dim oConfig = oSB.ActiveConfiguration
    ' Set each Project Configuration to Release & set platform to 'Any'
    For Each context As SolutionContext In oConfig.SolutionContexts
        context.ConfigurationName = "Release"
        ' Need the change the Platform to Any here !!!!!
    ' Build the Solution
End Sub

Posted 25-Mar-13 5:52am
Updated 25-Mar-13 20:30pm
Richard MacCutchan 25-Mar-13 12:41pm
Which one of these is the DTE you refer to?
du[DE] 25-Mar-13 15:27pm
Probably this one: What would you assume?
Richard MacCutchan 26-Mar-13 5:19am
I wouldn't assume anything, and my Google search did not turn up any likely hits.
JPScerri 26-Mar-13 2:34am
I am creating an Addin which uses EnvDTE80.DTE2

du[DE] 25-Mar-13 15:31pm
As far as I understood, you try to do it programmatically -can you show us your code then please?
JPScerri 26-Mar-13 2:31am
This is part of an Addin.
Have included the code in the original question.

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 26 Mar 2013
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100