* of icalls, do not require an increment.
*/
#pragma warning disable 169
- private const int mono_corlib_version = 147;
+ private const int mono_corlib_version = 153;
#pragma warning restore 169
[ComVisible (true)]
return trace.ToString ();
}
}
-#if !NET_2_1
+#if !MOBILE
/// <summary>
/// Get a fully qualified path to the system directory
/// </summary>
public extern static string[] GetCommandLineArgs ();
[MethodImplAttribute (MethodImplOptions.InternalCall)]
- internal extern static string internalGetEnvironmentVariable (string variable);
+ internal extern static string internalGetEnvironmentVariable_native (IntPtr variable);
+
+ internal static string internalGetEnvironmentVariable (string variable) {
+ if (variable == null)
+ return null;
+ using (var h = Mono.RuntimeMarshal.MarshalString (variable)) {
+ return internalGetEnvironmentVariable_native (h.Value);
+ }
+ }
/// <summary>
/// Return a string containing the value of the environment
/// </summary>
public static string GetEnvironmentVariable (string variable)
{
-#if !NET_2_1
+#if !MOBILE
if (SecurityManager.SecurityEnabled) {
new EnvironmentPermission (EnvironmentPermissionAccess.Read, variable).Demand ();
}
/// <summary>
/// Return a set of all environment variables and their values
/// </summary>
-#if !NET_2_1
+#if !MOBILE
public static IDictionary GetEnvironmentVariables ()
{
StringBuilder sb = null;
else
dir = UnixGetFolderPath (folder, option);
-#if !NET_2_1
+#if !MOBILE
if ((dir != null) && (dir.Length > 0) && SecurityManager.SecurityEnabled) {
new FileIOPermission (FileIOPermissionAccess.PathDiscovery, dir).Demand ();
}
}
}
#else
+ public static string GetEnvironmentVariable (string variable, EnvironmentVariableTarget target)
+ {
+ if (target == EnvironmentVariableTarget.Process)
+ return GetEnvironmentVariable (variable);
+
+ return null;
+ }
+
+ public static IDictionary GetEnvironmentVariables (EnvironmentVariableTarget target)
+ {
+ if (target == EnvironmentVariableTarget.Process)
+ return GetEnvironmentVariables ();
+
+ return (IDictionary)new Hashtable ();
+ }
+
public static void SetEnvironmentVariable (string variable, string value)
{
if (variable == null)
InternalSetEnvironmentVariable (variable, value);
}
+
+ public static void SetEnvironmentVariable (string variable, string value, EnvironmentVariableTarget target)
+ {
+ if (target == EnvironmentVariableTarget.Process)
+ SetEnvironmentVariable (variable, value);
+
+ // other targets ignored
+ }
#endif
[MethodImplAttribute (MethodImplOptions.InternalCall)]
internal static extern void InternalSetEnvironmentVariable (string variable, string value);
[SecurityCritical]
public static void FailFast (string message, Exception exception)
{
- throw new NotImplementedException ();
+#pragma warning disable 618
+ throw new ExecutionEngineException (message, exception);
+#pragma warning restore
}
[MethodImplAttribute (MethodImplOptions.InternalCall)]
}
#endif
-#if !NET_2_1
+#if !MOBILE
//
// Used by gacutil.exe
//