locked
Why black screen when running V2013 C# Win 8.1 app on desktop

    Question

  • Know a little C#, previously used it for custom actions for Installer development.  Picked up 'Step by Step MS Visual C# 2013' book.  Working through the code, Chapter 1, created blank APP (XAML) 'Hello' application.  When I start the application (with or without debugging,  local machine or simulator), the screen goes black, a box with an 'x' in it appears.  Sometimes '000 000' appears in the left top corner, and '060 003/2/1/0, countdown, appears in the upper right hand side.  Nothing else happens or appears (the box with the x disappears).  Do a Windows key\b to get out of this.  Tried this multiple times. Hardware Lenovo desktop, last years I7.  Windows 8.1 OS, 16 GB RAM, 2 TB disk.  Did a DXdiag, shows Directx 11.  Display1 is 1680 * 1050.  The books says that systems requirements is Directx9 and video card (if Win 8.1), of 1366 * 768 or greater.  The VS project is targeted at Win 8.1.

    Do I need a touch monitor (which I do not have), is this a graphics card problem, what are the possibilities?  thanks.

    Monday, September 1, 2014 5:05 PM

Answers

  • That sounds like correct behavior if you haven't added any elements to your app. Apps run full screen by default, and if you don't add any elements to your app then there isn't anything to display. If you do add elements to your Xaml they will show up on that black background. The numbers are debug info defined in your app.xaml.cs file.

    --Rob

    Monday, September 1, 2014 10:01 PM
    Owner
  • A log file of what?

    Can you share a sample app that demonstrates the problem on your OneDrive?

    One way I've run into this with Universal apps is by editing my Phone project's Xaml file and then running the Windows app which doesn't have the updated Xaml.

    --Rob

    Tuesday, September 2, 2014 5:39 PM
    Owner
  • I found the problem. The book lesson instructions says...

           on file menu, point to new, project, Visual c#, Windows Store Folder, 'click the Blank app (XAML) icon'

    I am Using VS 2013 Update 3 (perhaps the book used an earlier version of VS).  There is no 'Windows store folder', instead there was 'Store Apps', and under that there was "Universal Apps", "Windows apps", and "Windows Phone Apps".  Each of those had a "Blank App".  I must have click on the top "Store Apps", which listed all the options for the three selections under it   At the top there was a "Blank App (universal Apps)', that I had selected (I should have selected the "Windows Apps\Blank App(Windows)". 

    Having selected the 'Blank App (universal Apps), was the problem.  I re-created the project using the correct selection "Windows Apps\Blank App(Windows)", and it works now.  Lesson learned...'Windows Apps' is for applications on Windows 8.1 desktop.  'Windows Phone Apps' is for developing apps for the phone, and 'Universal Apps', is to develop an app that can run on both.

    Thanks for the help anyway (I learn as I go).

    • Marked as answer by mobilelou Thursday, September 4, 2014 8:38 PM
    Thursday, September 4, 2014 8:38 PM

All replies

  • That sounds like correct behavior if you haven't added any elements to your app. Apps run full screen by default, and if you don't add any elements to your app then there isn't anything to display. If you do add elements to your Xaml they will show up on that black background. The numbers are debug info defined in your app.xaml.cs file.

    --Rob

    Monday, September 1, 2014 10:01 PM
    Owner
  • The grid contains a textblock, textbox, and button.  I am fairly new to VS, is there a log file being created somewhere?
    Monday, September 1, 2014 10:42 PM
  • A log file of what?

    Can you share a sample app that demonstrates the problem on your OneDrive?

    One way I've run into this with Universal apps is by editing my Phone project's Xaml file and then running the Windows app which doesn't have the updated Xaml.

    --Rob

    Tuesday, September 2, 2014 5:39 PM
    Owner
  • Those top left and right corner countdowns are debug line and it seem that you have same foreground colour as background colour please set foreground = "white" in all textblock , textbox and button, and then check it again.

    Hope this will work.

    Thank you.

    Muhammad Asad.

    Tuesday, September 2, 2014 6:03 PM
  • I found the problem. The book lesson instructions says...

           on file menu, point to new, project, Visual c#, Windows Store Folder, 'click the Blank app (XAML) icon'

    I am Using VS 2013 Update 3 (perhaps the book used an earlier version of VS).  There is no 'Windows store folder', instead there was 'Store Apps', and under that there was "Universal Apps", "Windows apps", and "Windows Phone Apps".  Each of those had a "Blank App".  I must have click on the top "Store Apps", which listed all the options for the three selections under it   At the top there was a "Blank App (universal Apps)', that I had selected (I should have selected the "Windows Apps\Blank App(Windows)". 

    Having selected the 'Blank App (universal Apps), was the problem.  I re-created the project using the correct selection "Windows Apps\Blank App(Windows)", and it works now.  Lesson learned...'Windows Apps' is for applications on Windows 8.1 desktop.  'Windows Phone Apps' is for developing apps for the phone, and 'Universal Apps', is to develop an app that can run on both.

    Thanks for the help anyway (I learn as I go).

    • Marked as answer by mobilelou Thursday, September 4, 2014 8:38 PM
    Thursday, September 4, 2014 8:38 PM
  • That's not quite correct.

    Universal apps can target Windows Store apps, Windows Phone apps, or both. It sounds like you ran into the problem I described in my previous post where you edited the Windows Phone project in the Universal app but ran the Windows project.

    --Rob

    Thursday, September 4, 2014 8:42 PM
    Owner