Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/mono.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Köplinger <alex.koeplinger@outlook.com>2019-04-02 11:46:07 +0300
committerGitHub <noreply@github.com>2019-04-02 11:46:07 +0300
commit448cf31a8df886ddaccba625d81e8e3a5ae591c2 (patch)
treeb35a95cdcd41f4e779af1323294ea0de2935da6d /mcs/class/System
parentdf846bcbc9706e325f3b5dca4d09530b80e9db83 (diff)
[System] Clear MONO_CFG_DIR before starting mcs in CodeDOM CSharpCodeGenerator for XM4.5 (#13742)
* [System] Clear MONO_CFG_DIR before starting mcs in CodeDOM CSharpCodeGenerator This showed up in the xamarin-macios 2019-02 integration. When you used Xslt with a custom C# script in a Xamarin.Mac Full application we'd try to launch mcs via CodeDOM to compile the script. This started failing in 2019-02 because System.Native (mono-native) wasn't found, the reason is that XM sets MONO_CFG_DIR to point to the Contents/MonoBundle in the app bundle where it packages the global config file with dllmaps. However the started Mono wasn't able to find mono-native since the config there uses a different name for the file. To prevent that we now clear MONO_CFG_DIR so it uses the default value for the mono process we're starting (note that setting it to String.Empty doesn't work) * Make it specific to XM 4.5
Diffstat (limited to 'mcs/class/System')
-rw-r--r--mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs10
1 files changed, 9 insertions, 1 deletions
diff --git a/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs b/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
index 9bb045dfab1..d877e05496d 100644
--- a/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
+++ b/mcs/class/System/Microsoft.CSharp/CSharpCodeGenerator.cs
@@ -90,7 +90,15 @@ namespace Microsoft.CSharp
* reset MONO_GC_PARAMS - we are invoking compiler possibly with another GC that
* may not handle some of the options causing compilation failure
*/
- mcs.StartInfo.EnvironmentVariables ["MONO_GC_PARAMS"] = String.Empty;
+ mcs.StartInfo.EnvironmentVariables.Remove ("MONO_GC_PARAMS");
+
+#if XAMMAC_4_5
+ /*/
+ * reset MONO_CFG_DIR - we don't want to propagate the current config to another mono
+ * since it's specific to the XM application and won't work on system mono.
+ */
+ mcs.StartInfo.EnvironmentVariables.Remove ("MONO_CFG_DIR");
+#endif
mcs.StartInfo.CreateNoWindow=true;
mcs.StartInfo.UseShellExecute=false;