From: Marek Safar Date: Thu, 17 Mar 2016 09:21:54 +0000 (+0100) Subject: Add CSC_SDK_PATH_DISABLED workaround X-Git-Url: http://wien.tomnetworks.com/gitweb/?a=commitdiff_plain;h=4bb1910666e4d867099bdf3cdfbcdbf1793a9cbc;p=mono.git Add CSC_SDK_PATH_DISABLED workaround --- diff --git a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/runtimeenvironment.cs b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/runtimeenvironment.cs index e1a5ec44f72..fdfbf027360 100644 --- a/mcs/class/referencesource/mscorlib/system/runtime/interopservices/runtimeenvironment.cs +++ b/mcs/class/referencesource/mscorlib/system/runtime/interopservices/runtimeenvironment.cs @@ -97,6 +97,18 @@ namespace System.Runtime.InteropServices { [ResourceConsumption(ResourceScope.Machine)] public static String GetRuntimeDirectory() { +#if !MOBILE + // + // Workaround for csc hardcoded behaviour where executing mscorlib + // location is always the first path to search for references unless + // they have full path. Mono build is using simple assembly names for + // references and -lib for path which is by default csc dehaviour never + // used + // + var sdk = Environment.GetEnvironmentVariable ("CSC_SDK_PATH_DISABLED"); + if (sdk != null) + return null; +#endif String dir = GetRuntimeDirectoryImpl(); new FileIOPermission(FileIOPermissionAccess.PathDiscovery, dir).Demand(); return dir;