Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
  1. Home
  2. General Programming
  3. WPF
  4. ExecutionEngineException when calling Application.Run

ExecutionEngineException when calling Application.Run

Scheduled Pinned Locked Moved WPF
csharpwpf
2 Posts 1 Posters 0 Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • E Offline
    E Offline
    Eslam Afifi
    wrote on last edited by
    #1

    I'm trying to do a simple thing and WPF doesn't allow me to. I want to show a login form before running the main form. The login does run but the main form doesn't. It throws an ExecutionEngineException with message “Exception of type 'System.ExecutionEngineException' was thrown.” with no inner exception. I hope someone tell me the right way to do it before I turn to a workaround. Thank you in advance.

    public partial class App : Application
    {
        protected override void OnStartup(StartupEventArgs e)
        {
            base.OnStartup(e);
    
            var login = new Login(); // a wpf window
            if (login.ShowDialog() == true)
            {
                var main = new MainForm(); // a wpf window
                Run(main); // exception here, .Show doesn't work, .ShowDialog doesn't work
            }
        }
    }
    

    Eslam Afifi

    E 1 Reply Last reply
    0
    • E Eslam Afifi

      I'm trying to do a simple thing and WPF doesn't allow me to. I want to show a login form before running the main form. The login does run but the main form doesn't. It throws an ExecutionEngineException with message “Exception of type 'System.ExecutionEngineException' was thrown.” with no inner exception. I hope someone tell me the right way to do it before I turn to a workaround. Thank you in advance.

      public partial class App : Application
      {
          protected override void OnStartup(StartupEventArgs e)
          {
              base.OnStartup(e);
      
              var login = new Login(); // a wpf window
              if (login.ShowDialog() == true)
              {
                  var main = new MainForm(); // a wpf window
                  Run(main); // exception here, .Show doesn't work, .ShowDialog doesn't work
              }
          }
      }
      

      Eslam Afifi

      E Offline
      E Offline
      Eslam Afifi
      wrote on last edited by
      #2

      It turned out to be a low memory issue since I was running a virtual machine on a 1 GB RAM :doh:. Sorry if I wasted your time. .Show works so does .ShowDialog .Run doesn't since it's not what it is intended to do.

      Eslam Afifi

      1 Reply Last reply
      0
      Reply
      • Reply as topic
      Log in to reply
      • Oldest to Newest
      • Newest to Oldest
      • Most Votes


      • Login

      • Don't have an account? Register

      • Login or register to search.
      • First post
        Last post
      0
      • Categories
      • Recent
      • Tags
      • Popular
      • World
      • Users
      • Groups