https://bugs.winehq.org/show_bug.cgi?id=37998
Bug ID: 37998 Summary: Wine-mono: Type.GetType("Mono.Runtime", false) is not null, confuse runtime detection code like NUnit Product: Wine Version: 1.7.35 Hardware: x86 OS: Linux Status: NEW Keywords: download, source, testcase Severity: normal Priority: P2 Component: mscoree Assignee: wine-bugs@winehq.org Reporter: fracting@gmail.com Distribution: ---
In NUnit, src/NUnitCore/interfaces/RuntimeFramework.cs,
the application use `Type monoRuntimeType = Type.GetType("Mono.Runtime", false); ` to detect C# runtime, wine mono is detected as mono, but wine mono is not mono, which brings some strange failure later.
On Microsoft .Net Framework, Type.GetType("Mono.Runtime", false) should return null.
https://bugs.winehq.org/show_bug.cgi?id=37998
--- Comment #1 from Vincent Povirk madewokherd@gmail.com --- This will be fixed in 4.8.2 by https://github.com/madewokherd/mono/commit/53ed919f52ef12a0be52ddfbf9d6afd52...
https://bugs.winehq.org/show_bug.cgi?id=37998
Vincent Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- Severity|normal |minor
--- Comment #2 from Vincent Povirk madewokherd@gmail.com --- Turns out this causes too many problems. Mono.Cecil relies on this, and Cecil's .net codepath doesn't currently work in Wine Mono. We could hack the versions of Cecil that ship with Mono, but that wouldn't fix versions of Cecil that are in the wild.
Ideally, we should provide whatever Cecil needs to function correctly. Some more complex hack where we do something different depending on who is asking may also be possible. For now, I don't know any real programs that need this, so it's a low priority.
https://bugs.winehq.org/show_bug.cgi?id=37998
--- Comment #3 from Esme Povirk madewokherd@gmail.com --- This came up again with https://github.com/madewokherd/wine-mono/issues/116
System.MonoType is also commonly used for this purpose.
I came up with a plan to add a hack that hides these types specifically when calling Type.GetType, and disable the hack by default. Once the build process and tests work with this enabled, we can flip the default. If there are no reported regressions, we can remove the hack and the type. Both of those should probably be done on a major release.
https://bugs.winehq.org/show_bug.cgi?id=37998
--- Comment #4 from Esme Povirk madewokherd@gmail.com --- PR opened: https://github.com/madewokherd/mono/pull/13
https://bugs.winehq.org/show_bug.cgi?id=37998
Esme Povirk madewokherd@gmail.com changed:
What |Removed |Added ---------------------------------------------------------------------------- CC| |madewokherd@gmail.com