[Mono-dev] Process.ProcessName acts differently on different platforms (bug or as expected)? [Using "System.Diagnostics.Process.GetCurrentProcess().ProcessName" on different platforms]
rzaghi at mosaic3dx.com
Thu Nov 30 00:39:00 UTC 2017
I have noticed that using
shows different values on different platforms even though the executable
names, paths and command lines and links are exactly identical.
Is this a bug, or expected or nobody cares because it's undefined!?
On a MacOSX this value is Mono's virtual machine executable file name (e.g.
But on Linux/Ubuntu this value the assembly exe filename (e.g.
I felt this should not be the case and tried to find the root cause but
with only a couple of hours in my hand I could only trace it so far - see
Is this worth fixing or is there too much legacy to change a system value
like this !?
I traced it down to "./mono/metadata/w32process.c":
and that seems to be the root of where the calls split into the various
platform specific implementations such as
which is different in:
It might take me several days before I understand all the details but if
someone gives me a pointer I might be able to work this out...
The other matter is about figuring whether we are running a mkbundle
executable or running an assembly directly. I figured using the process
name is perhaps one of the only ways because at least on the OSX this value
is set to the runtime executable rather than my program's name unless if we
have a mkbundle package. But unfortunately this logic breaks due to the
above mis-match in the platform specifics... Any other suggestions!?
*Mosaic3DX™ | User Interface Technology*
St John's Innovation Centre,
CB4 0WS, UK
*E*: rzaghi at mosaic3dx.com
*T*: +44 1223 421 311
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Mono-devel-list