none
Hello World build doesn't work; VS2015

    Question

  • I am trying to build and run "Hello World" application described in video on page https://mva.microsoft.com/en-US/training-courses/windows-10-development-for-absolute-beginners-14541?l=rXZlwKxqB_2505632527.  The problem I'm having is with the Click event on the Button.  When I enter 'ResultTextBlock.Text = "Hello World";', I get an error; "expression must have class type"
    Tuesday, October 11, 2016 4:49 AM

Answers

  • I have figured out what the problem was; It turns out, I'm an idiot.  I had my project settings set for C++ whereas this project is C#.  I corrected the settings and the sample worked perfectly.  I apologize for wasting your time on this. 
    • Marked as answer by Jerry Easley Wednesday, October 12, 2016 3:39 AM
    Wednesday, October 12, 2016 3:39 AM

All replies

  • Hi Jerry Easley,

    Please make sure your code is the same as following:

    Layout:

    <Button x:Name="button" Content="Button" HorizontalAlignment="Left" Margin="72,296,0,0" VerticalAlignment="Top" Click="button_Click"/>
    
            <TextBlock x:Name="textBlock" HorizontalAlignment="Left" Margin="72,361,0,0" TextWrapping="Wrap" Text="" VerticalAlignment="Top"/>
    

    And the button_click:

            private void button_Click(object sender, RoutedEventArgs e)
            {
                textBlock.Text = "Helloworld";
            }
    

    You had better share me your code that could help me further troubleshot this issue.

    Sincerely,

    Oscar


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place. Click HERE to participate the survey.

    Wednesday, October 12, 2016 3:33 AM
    Moderator
  • I have figured out what the problem was; It turns out, I'm an idiot.  I had my project settings set for C++ whereas this project is C#.  I corrected the settings and the sample worked perfectly.  I apologize for wasting your time on this. 
    • Marked as answer by Jerry Easley Wednesday, October 12, 2016 3:39 AM
    Wednesday, October 12, 2016 3:39 AM