22

Okay, so I'm developing an app for Windows Phone, and I can't seem to figure out what this issue is.

To start with, I should say my application compiles with no warnings, no errors, nada. Looks like a charm.

However, when I build the application to either the emulator, or any one of the two different WP7 devices I have on hand, the splash screen shows for a split second, and I'm returned to the home screen of the device.

Looking at the output:

'taskhost.exe' (Managed): Loaded 'mscorlib.dll'
'taskhost.exe' (Managed): Loaded 'System.Windows.RuntimeHost.dll'
'taskhost.exe' (Managed): Loaded 'System.dll'
'taskhost.exe' (Managed): Loaded 'System.Windows.dll'
'taskhost.exe' (Managed): Loaded 'System.Core.dll'
'taskhost.exe' (Managed): Loaded 'System.Xml.dll'
'taskhost.exe' (Managed): Loaded '\Applications\Install\6D7C6AA5-7D7C-4056-8BF7-1097F7FBAC40\Install\Subsplash.ExampleLibrary.dll', Symbols loaded.
'taskhost.exe' (Managed): Loaded '\Applications\Install\6D7C6AA5-7D7C-4056-8BF7-1097F7FBAC40\Install\ClientCore.dll', Symbols loaded.
'taskhost.exe' (Managed): Loaded 'System.Xml.Linq.dll'
'taskhost.exe' (Managed): Loaded 'Microsoft.Phone.dll'
'taskhost.exe' (Managed): Loaded 'Microsoft.Phone.Interop.dll'
The thread '<No Name>' (0xda1003e) has exited with code 0 (0x0).
The thread '<No Name>' (0xd660032) has exited with code 0 (0x0).
The program '[206110770] taskhost.exe: Managed' has exited with code 0 (0x0).

I'm guessing that it may be an issue with the dev environment. One more detail is that a few versions ago this was working 100%, then I changed some namespaces and folder names, and since then this issue has prevented us from doing any kind of dev. However, I'm confused as to why there would be a problem related to namespace name changing and folder change, but no build errors.

Thoughts?

Paul Hazen
  • 2,361
  • 2
  • 16
  • 21
  • There's no crash, it just terminates. The output says you simply didn't ask it to do anything useful. – Hans Passant May 23 '11 at 23:13
  • That's good to know. Although the application is clearly trying to do something here... AKA the question could be put, "Why does it think I'm not asking it to do anything?" – Paul Hazen May 23 '11 at 23:33

2 Answers2

64

If you've done any namespace renaming (especially of the App object) double check the startup object in the project is set correctly.

Nigel Sampson
  • 10,549
  • 1
  • 28
  • 31
  • 4
    you are a genius. Thank you sir! That worked like a charm. When I changed the namespaces around, the project actually had nothing as the startup object. Stupid of me not to check... but for the fools such as myself out there, seems like something the compiler should "warn" you about at least... "Hey... whatever you're building... it won't work." Or something along those lines. Thanks again. – Paul Hazen May 23 '11 at 23:43
  • 4
    YOU SIR, ARE A GENTLEMAN AND A SCHOLAR. – Alan Jun 15 '11 at 17:33
  • 6
    The Startup object is set in the project properties immediately under the assembly name. – Daniel Ballinger Sep 30 '11 at 07:26
  • Thanks a lot for that. I was going crazy. :D – Amenti Mar 15 '12 at 21:45
  • 1
    Second time this has happened, I should favorite this. – kamranicus Apr 06 '13 at 01:56
  • Second time for me also! Thanks for rescuing me twice. :) – Amenti Apr 11 '13 at 07:50
  • Well, I feel good about my Googlin'...really Bingin' in this case. 'Cause it brought me right here. But I feel better having found a solution. – Stonetip Oct 04 '13 at 03:41
  • My problem was that Unity called my app the same as another assembly's namespace. But this answer pointed me the right way. Thanks. – Valentin Simonov Feb 23 '14 at 18:12
  • This saved me too! THANKS!!! It's a shame that Visual Studio 2013 Update 2 doesn't even warn you that you don't have a startup object set.. – Andrei Rînea Jul 15 '14 at 11:51
4

Try running Clean on the project.

Check the Startup object is set correctly in the project properties.

Check the DefaultTask in "WMAppManifest.xml" is pointing to the right view.

Matt Lacey
  • 65,560
  • 11
  • 91
  • 143
  • Thanks @Matt, that was a good guess, I double checked that to make sure it was working, everything looks good on that end. – Paul Hazen May 23 '11 at 23:34
  • I also tried clean :) Does it help at all that the App class never gets created? I set a breakpoint for the first line in the constructor, and it never gets hit. – Paul Hazen May 23 '11 at 23:38