diff options
author | Rodrigo Moya <rodrigo.moya@xamarin.com> | 2019-05-24 11:39:16 +0300 |
---|---|---|
committer | Rodrigo Moya <rodrigo.moya@xamarin.com> | 2019-05-24 13:58:07 +0300 |
commit | 23166fb54ff7a0ebe001ab83c617a5ee7b65beef (patch) | |
tree | 3f36fcc96223dd7b0f7356fbb8fc4d1cb4062f9a /main/build/MacOSX/monostub.mm | |
parent | e51df35c159e30a8bbf18ab6f77b0d21019e34d0 (diff) |
[Mac] Cleanup MONO_REGISTRY_PATH on startup
If started from a Xamarin.Mac app, this env var is set pointing to a (maybe)
non-existing folder (~/Library/Application Support/Whatever), which causes
code that tries to access the registry fail if that folder doesn't exist. So,
since we want to use Mono's registry, make sure the env var is cleaned up
on startup.
Fixes https://devdiv.visualstudio.com/DevDiv/_workitems/edit/896438
Diffstat (limited to 'main/build/MacOSX/monostub.mm')
-rw-r--r-- | main/build/MacOSX/monostub.mm | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/main/build/MacOSX/monostub.mm b/main/build/MacOSX/monostub.mm index 9ea5b2f61f..d6bd254556 100644 --- a/main/build/MacOSX/monostub.mm +++ b/main/build/MacOSX/monostub.mm @@ -269,6 +269,14 @@ main (int argc, char **argv) req_mono_version = version_obj; } + // Xamarin.Mac sets MONO_REGISTRY_PATH to ~/Library/Application Support/..., + // so in the case of the Xamarin Installer, this gets set to a non + // existing directory, and when VSmac is started from the installer and + // code that uses the registry (like Publish to Azure) is ran, it tries + // to access the non existing directory, resulting in an exception that + // prevents the code from running correctly, so unset it here. + // See https://devdiv.visualstudio.com/DevDiv/_workitems/edit/896438 + unsetenv ("MONO_REGISTRY_PATH"); #if HYBRID_SUSPEND_ABORT setenv ("MONO_SLEEP_ABORT_LIMIT", "5000", 0); #endif |