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 OriginalGriff 515
1 Maciej Los 349
2 Richard MacCutchan 220
3 BillWoodruff 209
4 Mathew Soji 160
0 OriginalGriff 8,654
1 Sergey Alexandrovich Kryukov 7,407
2 DamithSL 5,639
3 Maciej Los 5,229
4 Manas Bhardwaj 4,986


Advertise | Privacy | Mobile
Web04 | 2.8.1411023.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