Starting release version of an app crashes VS consistently

Hong 1,286 Reputation points
2025-07-30T15:16:08.9033333+00:00

I have a UWP app.

When I start the debug version from VS, everything is flawless.

When I try to start the release version (i.e., the .Net Native version), VS shows the following error, then crashes. This is 100% reproducible. I tried half a dozen times and got the same result every time.

User's image

Event Viewer has the following entry:

Activation for 600XXX33.XXXXlator_npmxxxx0!App failed. Error code: The app didn't start.. Activation phase: COM ActivateExtension

Could anyone offer a tip on how to find a remedy for this?

Developer technologies | Visual Studio | Debugging
0 comments No comments
{count} votes

Accepted answer
  1. Varsha Dundigalla(INFOSYS LIMITED) 795 Reputation points Microsoft External Staff
    2025-08-05T11:24:52.72+00:00

    Why should an app crash cause VS to hang?

    When you press F5 in Visual Studio, it starts your app and tries to attach a debugger. This needs a "handshake" between Visual Studio and your app. Visual Studio sends a signal saying, “I’m ready to debug,” and your app is supposed to respond, “I’m running!”

    But if the app crashes too early before replying Visual Studio never gets that response. It keeps waiting, thinking the app is still starting. Since the app is already dead, Visual Studio stays stuck in waiting mode. That’s why it feels like it’s frozen or hanging.

    This is more common in Release mode, especially for UWP apps using .NET Native. These builds start faster, have fewer checks, and crash earlier often before the debugger can even attach.

    In your case, the SkiaSharp update caused a crash during startup. Because the crash happened so early, the debugger got stranded mid-connection, and Visual Studio hung.

    It’s not the crash alone that causes the hang it’s Visual Studio waiting forever for a response that never comes.

    This is why using Ctrl+F5 (Start Without Debugging) in Release mode acts like a safety switch—it skips the handshake completely and avoids the hang.

    You can also fix the frozen state by force-closing the debugger, removing the broken app, cleaning the solution, and restarting Visual Studio.

    This won’t fix the crash itself, but it prevents Visual Studio from hanging when the crash happens.
    Let me know if you still have any further doubts or questions.

    1 person found this answer helpful.
    0 comments No comments

2 additional answers

Sort by: Most helpful
  1. Varsha Dundigalla(INFOSYS LIMITED) 795 Reputation points Microsoft External Staff
    2025-07-31T08:43:47.7866667+00:00

    Thank you for sharing screenshot. Please find the steps below:

    Why Your App Crashes in Release but Works Fine in Debug

    If your application runs smoothly in Debug mode but crashes in Release mode, it's often due to differences in compiler optimizations, runtime settings, or missing dependencies. These issues are common and solvable with the following steps:

    Key Fixes That Usually Work

    1. Runtime Library Settings\ Go to Project Properties → C/C++ → Code Generation and check the runtime settings:
    • Use /MDd for Debug builds.
      • Use /MD for Release builds.\ Avoid mixing static (/MT) and dynamic (/MD) runtimes between builds, as this can cause instability.
    1. Check for Missing DLLs\ Use tools like dumpbin /dependents or Dependency Walker to identify missing runtime DLLs (e.g., VCRUNTIME140.dll).
    2. Disable Optimizations Temporarily\ In C/C++ → Optimization, set the optimization level to /Od (Disabled).\ If the crash disappears, it’s likely caused by uninitialized memory or invalid access that only shows up when optimizations are enabled.
    3. Increase Stack Size\ If your app uses deep recursion or heavy template logic, increase the stack size in Linker → System → Stack Reserve Size.\ A value like 20000000 often helps prevent stack overflow crashes.
    4. Enable Debug Info in Release Mode\ In Linker → Debugging, set Generate Debug Info to /DEBUG.\ This allows you to debug your Release build and pinpoint the crash using Visual Studio.

    If It Still Crashes

    • Log Early in main()\ Add a simple log to trace startup:
        std::ofstream log("log.txt");
        log << "App started\n";
      
      Check Windows Event Viewer\ Go to Windows Logs → Application to find the faulting module and error code. Use AddressSanitizer (Advanced)\ In Visual Studio 2019 or later, enable AddressSanitizer via:
      • C/C++ → Enable Address Sanitizer = Yes (/fsanitize=address)\ This helps catch memory corruption and buffer overflows that Debug mode might miss.
      Verify Third-Party Libraries\ Ensure all linked libraries are built in Release mode. Mixing Debug and Release builds can lead to runtime crashes.

    These steps resolve 90–95% of release-only crashes. If the issue persists, use logs, minidumps, and the debugger to trace the exact failure point.

    Let us know if you need any help with this.


  2. Soubhik Mukherjee 0 Reputation points
    2025-08-04T17:24:35.2366667+00:00
    1. Check Runtime Library Settings
    • In Project Properties → C/C++ → Code Generation:
      • Use /MDd for Debug builds.
        • Use /MD for Release builds.
        • Avoid mixing /MT and /MD.
    1. Identify Missing DLLs
    • Use tools like dumpbin /dependents or Dependency Walker.
    • Ensure all required runtime DLLs are present.
    • Install the Visual C++ Redistributable if needed.
    1. Disable Optimizations Temporarily
    • In C/C++ → Optimization, set to /Od (Disabled).
    • If the crash disappears, it's likely due to optimization-related issues.
    1. Increase Stack Size
    • In Linker → System → Stack Reserve Size, try increasing to 20000000.
    1. Enable Debug Info in Release Mode
    • In Linker → Debugging, set Generate Debug Info to /DEBUG.
    • This allows you to debug the Release build in Visual Studio.
    1. Use AddressSanitizer
    • In Visual Studio 2019+, enable via:
      • C/C++ → Enable Address Sanitizer = Yes (/fsanitize=address)
    1. Verify Third-Party Libraries
    • Ensure all linked libraries are built in Release mode. 1. Check Runtime Library Settings
      • In Project Properties → C/C++ → Code Generation:
        • Use /MDd for Debug builds.
        • Use /MD for Release builds.
      • Avoid mixing /MT and /MD.
      2. Identify Missing DLLs
      • Use tools like dumpbin /dependents or Dependency Walker.
      • Ensure all required runtime DLLs are present.
      • Install the Visual C++ Redistributable if needed.
      3. Disable Optimizations Temporarily
      • In C/C++ → Optimization, set to /Od (Disabled).
      • If the crash disappears, it's likely due to optimization-related issues.
      4. Increase Stack Size
      • In Linker → System → Stack Reserve Size, try increasing to 20000000.
      5. Enable Debug Info in Release Mode
      • In Linker → Debugging, set Generate Debug Info to /DEBUG.
      • This allows you to debug the Release build in Visual Studio.
      6. Log Early in main() Add a simple log to trace startup:
    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.