I am trying use Process.StartInfo() to launch (with elevated privileges) an exe file I built.
I tried the following:
1. Add the .exe file as embedded resource.
2. Use the embedded file as follows:
Assembly _assembly;
Stream _fileStream;
_assembly = Assembly.GetExecutingAssembly();
_fileStream = _assembly.GetManifestResourceStream("projectNamespace.filename.exe")
3.Build a new file from the _filestream, and run it.
But i’m not allowed to create an instance of the static File type.
Is there a better way to do this?
Add the file you want to run to the project. Right click the file and set “Build Action” to “Content” in the solution explorer.