Click here to Skip to main content
15,891,657 members
Please Sign up or sign in to vote.
5.00/5 (1 vote)
See more:
Hi
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?

VB
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 !!!!!
    Next

    ' Build the Solution
    oSB.Build(True)
End Sub


Thanks
JP
Posted
Updated 25-Mar-13 20:30pm
v2
Comments
Richard MacCutchan 25-Mar-13 12:41pm    
Which one of these is the DTE you refer to?
Leo Chapiro 25-Mar-13 15:27pm    
Probably this one: http://msdn.microsoft.com/en-us/library/vstudio/envdte.dte.aspx? 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

JP
Leo Chapiro 25-Mar-13 15:31pm    
As far as I understood, you try to do it programmatically -can you show us your code then please?

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



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900