locked
Create C++ xaml have trouble

    Question

  • I create a C++ metro project(blankpage), and add a filter in solution manager Explorer, and then create a xaml control, we will find cannot build success the project. The output say cannot find my Class. 

    And we can find the xaml have some difference. If we create xaml control in root, that no problem.

    see the picture, I use the VS11 beta, Win8.

    Saturday, April 07, 2012 10:16 AM

Answers

  • Hi,

    The issue here is that "UserControl.xaml.h" and "UserControl.xaml.cpp" are missing DependentUpon property in the project file. To work-around this issue, please edit the project file and add DependentUpon property.

        <ClInclude Include="UserControl1.xaml.h" >
             <DependentUpon>UserControl1.xaml</DependentUpon>
        </ClInclude>

        <ClCompile Include="UserControl1.xaml.cpp">
         <DependentUpon>UserControl1.xaml</DependentUpon>
         </ClCompile>

    I will also follow-up to make sure this issue is fixed in next public release of VS.

    -Navit Saxena

    Wednesday, April 11, 2012 6:38 PM

All replies

  • Hello,

    Did you forget to include the UserControl1.xaml,h into your MPBView.cpp?

    Your last two picture display incorrectly, would you please upload it again.

    Best regards,
    Jesse


    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Monday, April 09, 2012 8:30 AM
  • er, I just create a sample with nothing code. And right click in NewFilter1 folder, and then create UserControl, but we can see the .cpp and .h is not the part of the xaml, so I think this is a bug. And I try create xaml in root and drag into NewFilter1 folder, it is ok.
    Tuesday, April 10, 2012 1:45 AM
  • Hello,
     
    Thanks for your feedback, I will involve more experts to investigate it.
     
    Best regards,
    Jesse

    Jesse Jiang [MSFT]
    MSDN Community Support | Feedback to us

    Tuesday, April 10, 2012 9:07 AM
  • I've created a bug against this issue. Thank you for the feedback Wallace.

    -Steve

    Wednesday, April 11, 2012 12:04 AM
    Moderator
  • Hi,

    The issue here is that "UserControl.xaml.h" and "UserControl.xaml.cpp" are missing DependentUpon property in the project file. To work-around this issue, please edit the project file and add DependentUpon property.

        <ClInclude Include="UserControl1.xaml.h" >
             <DependentUpon>UserControl1.xaml</DependentUpon>
        </ClInclude>

        <ClCompile Include="UserControl1.xaml.cpp">
         <DependentUpon>UserControl1.xaml</DependentUpon>
         </ClCompile>

    I will also follow-up to make sure this issue is fixed in next public release of VS.

    -Navit Saxena

    Wednesday, April 11, 2012 6:38 PM
  • Hi Navit,

    Please let us know whether the above mentioned issue was resolved or not? if yes, please tell us the VS release version. I am also facing the same issue in our development.

    regards,

    Sankara Narayana

    Monday, February 11, 2013 5:32 AM