locked
App hangs when running VS2012 under Win 8.1 RRS feed

  • Question

  • I recently migrated my VS2012 development platform to a Win 8.1 environment (running VS2012 Update 4). Now when trying to debug a win app that runs just fine in debugging mode on my Win 8 platform (accessing the same solution folder) I am running into problems.

    I can set a breakpoint at the following statement located in App.g.i.cs:

    global::Windows.UI.Xaml.Application.Start((p) => new App());

    When I now step through the next statements the app is trying to instantiate the App class. I can step through the public App() method, but then the app returns to the previous statement and upon the next step displays the following warning message:

    'A debugger is attached to {name of .exe file} but not configured to debug this unhandled exception. To debug this exception, detach the current debugger.' When I OK out of this warning, the Visual Studio Just-In-Time Debugger dialog shows up. When I reply with a 'No', I get the following error message from Microsoft Visual Studio:

    'An issue in the {name of .exe file} process caused it to fail to activate. This process threw one or more exceptions.
    Use Debug -> Exceptions to configure the debugger to stop when these exceptions are thrown. More information can be found in the Debug pane of the Output Window (Debug -> Windows -> Output).

    Here's what I found in the Output Window when debugging without a breakpoint (I replaced the name of the excecutable with an x to, hopefully, make this more readable)

    'x.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_32\mscorlib\v4.0_4.0.0.0__b77a5c561934e089\mscorlib.dll'

    'x.exe' (Managed (v4.0.30319)): Loaded 'C:\Users\Rolf\Dropbox\VisualStudio2012\x\x\bin\Debug\AppX\x.exe', Symbols loaded.

    'x.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.dll'

    'x.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\system32\WinMetadata\Windows.UI.Xaml.winmd'

    'x.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\Microsoft.Net\assembly\GAC_MSIL\System.Runtime.InteropServices.WindowsRuntime\v4.0_4.0.0.0__b03f5f7f11d50a3a\System.Runtime.InteropServices.WindowsRuntime.dll'

    'x.exe' (Managed (v4.0.30319)): Loaded 'C:\WINDOWS\system32\WinMetadata\Windows.ApplicationModel.winmd'

    The program '[9148] x.exe: Managed (v4.0.30319)' has exited with code 1073741855 (0x4000001f).

    Once again, the app debugs just fine when I start the debug session on the Win 8 platform. Any ideas what might be going on here?

    Friday, January 10, 2014 7:59 PM

Answers

  • I was able to resolve this issue by first upgrading to Visual Studio 2013 and subsequently retarget the app for Win 8.1. Now it seems working just fine. Of course now I need to figure out how to deal with this app in re. to the Win App Store... Do I need to resubmit it at a new Win 8.1 app?
    Tuesday, January 14, 2014 4:13 AM

All replies

  • There should be an exception in the e variable.  What does that show?  Otherwise, you can use procDump or DebugDiag to capture a dump of the app on startup, then paste a link to it here so we can examine it.

    Matt Small - Microsoft Escalation Engineer - Forum Moderator
    If my reply answers your question, please mark this post as answered.

    NOTE: If I ask for code, please provide something that I can drop directly into a project and run (including XAML), or an actual application project. I'm trying to help a lot of people, so I don't have time to figure out weird snippets with undefined objects and unknown namespaces.

    Friday, January 10, 2014 9:18 PM
    Moderator
  • Hi Matt:

    thanks for your speedy reply. Not quite sure what you mean by 'e variable'. I tried error trapping using try/catch, but that doesn't seem to trap the error. I am not familiar with procDump or DebugDiag. Could you send me any pointers? Thanks in advance.

    PS: Once again, keep in mind that this app executes fine in a different environment running VS2012 under Win 8 (with VS2012 loading the identical solution files, from the identical folder).

    Friday, January 10, 2014 9:44 PM
  • I've had similar issues (but in reverse - my apps would work in 8.1 but crash on 8.0, when targeting 8.0).

    I found the problem was with event handlers being added (for accessing the Settings charm). From memory I think the event handler was being added when it already existed, and 8.1 didn't bat an eyelid, but 8.0 crashed.

    I also find that debugging my 8.0 apps on 8.1 will cause a crash whenever I access web pages (I think it's caused by Java on the page), but I can tap Continue and it doesn't affect anything. This only happens when launching from Visual Studio - the deployed apps work fine on either 8.0 or 8.1.

    The way I tracked down my issue was by pure trial-and-error. I just removed code line-by-line or chunk-by-chunk until I found the line that was causing the crash.


    I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.

    Monday, January 13, 2014 3:53 AM
  • I was able to resolve this issue by first upgrading to Visual Studio 2013 and subsequently retarget the app for Win 8.1. Now it seems working just fine. Of course now I need to figure out how to deal with this app in re. to the Win App Store... Do I need to resubmit it at a new Win 8.1 app?
    Tuesday, January 14, 2014 4:13 AM
  • Thanks for taking the time to share your observations!
    Tuesday, January 14, 2014 4:15 AM
  • In the store, 8.1 and 8.0 versions of the same app can be used. Users on 8.1 will get the 8.1 package and users on 8.0 will get the 8.0 package (if you just have an 8.1 package 8.0 users can't download your app; if you have just an 8.0 package all users, including 8.1 users, will get the 8.0 version).

    I'm a self-taught noob amateur. Please take this into account when responding to my posts or when taking advice from me.

    Tuesday, January 14, 2014 4:26 AM
  • I had the very same issue. Just to be clear, my scenario was:

    - I had developed a metro app with VS2012 and Win 8, and it was working fine (it made it into the Windows Store). The App folder was located on DropBox

    - I bought myself a new laptop which had Win 8.1 installed. I then installed VS2012 on that new laptop. I also installed DropBox and completed and verified the synchronization of the project folder. I then opened and ran the project in VS2012 and voila, it ran into the exact same problem as described in this post.

    - In desperation I upgraded to VS2013, hoping that would fix this behavior, but found out that it didn't.

    Here is how I was able to correct this behavior (unfortunately, I am not able to describe why exactly this works...!)

    I copied the project folder to a new location and then opened the project with VS2013 from that new location, and guess what, it worked as intended! I did NOT have to repackage to Win 8.1 and now can continue to work on both versions, Win 8 and Win 8.1, on the same platform.

    I hope reading this helps at least one other developer who struggled with this, and just maybe, somebody at Microsoft will pay attention and address this obvious misbehavior. I would be happy to make myself available for follow-up questions if Microsoft was to be serious about fixing this! It cost me hours of precious development time.

     

    Friday, March 7, 2014 9:17 PM