Click here to Skip to main content
11,802,205 members (52,841 online)
Rate this: bad
Please Sign up or sign in to vote.
See more: .NET

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
Edited 25-Mar-13 20:30pm
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: 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

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.

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

  Print Answers RSS
0 OriginalGriff 485
1 KrunalRohit 341
2 F-ES Sitecore 255
3 Afzaal Ahmad Zeeshan 220
4 CPallini 205
0 OriginalGriff 2,715
1 Maciej Los 1,900
2 KrunalRohit 1,797
3 CPallini 1,550
4 Richard MacCutchan 1,157

Advertise | Privacy | Mobile
Web02 | 2.8.151002.1 | Last Updated 26 Mar 2013
Copyright © CodeProject, 1999-2015
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