Imported Upstream version 4.4.0.122

Former-commit-id: a99f46acaeba3ab496c7afc02c29b839e30a0d0b
This commit is contained in:
Xamarin Public Jenkins
2016-04-12 13:19:31 -04:00
parent a632333cc7
commit d444f0caa4
118 changed files with 4121 additions and 1632 deletions

View File

@@ -75,6 +75,7 @@ namespace System.Web.Services.Configuration
try {
var hack = this.EvaluationContext;
} catch (ConfigurationErrorsException) {
this.actualPath = GetConfigurationDirectory();
return;
}
#endif
@@ -127,6 +128,7 @@ namespace System.Web.Services.Configuration
var hack = this.EvaluationContext;
} catch (ConfigurationErrorsException) {
base.Reset(parentElement);
this.actualPath = GetConfigurationDirectory();
return;
}
#endif

View File

@@ -43,7 +43,7 @@ namespace System.Runtime.InteropServices {
// Should not have been instantiable - here for binary compatibility in V4.
}
#endif
#if !MONO
[System.Security.SecurityCritical] // auto-generated
[ResourceExposure(ResourceScope.Machine)]
[MethodImplAttribute(MethodImplOptions.InternalCall)]
@@ -58,8 +58,8 @@ namespace System.Runtime.InteropServices {
[ResourceExposure(ResourceScope.Machine)]
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern String GetHostBindingFile();
#if !FEATURE_CORECLR
#endif
#if !FEATURE_CORECLR && !MONO
[System.Security.SecurityCritical] // auto-generated
[ResourceExposure(ResourceScope.None)]
[DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)]
@@ -78,7 +78,7 @@ namespace System.Runtime.InteropServices {
[MethodImpl (MethodImplOptions.NoInlining)]
public static String GetSystemVersion()
{
#if FEATURE_CORECLR
#if FEATURE_CORECLR || MONO
return Assembly.GetExecutingAssembly().ImageRuntimeVersion;
@@ -97,15 +97,36 @@ 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();
#if !DISABLE_CAS_USE
new FileIOPermission(FileIOPermissionAccess.PathDiscovery, dir).Demand();
#endif
return dir;
}
#if MONO
static String GetRuntimeDirectoryImpl()
{
return Path.GetDirectoryName (typeof (object).Assembly.Location);
}
#else
[System.Security.SecurityCritical] // auto-generated
[ResourceExposure(ResourceScope.Machine)]
[MethodImplAttribute(MethodImplOptions.InternalCall)]
internal static extern String GetRuntimeDirectoryImpl();
#endif
// Returns the system ConfigurationFile
public static String SystemConfigurationFile {
@@ -113,19 +134,24 @@ namespace System.Runtime.InteropServices {
[ResourceExposure(ResourceScope.Machine)]
[ResourceConsumption(ResourceScope.Machine)]
get {
#if MONO
String path = Environment.GetMachineConfigPath ();
#else
StringBuilder sb = new StringBuilder(Path.MAX_PATH);
sb.Append(GetRuntimeDirectory());
sb.Append(AppDomainSetup.RuntimeConfigurationFile);
String path = sb.ToString();
#endif
#if !DISABLE_CAS_USE
// Do security check
new FileIOPermission(FileIOPermissionAccess.PathDiscovery, path).Demand();
#endif
return path;
}
}
#if FEATURE_COMINTEROP
#if FEATURE_COMINTEROP && !MONO
[System.Security.SecurityCritical]
[ResourceExposure(ResourceScope.Process)]
[ResourceConsumption(ResourceScope.Process)]