locked
Visual C++ Project-to-Project References and MSBuild Property Sheets RRS feed

  • Question

  • Does anyone know of a way to place <ProjectReference> elements in a .props file and have them be correctly processed by a .vcxproj file?  I tried putting the following text (cut directly from the .vcxproj file) into the .props file, but Visual Studio didn't seem to pick up on the dependencies.  I didn't try building to see if MSBuild picks them up.

    <ItemGroup>

      <ProjectReference Include="A.vcxproj">

        <Project>{GUID-DELETED-FOR-PRIVACY}</Project>

      </ProjectReference>

    </ItemGroup>

    Also, I notice in the Property Manager window, when you edit a .props file there, it doesn't have a "Common Configuration" lement in the tree.  Could this be related?  This would be REALLY nice to have as some types of projects will always depend on another core set of projects.

    • Edited by Michael Byron Price Wednesday, January 26, 2011 8:00 PM formatting
    • Moved by Yi Feng Li Friday, January 28, 2011 8:45 AM MSbuild issue (From:Visual C++ General)
    Wednesday, January 26, 2011 7:58 PM

Answers

  • Hi Michael,

     

    Thanks for your post.

    As far as I know, you can put those project reference into .props file,

    and MSBuild will pick up them as normal,

    unfortunately the referenced projects are not visible in VS IDE.

    Visual Studio UI will only check the .vcxproj file for reference.

    Anyway, you can just add itemgroups in .props file as you pasted above.

     

    Best Regards,

    Ziwei Chen

     

    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com

     

     


    Ziwei Chen [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Victor_Chen Tuesday, February 8, 2011 4:51 AM
    Friday, January 28, 2011 9:28 AM

All replies

  • Hi Micheal,

    I'm moving this thread to MSBuild Forum for better support.

    Cheers,

    YI


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    Friday, January 28, 2011 8:45 AM
  • Hi Michael,

     

    Thanks for your post.

    As far as I know, you can put those project reference into .props file,

    and MSBuild will pick up them as normal,

    unfortunately the referenced projects are not visible in VS IDE.

    Visual Studio UI will only check the .vcxproj file for reference.

    Anyway, you can just add itemgroups in .props file as you pasted above.

     

    Best Regards,

    Ziwei Chen

     

    MSDN Subscriber Support in Forum
    If you have any feedback on our support, please contact msdnmg @ microsoft.com

     

     


    Ziwei Chen [MSFT]
    MSDN Community Support | Feedback to us
    Get or Request Code Sample from Microsoft
    Please remember to mark the replies as answers if they help and unmark them if they provide no help.

    • Marked as answer by Victor_Chen Tuesday, February 8, 2011 4:51 AM
    Friday, January 28, 2011 9:28 AM
  • AOA,

    VS IDE do not provide any UI for adding these references in .prop files however as mentioned above you can add manually. Moreover in VCXPROJECT file you can add framework and references page in project project in which you can  add reference. As far as i experienced when you go to from one machine to another these reference may cause problem frequently.


    Fahd Anwar
    Wednesday, February 9, 2011 8:25 AM