Is it possible to implement and use portable executable in DLL.net?

The easiest way to think about my question is to think of a single simple unix command (although this is for Windows), and I need programmatic access to run it.

I have one command line based executable that does a certain part of the job. I want to call this executable a .net process library, as I can do with any other executable.

However, it became clear to me that there was a chance that the dll would become useless or break with unintended updates to the executable or nonexistent executable.

Is it possible to run the executable from the Process object in the .NET infrastructure, since I would use an external executable?

+3
source share
4 answers

No, you cannot execute it directly. You can probably unzip it into a temporary directory and run it from there.

+1
source
+1
source

Is this where PInvoke can help?

0
source

Depending on the functionality of the command-line program you want to run, it may be possible to duplicate the functionality in PowerShell, where you can embed the PowerShell runtime in your .NET application.

0
source

Source: https://habr.com/ru/post/1696840/


All Articles