Started reading John Sharp - Microsoft Visual C #. Detailed guide - 2017 . I got to the end of the first chapter, where they describe how to make a program on a UWP- universal application after "Hello World" in the console (I’ve dealt only with the console and the Windows Form before) .

I follow the instructions for a simple program where you take a name and she welcomes you. Accepted a developer agreement. Then, judging by the description and screenshots from the textbooks, I began to work here:

enter image description here

Pinned TextBlock, TextBox and a button. Looked at the code on XAML , like everything is normal too.

<Grid> <TextBlock HorizontalAlignment="Left" Margin="10,10,0,0" TextWrapping="Wrap" Text="Пожалуйста, введите своё имя:" VerticalAlignment="Top" Height="35" Width="355" FontSize="24"/> <TextBox x:Name="userName" HorizontalAlignment="Left" Margin="10,45,0,0" TextWrapping="Wrap" Text="TextBox" VerticalAlignment="Top" Height="43" Width="241"/> <Button x:Name="ok" Content="OK" HorizontalAlignment="Left" Margin="256,36,0,0" VerticalAlignment="Top" Height="62" Width="72" Click="okClick"/> </Grid> 

The tutorials are then asked to do a trial run. Select a local computer (so that they don’t search for a device) => Debug => Start Debug . In the textbook they say that my form elements should appear, but I do not display anything.

enter image description here

In the upper right corner, 060 and 001 (Ping?) Are displayed.

I think, okay, maybe not lucky. I read on. I add an event handler for a click in MainPage.xaml.cs:

 private void okClick(object sender, RoutedEventArgs e) { MessageDialog msg = new MessageDialog("Привет, " + userName.Text); msg.ShowAsync(); } 

Run again, nothing. Tell me where I turned the wrong way? Why the program is not displayed, although following the instructions of the textbook everything should be fine.

PS I use Visual Studio 2013.
PS This task starts with page 49.

UPDATE: (in comments about permission)

from the textbook:

enter image description here

my:

enter image description here

  • 2
    It seems that you are working with one project (WinPhone), and you are running another one for testing (Win8 or UWP). - Bulson
  • one
    Yes, and what makes you work on not the latest version of VS? There is no normal support for UWP projects in VS2013. Why use an outdated tool? - Bulson
  • @Bulson most likely you are right. And I probably probably started the project in the wrong file. For there is Windows and Windows Phone. I will introduce the fact that there was a phone on the screenshots. I started to do in the second version. For in the first designer was a tablet. + In the textbook they say that you can choose the resolution of the phone. For example, iPhone 5. I did not find such a field for changing the resolution. You do not know where he can be? - Artik Slayer
  • I didn’t understand the iPhone, what are you doing about the Xamarin project? The resolution is set in the designer, in the upper left corner of the designer window: the resolution and orientation of the screen is set. If the solution includes several projects, then one of them has the status (I do not know how in the Russian version of VS) the Startup project. To set the project to be a follower: right for the project-> find the corresponding. item in the menu. - Bulson
  • @Bulson added an explanation about iPhone 5 in UPDATE. - Artik Slayer

1 answer 1

  1. Install VS2015, better English to google errors.
  2. Create a universal Windows application (UWP), not wp8.1, as it is now.
  3. In the upper right corner, 060 and 001 are displayed - these are performance counters (FPS, CPU, etc.)
  4. Do not look at the phone or tablet in the textbook, for UWP there is no difference, the same application works the same on all form factors (there are differences of course, but you are still far from them).
  • There may be problems with the first item, because On the official site, the native language of the browser is automatically determined by the machine and the corresponding version of the installer is pushed. - Bulson