Unhandled Exception
See original GitHub issueI 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:
- Created 8 years ago
- Reactions:1
- Comments:31 (10 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
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?