[Solved] IL2CPP and Process.Start

Is

Process.Start

supposed to work with IL2CPP windows standalone 64bit? Using it right now crashes the application hard.

3516512--281111--upload_2018-5-31_16-39-38.png

Solutions or alternatives?

4 Likes

We’ve not implement the .NET Process class in IL2CPP yet. Is was not needed for mobiles and consoles in most cases. It is on our list of things to implement though.

2 Likes

Oh no that’s a showstopper for us! So I don’t have any alternative?

am I forced to write something in c++ maybe?

Unfortunately no, not from C#. You would need to p/invoke into a native library to start the process.

If you can discuss it, I’m curious to know what your game or project is using the Process API to do.

Our game is server, client based. The Single player mode still runs a local server in background, it’s how it has been designed. When the client starts, if the single player mode is selected, the client starts a local server in background.

1 Like

That makes sense, thanks! We’ll look into implementing this.

Done, it wasn’t too hard, but it was annoying because the main applications also manages the life of the spawned process.

Of course this is going to work only on windows, but for the time being is all right for us.

Hi, Is there any alternative for launching process with IL2CPP windows ?

At the moment, the only alternative is to p/invoke into a native library which accesses the Windows C API directly.

I tried to use p/invoke in 2018.2.7f1, but still not work. 3707329--306202--QQ截图20180922182459.png 3707329--306208--QQ图片20180922182710.png

Getting p/invoke signatures correct can be difficult, especially for functions like CreateProcess. First, I would p/invoke into GetLastError to find the specific error message.

Another option is to write your own native library that calls CreateProcess. It might have a simpler API, so the p/invoke signature will be simpler.

Whats the eta on the process class getting supported by il2cpp?

We don’t have an ETA right now.

Alright no worries, did it in c with no problems deploying. Have a good day.

Hello, do you have news about are integration because me too I need it ?

No, we don’t have any update about completing this work.

Getting Process.Start to work seems less overwhelming than getting all of System.Diagnostics to work in Il2cpp. I’m willing to pay for a plugin that does that sort of thing, given that it’s been almost a year where this is a planned-but-not-implemented feature. Somebody help, please :slight_smile:

this is what we used, it isn’t pretty but you can have it.
https://github.com/josh4364/IL2cppStartProcess

7 Likes

Hey Josh4364, thanks for your solution! :sunglasses:

1 Like