Click here to Skip to main content
Rate this: bad
good
Please Sign up or sign in to vote.
See more: .NET
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?
 
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 25-Mar-13 6:52am
Edited 25-Mar-13 21:30pm
v2
Comments
Richard MacCutchan at 25-Mar-13 12:41pm
   
Which one of these is the DTE you refer to?
du[DE] at 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 at 26-Mar-13 5:19am
   
I wouldn't assume anything, and my Google search did not turn up any likely hits.
JPScerri at 26-Mar-13 2:34am
   
I am creating an Addin which uses EnvDTE80.DTE2
 
JP
du[DE] at 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 at 26-Mar-13 2:31am
   
This is part of an Addin.
Have included the code in the original question.
JP

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

  Print Answers RSS
0 Kornfeld Eliyahu Peter 265
1 Sergey Alexandrovich Kryukov 202
2 George Jonsson 185
3 King Fisher 185
4 CPallini 155
0 OriginalGriff 6,223
1 DamithSL 4,724
2 Maciej Los 4,196
3 Kornfeld Eliyahu Peter 3,894
4 Sergey Alexandrovich Kryukov 3,496


Advertise | Privacy | Mobile
Web03 | 2.8.141220.1 | Last Updated 26 Mar 2013
Copyright © CodeProject, 1999-2014
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