locked
VCProjectEngine dll 9.0 not detecting x64 configurations and platforms RRS feed

  • Question

  • Is there a way to make the .NET framework VCProjectEngine 9.0 dll detect x64 configurations in vcproj files? It seems to ignore them, only caring about Win32. 

    Thanks,

    Adam

    • Moved by eryang Monday, September 6, 2010 5:53 AM (From:.NET Base Class Library)
    • Changed type DedicatedDuathlete Tuesday, September 7, 2010 2:21 PM
    Saturday, September 4, 2010 3:40 PM

Answers

  • Hi Adam,

    If you use VCProject.Platforms Property to get Platform name as following shows:

              VCProjectEngine vcprojEngine = new VCProjectEngineObject();
              //Init VCProject vcProj object
              VCProject m_VcProj = (VCProject)vcprojEngine.LoadProject(VCProjectPath);
              IVCCollection m_PlatCollection = m_VcProj.Platforms as IVCCollection;
              VCPlatform plat = (VCPlatform)m_PlatCollection .Item(1);
              MessageBox.Show(myplat.Name);
    
              //Init vcproj configurations list 
              IVCCollection m_ConfigCollection = (IVCCollection)m_VcProj.Configurations;
              VCConfiguration cfg = m_ConfigCollection.Item(1) as VCConfiguration;
              MessageBox.Show(cfg.ConfigurationName);
    

    You only can get Win32, for this property for Visual C++, this is only Win32. It's by design. For more information, please check following feedback in Connect Site:

    VCProjectEngine does not appear to support x64 platform

    Best Regards,
    Nancy


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Thursday, September 16, 2010 9:29 AM
    Tuesday, September 14, 2010 2:22 AM

All replies

  • I move this question to VSX forum for better support.
    Sincerely,
    Eric
    MSDN Subscriber Support in Forum
    If you have any feedback of our support, please contact msdnmg@microsoft.com.
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Monday, September 6, 2010 5:52 AM
  • Thanks.

    What would the reasoning be in making the VCProjectEngine.dll only detect Win32 configurations? 

    Monday, September 6, 2010 3:23 PM
  • I need to use this VCProjectEngine dll to convert .vcproj files into make files. The VCProjectEngine makes parsing the project file simple. The only problem is it only detects the Win32 configuration. Please can someone help me change this?
    Tuesday, September 7, 2010 2:23 PM
  • Hi AvocadoBrain,

    Thanks for your posting.

    To get platform name and configuration name of current VC Project, you don’t need to use VCProjectEngine.dll. You can use Envdte.Project.ConfigurationManager  property in EnvDTE.dll. Please refer to following code written by c#:

        String platformName = DTE.Solution.Projects.Item(1).ConfigurationManager.ActiveConfiguration.PlatformName.ToString();
        String ConfigurationName = DTE.Solution.Projects.Item(1).ConfigurationManager.ActiveConfiguration.ConfigurationName.ToString();
    

    If you use these code in the projects which are not Marco/Add-in/VSPackage, you need to get the instance of Visual Studio firstly, as following shows:

          EnvDTE80.DTE2 dte2 = (EnvDTE80.DTE2) System.Runtime.InteropServices.Marshal.GetActiveObject("VisualStudio.DTE.9.0");

    If I misunderstood you, or you have any comments, please let me know.

    Best Regards,
    Nancy


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    Wednesday, September 8, 2010 1:45 AM
  • Hi Nancy thanks for the response,

    I think there's a misunderstanding. I'm using this tool http://www.codeproject.com/KB/cross-platform/sln2mak.aspx to convert vcproj and sln files into make files to build on linux. sln2mak uses vcprojectengine to get at the innards of vcproj files so it can produce comparable make files. 

    I don't have a notion of a current vc project. sln2mak takes any sln or vcproj files on disk and converts to make files. It uses vcprojectengine to do this.

    Do you know what I mean now?

    Thanks,

    Adam

     

     

     

    Thursday, September 9, 2010 2:27 PM
  • Hi Adam,

    If you use VCProject.Platforms Property to get Platform name as following shows:

              VCProjectEngine vcprojEngine = new VCProjectEngineObject();
              //Init VCProject vcProj object
              VCProject m_VcProj = (VCProject)vcprojEngine.LoadProject(VCProjectPath);
              IVCCollection m_PlatCollection = m_VcProj.Platforms as IVCCollection;
              VCPlatform plat = (VCPlatform)m_PlatCollection .Item(1);
              MessageBox.Show(myplat.Name);
    
              //Init vcproj configurations list 
              IVCCollection m_ConfigCollection = (IVCCollection)m_VcProj.Configurations;
              VCConfiguration cfg = m_ConfigCollection.Item(1) as VCConfiguration;
              MessageBox.Show(cfg.ConfigurationName);
    

    You only can get Win32, for this property for Visual C++, this is only Win32. It's by design. For more information, please check following feedback in Connect Site:

    VCProjectEngine does not appear to support x64 platform

    Best Regards,
    Nancy


    Please remember to mark the replies as answers if they help and unmark them if they provide no help.
    Welcome to the All-In-One Code Framework! If you have any feedback, please tell us.
    • Marked as answer by Nancy Shao Thursday, September 16, 2010 9:29 AM
    Tuesday, September 14, 2010 2:22 AM
  • Thanks we used the 64 version and it can see both win32 and x64 platforms.
    Friday, September 17, 2010 8:24 PM
  • Is there a way to make the .NET framework VCProjectEngine 9.0 dll detect x64 configurations in vcproj files? It seems to ignore them, only caring about Win32. 

    Thanks,

    Adam

    There is a way. http://www.typedef.org/jcopenha/2007/05/22/vcprojectengine_and_x64/

    Short story, add [STAThread] before Main().

    Pedro

    • Proposed as answer by pmmalmeida Monday, March 31, 2014 1:25 PM
    Monday, March 31, 2014 1:12 PM