question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Unhandled Exception

See original GitHub issue

I couldn’t get this to work for me, I’m new to C# so maybe I’m doing something wrong, here’s the code

using System;
using murrayju.ProcessExtensions;

namespace spawnproc
{
    class Program
    {
        static void Main()
        {
            Console.WriteLine("Starting calc.exe");
            ProcessExtensions.StartProcessAsCurrentUser("calc.exe");
        }
    }
}

trying to run this will return the following error, with exit status code 255

Unhandled Exception: System.Exception: StartProcessAsCurrentUser: CreateProcessAsUser failed.

   at murrayju.ProcessExtensions.ProcessExtensions.StartProcessAsCurrentUser(String appPath, String cmdLine, String workDir, Boolean visible)
   at spawnproc.Program.Main()

Issue Analytics

  • State:closed
  • Created 8 years ago
  • Reactions:1
  • Comments:31 (10 by maintainers)

github_iconTop GitHub Comments

1reaction
mughilcommented, Oct 26, 2016

Hi i also getting the following error: StartProcessAsCurrentUser: GetSessionUserToken failed. at ProcessExtension.ProcessExtensions.StartProcessAsCurrentUser(String appPath, String cmdLine, String workDir, Boolean visible) at Scheduler_Service.Service1.StartEXE(String s) at Scheduler_Service.Service1.folderfound(String path)

Iam using this in the network drive location

0reactions
hmirheydaricommented, Aug 12, 2019

Hi Justin,

Thanks for your useful piece of code. I am to capture the standard output of the program which is executed with ProcessExtensions.StartProcessAsCurrentUser. Could you add a return value StartProcessAsCurrentUser that returns the standard output of program who is executed?

Read more comments on GitHub >

github_iconTop Results From Across the Web

How to Fix “Unhandled Exception Has Occurred in Your ...
When you see an “unhandled exception has occurred in your application” error, fixing the .NET Framework is typically the best way to fix...
Read more >
Unhandled Exception Error: 5 Quick Fixes
What is an Unhandled exception? This error appears when the code of an application or program is not adequately equipped to handle exceptions....
Read more >
What is an Unhandled Exception, and How to Catch All C# ...
An exception is a known type of error. An unhandled exception occurs when the application code does not properly handle exceptions.
Read more >
What is an Unhandled Exception? - Video & Lesson ...
An unhandled exception is an error in a computer program or application when the code has no appropriate handling exceptions.
Read more >
Unhandled Exceptions
An unhandled exception is one that has not been handled by an exception handler associated with the call stack entry that first received...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found