diff options
author | Jan Kotas <jkotas@microsoft.com> | 2017-03-21 17:45:57 -0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-03-21 17:45:57 -0700 |
commit | f4b58a22dfe6336e90d587ef3457af2070a09afc (patch) | |
tree | 24cebdb25cc9c798d280881e208f044ea15d3148 | |
parent | 68012bf209f37ab5b5b11a02b203f2949d1ef8dc (diff) | |
parent | 6d32a5152ef43752c72ff8dbbe9fbc635a55df13 (diff) | |
download | coreclr-f4b58a22dfe6336e90d587ef3457af2070a09afc.tar.gz coreclr-f4b58a22dfe6336e90d587ef3457af2070a09afc.tar.bz2 coreclr-f4b58a22dfe6336e90d587ef3457af2070a09afc.zip |
Merge pull request #10363 from jkotas/revert
Revert "Switch coreclr corelib to use resx (#10268)"
299 files changed, 5501 insertions, 7362 deletions
diff --git a/src/mscorlib/Common/System/SR.cs b/src/mscorlib/Common/System/SR.cs deleted file mode 100644 index 29f3970633..0000000000 --- a/src/mscorlib/Common/System/SR.cs +++ /dev/null @@ -1,197 +0,0 @@ -// Licensed to the .NET Foundation under one or more agreements. -// The .NET Foundation licenses this file to you under the MIT license. -// See the LICENSE file in the project root for more information. - -using System.Collections.Generic; -using System.Diagnostics; -using System.IO; -using System.Resources; -using System.Runtime.CompilerServices; -using System.Threading; - -namespace System -{ - internal static partial class SR - { - private static ResourceManager ResourceManager - { - get; - set; - } - - // This method is used to decide if we need to append the exception message parameters to the message when calling SR.Format. - // by default it returns false. - [MethodImpl(MethodImplOptions.NoInlining)] - private static bool UsingResourceKeys() - { - return false; - } - - // Needed for debugger integration - internal static string GetResourceString(string resourceKey) - { - return GetResourceString(resourceKey, String.Empty); - } - - internal static string GetResourceString(string resourceKey, string defaultString) - { - string resourceString = null; - try { resourceString = InternalGetResourceString(resourceKey); } - catch (MissingManifestResourceException) { } - - if (defaultString != null && resourceKey.Equals(resourceString, StringComparison.Ordinal)) - { - return defaultString; - } - - return resourceString; - } - - private static object _lock = new object(); - private static List<string> _currentlyLoading; - private static int _infinitelyRecursingCount; - private static bool _resourceManagerInited = false; - - private static string InternalGetResourceString(string key) - { - if (key == null || key.Length == 0) - { - Debug.Assert(false, "SR::GetResourceString with null or empty key. Bug in caller, or weird recursive loading problem?"); - return key; - } - - // We have a somewhat common potential for infinite - // loops with mscorlib's ResourceManager. If "potentially dangerous" - // code throws an exception, we will get into an infinite loop - // inside the ResourceManager and this "potentially dangerous" code. - // Potentially dangerous code includes the IO package, CultureInfo, - // parts of the loader, some parts of Reflection, Security (including - // custom user-written permissions that may parse an XML file at - // class load time), assembly load event handlers, etc. Essentially, - // this is not a bounded set of code, and we need to fix the problem. - // Fortunately, this is limited to mscorlib's error lookups and is NOT - // a general problem for all user code using the ResourceManager. - - // The solution is to make sure only one thread at a time can call - // GetResourceString. Also, since resource lookups can be - // reentrant, if the same thread comes into GetResourceString - // twice looking for the exact same resource name before - // returning, we're going into an infinite loop and we should - // return a bogus string. - - bool lockTaken = false; - try - { - Monitor.Enter(_lock, ref lockTaken); - - // Are we recursively looking up the same resource? Note - our backout code will set - // the ResourceHelper's currentlyLoading stack to null if an exception occurs. - if (_currentlyLoading != null && _currentlyLoading.Count > 0 && _currentlyLoading.LastIndexOf(key) != -1) - { - // We can start infinitely recursing for one resource lookup, - // then during our failure reporting, start infinitely recursing again. - // avoid that. - if (_infinitelyRecursingCount > 0) - { - return key; - } - _infinitelyRecursingCount++; - - // Note: our infrastructure for reporting this exception will again cause resource lookup. - // This is the most direct way of dealing with that problem. - string message = $"Infinite recursion during resource lookup within {System.CoreLib.Name}. This may be a bug in {System.CoreLib.Name}, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names. Resource name: {key}"; - Assert.Fail("[Recursive resource lookup bug]", message, Assert.COR_E_FAILFAST, System.Diagnostics.StackTrace.TraceFormat.NoResourceLookup); - Environment.FailFast(message); - } - if (_currentlyLoading == null) - _currentlyLoading = new List<string>(); - - // Call class constructors preemptively, so that we cannot get into an infinite - // loop constructing a TypeInitializationException. If this were omitted, - // we could get the Infinite recursion assert above by failing type initialization - // between the Push and Pop calls below. - if (!_resourceManagerInited) - { - RuntimeHelpers.RunClassConstructor(typeof(ResourceManager).TypeHandle); - RuntimeHelpers.RunClassConstructor(typeof(ResourceReader).TypeHandle); - RuntimeHelpers.RunClassConstructor(typeof(RuntimeResourceSet).TypeHandle); - RuntimeHelpers.RunClassConstructor(typeof(BinaryReader).TypeHandle); - _resourceManagerInited = true; - } - - _currentlyLoading.Add(key); // Push - - if (ResourceManager == null) - { - ResourceManager = new ResourceManager(SR.ResourceType); - } - string s = ResourceManager.GetString(key, null); - _currentlyLoading.RemoveAt(_currentlyLoading.Count - 1); // Pop - - Debug.Assert(s != null, "Managed resource string lookup failed. Was your resource name misspelled? Did you rebuild mscorlib after adding a resource to resources.txt? Debug this w/ cordbg and bug whoever owns the code that called SR.GetResourceString. Resource name was: \"" + key + "\""); - return s ?? key; - } - catch - { - if (lockTaken) - { - // Backout code - throw away potentially corrupt state - ResourceManager = null; - _currentlyLoading = null; - } - throw; - } - finally - { - if (lockTaken) - { - Monitor.Exit(_lock); - } - } - } - - internal static string Format(string resourceFormat, params object[] args) - { - if (args != null) - { - if (UsingResourceKeys()) - { - return resourceFormat + String.Join(", ", args); - } - - return String.Format(resourceFormat, args); - } - - return resourceFormat; - } - - internal static string Format(string resourceFormat, object p1) - { - if (UsingResourceKeys()) - { - return String.Join(", ", resourceFormat, p1); - } - - return String.Format(resourceFormat, p1); - } - - internal static string Format(string resourceFormat, object p1, object p2) - { - if (UsingResourceKeys()) - { - return String.Join(", ", resourceFormat, p1, p2); - } - - return String.Format(resourceFormat, p1, p2); - } - - internal static string Format(string resourceFormat, object p1, object p2, object p3) - { - if (UsingResourceKeys()) - { - return String.Join(", ", resourceFormat, p1, p2, p3); - } - return String.Format(resourceFormat, p1, p2, p3); - } - } -} diff --git a/src/mscorlib/Resources/Strings.resx b/src/mscorlib/Resources/Strings.resx deleted file mode 100644 index c9f8a63625..0000000000 --- a/src/mscorlib/Resources/Strings.resx +++ /dev/null @@ -1,4902 +0,0 @@ -<?xml version="1.0" encoding="utf-8"?> -<root> - <!-- - Microsoft ResX Schema - - Version 2.0 - - The primary goals of this format is to allow a simple XML format - that is mostly human readable. The generation and parsing of the - various data types are done through the TypeConverter classes - associated with the data types. - - Example: - - ... ado.net/XML headers & schema ... - <resheader name="resmimetype">text/microsoft-resx</resheader> - <resheader name="version">2.0</resheader> - <resheader name="reader">System.Resources.ResXResourceReader, System.Windows.Forms, ...</resheader> - <resheader name="writer">System.Resources.ResXResourceWriter, System.Windows.Forms, ...</resheader> - <data name="Name1"><value>this is my long string</value><comment>this is a comment</comment></data> - <data name="Color1" type="System.Drawing.Color, System.Drawing">Blue</data> - <data name="Bitmap1" mimetype="application/x-microsoft.net.object.binary.base64"> - <value>[base64 mime encoded serialized .NET Framework object]</value> - </data> - <data name="Icon1" type="System.Drawing.Icon, System.Drawing" mimetype="application/x-microsoft.net.object.bytearray.base64"> - <value>[base64 mime encoded string representing a byte array form of the .NET Framework object]</value> - <comment>This is a comment</comment> - </data> - - There are any number of "resheader" rows that contain simple - name/value pairs. - - Each data row contains a name, and value. The row also contains a - type or mimetype. Type corresponds to a .NET class that support - text/value conversion through the TypeConverter architecture. - Classes that don't support this are serialized and stored with the - mimetype set. - - The mimetype is used for serialized objects, and tells the - ResXResourceReader how to depersist the object. This is currently not - extensible. For a given mimetype the value must be set accordingly: - - Note - application/x-microsoft.net.object.binary.base64 is the format - that the ResXResourceWriter will generate, however the reader can - read any of the formats listed below. - - mimetype: application/x-microsoft.net.object.binary.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Binary.BinaryFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.soap.base64 - value : The object must be serialized with - : System.Runtime.Serialization.Formatters.Soap.SoapFormatter - : and then encoded with base64 encoding. - - mimetype: application/x-microsoft.net.object.bytearray.base64 - value : The object must be serialized into a byte array - : using a System.ComponentModel.TypeConverter - : and then encoded with base64 encoding. - --> - <xsd:schema id="root" xmlns="" xmlns:xsd="http://www.w3.org/2001/XMLSchema" xmlns:msdata="urn:schemas-microsoft-com:xml-msdata"> - <xsd:import namespace="http://www.w3.org/XML/1998/namespace" /> - <xsd:element name="root" msdata:IsDataSet="true"> - <xsd:complexType> - <xsd:choice maxOccurs="unbounded"> - <xsd:element name="metadata"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" /> - </xsd:sequence> - <xsd:attribute name="name" use="required" type="xsd:string" /> - <xsd:attribute name="type" type="xsd:string" /> - <xsd:attribute name="mimetype" type="xsd:string" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="assembly"> - <xsd:complexType> - <xsd:attribute name="alias" type="xsd:string" /> - <xsd:attribute name="name" type="xsd:string" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="data"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - <xsd:element name="comment" type="xsd:string" minOccurs="0" msdata:Ordinal="2" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" msdata:Ordinal="1" /> - <xsd:attribute name="type" type="xsd:string" msdata:Ordinal="3" /> - <xsd:attribute name="mimetype" type="xsd:string" msdata:Ordinal="4" /> - <xsd:attribute ref="xml:space" /> - </xsd:complexType> - </xsd:element> - <xsd:element name="resheader"> - <xsd:complexType> - <xsd:sequence> - <xsd:element name="value" type="xsd:string" minOccurs="0" msdata:Ordinal="1" /> - </xsd:sequence> - <xsd:attribute name="name" type="xsd:string" use="required" /> - </xsd:complexType> - </xsd:element> - </xsd:choice> - </xsd:complexType> - </xsd:element> - </xsd:schema> - <resheader name="resmimetype"> - <value>text/microsoft-resx</value> - </resheader> - <resheader name="version"> - <value>2.0</value> - </resheader> - <resheader name="reader"> - <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <resheader name="writer"> - <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> - </resheader> - <data name="Acc_CreateAbst" xml:space="preserve"> - <value>Cannot create an abstract class.</value> - </data> - <data name="Acc_CreateAbstEx" xml:space="preserve"> - <value>Cannot create an instance of {0} because it is an abstract class.</value> - </data> - <data name="Acc_CreateArgIterator" xml:space="preserve"> - <value>Cannot dynamically create an instance of ArgIterator.</value> - </data> - <data name="Acc_CreateGeneric" xml:space="preserve"> - <value>Cannot create a type for which Type.ContainsGenericParameters is true.</value> - </data> - <data name="Acc_CreateGenericEx" xml:space="preserve"> - <value>Cannot create an instance of {0} because Type.ContainsGenericParameters is true.</value> - </data> - <data name="Acc_CreateInterface" xml:space="preserve"> - <value>Cannot create an instance of an interface.</value> - </data> - <data name="Acc_CreateInterfaceEx" xml:space="preserve"> - <value>Cannot create an instance of {0} because it is an interface.</value> - </data> - <data name="Acc_CreateVoid" xml:space="preserve"> - <value>Cannot dynamically create an instance of System.Void.</value> - </data> - <data name="Acc_NotClassInit" xml:space="preserve"> - <value>Type initializer was not callable.</value> - </data> - <data name="Acc_ReadOnly" xml:space="preserve"> - <value>Cannot set a constant field.</value> - </data> - <data name="Acc_RvaStatic" xml:space="preserve"> - <value>SkipVerification permission is needed to modify an image-based (RVA) static field.</value> - </data> - <data name="Access_Void" xml:space="preserve"> - <value>Cannot create an instance of void.</value> - </data> - <data name="AggregateException_ctor_DefaultMessage" xml:space="preserve"> - <value>One or more errors occurred.</value> - </data> - <data name="AggregateException_ctor_InnerExceptionNull" xml:space="preserve"> - <value>An element of innerExceptions was null.</value> - </data> - <data name="AggregateException_DeserializationFailure" xml:space="preserve"> - <value>The serialization stream contains no inner exceptions.</value> - </data> - <data name="AggregateException_ToString" xml:space="preserve"> - <value>{0}{1}---> (Inner Exception #{2}) {3}{4}{5}</value> - </data> - <data name="All_ToString" xml:space="preserve"> - <value>All code</value> - </data> - <data name="AllocatedFrom" xml:space="preserve"> - <value>Allocated from:</value> - </data> - <data name="AppDomain_AppBaseNotSet" xml:space="preserve"> - <value>The ApplicationBase must be set before retrieving this property.</value> - </data> - <data name="AppDomain_BindingModelIsLocked" xml:space="preserve"> - <value>Binding model is already locked for the AppDomain and cannot be reset.</value> - </data> - <data name="AppDomain_RequireApplicationName" xml:space="preserve"> - <value>ApplicationName must be set before the DynamicBase can be set.</value> - </data> - <data name="ApplicationDirectory_ToString" xml:space="preserve"> - <value>ApplicationDirectory</value> - </data> - <data name="Arg_AccessException" xml:space="preserve"> - <value>Cannot access member.</value> - </data> - <data name="Arg_AccessViolationException" xml:space="preserve"> - <value>Attempted to read or write protected memory. This is often an indication that other memory is corrupt.</value> - </data> - <data name="Arg_AmbiguousMatchException" xml:space="preserve"> - <value>Ambiguous match found.</value> - </data> - <data name="Arg_AppDomainUnloadedException" xml:space="preserve"> - <value>Attempted to access an unloaded AppDomain.</value> - </data> - <data name="Arg_ApplicationException" xml:space="preserve"> - <value>Error in the application.</value> - </data> - <data name="Arg_ArgumentException" xml:space="preserve"> - <value>Value does not fall within the expected range.</value> - </data> - <data name="Arg_ArgumentOutOfRangeException" xml:space="preserve"> - <value>Specified argument was out of the range of valid values.</value> - </data> - <data name="Arg_ArithmeticException" xml:space="preserve"> - <value>Overflow or underflow in the arithmetic operation.</value> - </data> - <data name="Arg_ArrayLengthsDiffer" xml:space="preserve"> - <value>Array lengths must be the same.</value> - </data> - <data name="Arg_ArrayPlusOffTooSmall" xml:space="preserve"> - <value>Destination array is not long enough to copy all the items in the collection. Check array index and length.</value> - </data> - <data name="Arg_ArrayTypeMismatchException" xml:space="preserve"> - <value>Attempted to access an element as a type incompatible with the array.</value> - </data> - <data name="Arg_ArrayZeroError" xml:space="preserve"> - <value>Array must not be of length zero.</value> - </data> - <data name="Arg_AssemblyNullModule" xml:space="preserve"> - <value>The manifest module of the assembly cannot be null.</value> - </data> - <data name="Arg_BadDecimal" xml:space="preserve"> - <value>Read an invalid decimal value from the buffer.</value> - </data> - <data name="Arg_BadImageFormatException" xml:space="preserve"> - <value>Format of the executable (.exe) or library (.dll) is invalid.</value> - </data> - <data name="Arg_BadLiteralFormat" xml:space="preserve"> - <value>Encountered an invalid type for a default value.</value> - </data> - <data name="Arg_BitArrayTypeUnsupported" xml:space="preserve"> - <value>Only supported array types for CopyTo on BitArrays are Boolean[], Int32[] and Byte[].</value> - </data> - <data name="Arg_BogusIComparer" xml:space="preserve"> - <value>Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: '{0}'.</value> - </data> - <data name="Arg_BufferTooSmall" xml:space="preserve"> - <value>Not enough space available in the buffer.</value> - </data> - <data name="Arg_CannotBeNaN" xml:space="preserve"> - <value>TimeSpan does not accept floating point Not-a-Number values.</value> - </data> - <data name="Arg_CannotHaveNegativeValue" xml:space="preserve"> - <value>String cannot contain a minus sign if the base is not 10.</value> - </data> - <data name="Arg_CannotMixComparisonInfrastructure" xml:space="preserve"> - <value>The usage of IKeyComparer and IHashCodeProvider/IComparer interfaces cannot be mixed; use one or the other.</value> - </data> - <data name="Arg_CannotUnloadAppDomainException" xml:space="preserve"> - <value>Attempt to unload the AppDomain failed.</value> - </data> - <data name="Arg_CATypeResolutionFailed" xml:space="preserve"> - <value>Failed to resolve type from string "{0}" which was embedded in custom attribute blob.</value> - </data> - <data name="Arg_COMAccess" xml:space="preserve"> - <value>Must specify property Set or Get or method call for a COM Object.</value> - </data> - <data name="Arg_COMException" xml:space="preserve"> - <value>Error HRESULT E_FAIL has been returned from a call to a COM component.</value> - </data> - <data name="Arg_COMPropSetPut" xml:space="preserve"> - <value>Only one of the following binding flags can be set: BindingFlags.SetProperty, BindingFlags.PutDispProperty, BindingFlags.PutRefDispProperty.</value> - </data> - <data name="Arg_ContextMarshalException" xml:space="preserve"> - <value>Attempted to marshal an object across a context boundary.</value> - </data> - <data name="Arg_CorruptedCustomCultureFile" xml:space="preserve"> - <value>The file of the custom culture {0} is corrupt. Try to unregister this culture.</value> - </data> - <data name="Arg_CreatInstAccess" xml:space="preserve"> - <value>Cannot specify both CreateInstance and another access type.</value> - </data> - <data name="Arg_CryptographyException" xml:space="preserve"> - <value>Error occurred during a cryptographic operation.</value> - </data> - <data name="Arg_CustomAttributeFormatException" xml:space="preserve"> - <value>Binary format of the specified custom attribute was invalid.</value> - </data> - <data name="Arg_DataMisalignedException" xml:space="preserve"> - <value>A datatype misalignment was detected in a load or store instruction.</value> - </data> - <data name="Arg_DateTimeRange" xml:space="preserve"> - <value>Combination of arguments to the DateTime constructor is out of the legal range.</value> - </data> - <data name="Arg_DecBitCtor" xml:space="preserve"> - <value>Decimal byte array constructor requires an array of length four containing valid decimal bytes.</value> - </data> - <data name="Arg_DevicesNotSupported" xml:space="preserve"> - <value>FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\\\\.\\" in the path.</value> - </data> - <data name="Arg_DirectoryNotFoundException" xml:space="preserve"> - <value>Attempted to access a path that is not on the disk.</value> - </data> - <data name="Arg_DivideByZero" xml:space="preserve"> - <value>Attempted to divide by zero.</value> - </data> - <data name="Arg_DlgtNullInst" xml:space="preserve"> - <value>Delegate to an instance method cannot have null 'this'.</value> - </data> - <data name="Arg_DlgtTargMeth" xml:space="preserve"> - <value>Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type.</value> - </data> - <data name="Arg_DlgtTypeMis" xml:space="preserve"> - <value>Delegates must be of the same type.</value> - </data> - <data name="Arg_DllInitFailure" xml:space="preserve"> - <value>One machine may not have remote administration enabled, or both machines may not be running the remote registry service.</value> - </data> - <data name="Arg_DllNotFoundException" xml:space="preserve"> - <value>Dll was not found.</value> - </data> - <data name="Arg_DriveNotFoundException" xml:space="preserve"> - <value>Attempted to access a drive that is not available.</value> - </data> - <data name="Arg_DuplicateWaitObjectException" xml:space="preserve"> - <value>Duplicate objects in argument.</value> - </data> - <data name="Arg_EHClauseNotClause" xml:space="preserve"> - <value>This ExceptionHandlingClause is not a clause.</value> - </data> - <data name="Arg_EHClauseNotFilter" xml:space="preserve"> - <value>This ExceptionHandlingClause is not a filter.</value> - </data> - <data name="Arg_EmptyArray" xml:space="preserve"> - <value>Array may not be empty.</value> - </data> - <data name="Arg_EmptyCollection" xml:space="preserve"> - <value>Collection must not be empty.</value> - </data> - <data name="Arg_EmptyOrNullArray" xml:space="preserve"> - <value>Array may not be empty or null.</value> - </data> - <data name="Arg_EmptyOrNullString" xml:space="preserve"> - <value>String may not be empty or null.</value> - </data> - <data name="Arg_EndOfStreamException" xml:space="preserve"> - <value>Attempted to read past the end of the stream.</value> - </data> - <data name="Arg_EntryPointNotFoundException" xml:space="preserve"> - <value>Entry point was not found.</value> - </data> - <data name="Arg_EnumAndObjectMustBeSameType" xml:space="preserve"> - <value>Object must be the same type as the enum. The type passed in was '{0}'; the enum type was '{1}'.</value> - </data> - <data name="Arg_EnumAtLeastOneFlag" xml:space="preserve"> - <value>Must set at least one flag.</value> - </data> - <data name="Arg_EnumFormatUnderlyingTypeAndObjectMustBeSameType" xml:space="preserve"> - <value>Enum underlying type and the object must be same type or object. Type passed in was '{0}'; the enum underlying type was '{1}'.</value> - </data> - <data name="Arg_EnumIllegalVal" xml:space="preserve"> - <value>Illegal enum value: {0}.</value> - </data> - <data name="Arg_EnumLitValueNotFound" xml:space="preserve"> - <value>Literal value was not found.</value> - </data> - <data name="Arg_EnumMustHaveUnderlyingValueField" xml:space="preserve"> - <value>All enums must have an underlying value__ field.</value> - </data> - <data name="Arg_EnumNotSingleFlag" xml:space="preserve"> - <value>Must set exactly one flag.</value> - </data> - <data name="Arg_EnumUnderlyingTypeAndObjectMustBeSameType" xml:space="preserve"> - <value>Enum underlying type and the object must be same type or object must be a String. Type passed in was '{0}'; the enum underlying type was '{1}'.</value> - </data> - <data name="Arg_EnumValueNotFound" xml:space="preserve"> - <value>Requested value '{0}' was not found.</value> - </data> - <data name="Arg_ExecutionEngineException" xml:space="preserve"> - <value>Internal error in the runtime.</value> - </data> - <data name="Arg_ExternalException" xml:space="preserve"> - <value>External component has thrown an exception.</value> - </data> - <data name="Arg_FieldAccessException" xml:space="preserve"> - <value>Attempted to access a field that is not accessible by the caller.</value> - </data> - <data name="Arg_FieldDeclTarget" xml:space="preserve"> - <value>Field '{0}' defined on type '{1}' is not a field on the target object which is of type '{2}'.</value> - </data> - <data name="Arg_FileIsDirectory_Name" xml:space="preserve"> - <value>The target file "{0}" is a directory, not a file.</value> - </data> - <data name="Arg_FldGetArgErr" xml:space="preserve"> - <value>No arguments can be provided to Get a field value.</value> - </data> - <data name="Arg_FldGetPropSet" xml:space="preserve"> - <value>Cannot specify both GetField and SetProperty.</value> - </data> - <data name="Arg_FldSetArgErr" xml:space="preserve"> - <value>Only the field value can be specified to set a field value.</value> - </data> - <data name="Arg_FldSetGet" xml:space="preserve"> - <value>Cannot specify both Get and Set on a field.</value> - </data> - <data name="Arg_FldSetInvoke" xml:space="preserve"> - <value>Cannot specify Set on a Field and Invoke on a method.</value> - </data> - <data name="Arg_FldSetPropGet" xml:space="preserve"> - <value>Cannot specify both SetField and GetProperty.</value> - </data> - <data name="Arg_FormatException" xml:space="preserve"> - <value>One of the identified items was in an invalid format.</value> - </data> - <data name="Arg_GenericParameter" xml:space="preserve"> - <value>Method must be called on a Type for which Type.IsGenericParameter is false.</value> - </data> - <data name="Arg_GetMethNotFnd" xml:space="preserve"> - <value>Property Get method was not found.</value> - </data> - <data name="Arg_GuidArrayCtor" xml:space="preserve"> - <value>Byte array for GUID must be exactly {0} bytes long.</value> - </data> - <data name="Arg_HandleNotAsync" xml:space="preserve"> - <value>Handle does not support asynchronous operations. The parameters to the FileStream constructor may need to be changed to indicate that the handle was opened synchronously (that is, it was not opened for overlapped I/O).</value> - </data> - <data name="Arg_HandleNotSync" xml:space="preserve"> - <value>Handle does not support synchronous operations. The parameters to the FileStream constructor may need to be changed to indicate that the handle was opened asynchronously (that is, it was opened explicitly for overlapped I/O).</value> - </data> - <data name="Arg_HexStyleNotSupported" xml:space="preserve"> - <value>The number style AllowHexSpecifier is not supported on floating point data types.</value> - </data> - <data name="Arg_HTCapacityOverflow" xml:space="preserve"> - <value>Hashtable's capacity overflowed and went negative. Check load factor, capacity and the current size of the table.</value> - </data> - <data name="Arg_ImporterLoadFailure" xml:space="preserve"> - <value>The type library importer encountered an error during type verification. Try importing without class members.</value> - </data> - <data name="Arg_IndexMustBeInt" xml:space="preserve"> - <value>All indexes must be of type Int32.</value> - </data> - <data name="Arg_IndexOutOfRangeException" xml:space="preserve"> - <value>Index was outside the bounds of the array.</value> - </data> - <data name="Arg_InsufficientExecutionStackException" xml:space="preserve"> - <value>Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space.</value> - </data> - <data name="Arg_InvalidAccessEntry" xml:space="preserve"> - <value>Specified access entry is invalid because it is unrestricted. The global flags should be specified instead.</value> - </data> - <data name="Arg_InvalidANSIString" xml:space="preserve"> - <value>The ANSI string passed in could not be converted from the default ANSI code page to Unicode.</value> - </data> - <data name="Arg_InvalidBase" xml:space="preserve"> - <value>Invalid Base.</value> - </data> - <data name="Arg_InvalidCastException" xml:space="preserve"> - <value>Specified cast is not valid.</value> - </data> - <data name="Arg_InvalidComObjectException" xml:space="preserve"> - <value>Attempt has been made to use a COM object that does not have a backing class factory.</value> - </data> - <data name="Arg_InvalidConsoleColor" xml:space="preserve"> - <value>The ConsoleColor enum value was not defined on that enum. Please use a defined color from the enum.</value> - </data> - <data name="Arg_InvalidFileAttrs" xml:space="preserve"> - <value>Invalid File or Directory attributes value.</value> - </data> - <data name="Arg_InvalidFileExtension" xml:space="preserve"> - <value>Specified file extension was not a valid extension.</value> - </data> - <data name="Arg_InvalidFileName" xml:space="preserve"> - <value>Specified file name was invalid.</value> - </data> - <data name="Arg_InvalidFilterCriteriaException" xml:space="preserve"> - <value>Specified filter criteria was invalid.</value> - </data> - <data name="Arg_InvalidHandle" xml:space="preserve"> - <value>Invalid handle.</value> - </data> - <data name="Arg_InvalidHexStyle" xml:space="preserve"> - <value>With the AllowHexSpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be a subset of those in HexNumber.</value> - </data> - <data name="Arg_InvalidNeutralResourcesLanguage_Asm_Culture" xml:space="preserve"> - <value>The NeutralResourcesLanguageAttribute on the assembly "{0}" specifies an invalid culture name: "{1}".</value> - </data> - <data name="Arg_InvalidNeutralResourcesLanguage_FallbackLoc" xml:space="preserve"> - <value>The NeutralResourcesLanguageAttribute specifies an invalid or unrecognized ultimate resource fallback location: "{0}".</value> - </data> - <data name="Arg_InvalidOleVariantTypeException" xml:space="preserve"> - <value>Specified OLE variant was invalid.</value> - </data> - <data name="Arg_InvalidOperationException" xml:space="preserve"> - <value>Operation is not valid due to the current state of the object.</value> - </data> - <data name="Arg_InvalidSatelliteContract_Asm_Ver" xml:space="preserve"> - <value>Satellite contract version attribute on the assembly '{0}' specifies an invalid version: {1}.</value> - </data> - <data name="Arg_InvalidSearchPattern" xml:space="preserve"> - <value>Search pattern cannot contain ".." to move up directories and can be contained only internally in file/directory names, as in "a..b".</value> - </data> - <data name="Arg_InvalidTypeInRetType" xml:space="preserve"> - <value>The return Type contains some invalid type (i.e. null, ByRef)</value> - </data> - <data name="Arg_InvalidTypeInSignature" xml:space="preserve"> - <value>The signature Type array contains some invalid type (i.e. null, void)</value> - </data> - <data name="Arg_InvalidUTF8String" xml:space="preserve"> - <value>The UTF8 string passed in could not be converted to Unicode.</value> - </data> - <data name="Arg_InvokeMember" xml:space="preserve"> - <value>InvokeMember can be used only for COM objects.</value> - </data> - <data name="Arg_IOException" xml:space="preserve"> - <value>I/O error occurred.</value> - </data> - <data name="Arg_KeyNotFound" xml:space="preserve"> - <value>The given key was not present in the dictionary.</value> - </data> - <data name="Arg_LongerThanDestArray" xml:space="preserve"> - <value>Destination array was not long enough. Check the destination index, length, and the array's lower bounds.</value> - </data> - <data name="Arg_LongerThanSrcArray" xml:space="preserve"> - <value>Source array was not long enough. Check the source index, length, and the array's lower bounds.</value> - </data> - <data name="Arg_LongerThanSrcString" xml:space="preserve"> - <value>Source string was not long enough. Check sourceIndex and count.</value> - </data> - <data name="Arg_LowerBoundsMustMatch" xml:space="preserve"> - <value>The arrays' lower bounds must be identical.</value> - </data> - <data name="Arg_MarshalAsAnyRestriction" xml:space="preserve"> - <value>AsAny cannot be used on return types, ByRef parameters, ArrayWithOffset, or parameters passed from unmanaged to managed.</value> - </data> - <data name="Arg_MarshalDirectiveException" xml:space="preserve"> - <value>Marshaling directives are invalid.</value> - </data> - <data name="Arg_MemberInfoNullModule" xml:space="preserve"> - <value>The Module object containing the member cannot be null.</value> - </data> - <data name="Arg_MethodAccessException" xml:space="preserve"> - <value>Attempt to access the method failed.</value> - </data> - <data name="Arg_MethodAccessException_WithCaller" xml:space="preserve"> - <value>Attempt by security transparent method '{0}' to access security critical method '{1}' failed.</value> - </data> - <data name="Arg_MethodAccessException_WithMethodName" xml:space="preserve"> - <value>Attempt to access the method "{0}" on type "{1}" failed.</value> - </data> - <data name="Arg_MissingActivationArguments" xml:space="preserve"> - <value>The AppDomainSetup must specify the activation arguments for this call.</value> - </data> - <data name="Arg_MissingFieldException" xml:space="preserve"> - <value>Attempted to access a non-existing field.</value> - </data> - <data name="Arg_MissingManifestResourceException" xml:space="preserve"> - <value>Unable to find manifest resource.</value> - </data> - <data name="Arg_MissingMemberException" xml:space="preserve"> - <value>Attempted to access a missing member.</value> - </data> - <data name="Arg_MissingMethodException" xml:space="preserve"> - <value>Attempted to access a missing method.</value> - </data> - <data name="Arg_MulticastNotSupportedException" xml:space="preserve"> - <value>Attempted to add multiple callbacks to a delegate that does not support multicast.</value> - </data> - <data name="Arg_MustAllBeRuntimeType" xml:space="preserve"> - <value>At least one type argument is not a runtime type.</value> - </data> - <data name="Arg_MustBeBoolean" xml:space="preserve"> - <value>Object must be of type Boolean.</value> - </data> - <data name="Arg_MustBeByte" xml:space="preserve"> - <value>Object must be of type Byte.</value> - </data> - <data name="Arg_MustBeChar" xml:space="preserve"> - <value>Object must be of type Char.</value> - </data> - <data name="Arg_MustBeDateTime" xml:space="preserve"> - <value>Object must be of type DateTime.</value> - </data> - <data name="Arg_MustBeDateTimeOffset" xml:space="preserve"> - <value>Object must be of type DateTimeOffset.</value> - </data> - <data name="Arg_MustBeDecimal" xml:space="preserve"> - <value>Object must be of type Decimal.</value> - </data> - <data name="Arg_MustBeDelegate" xml:space="preserve"> - <value>Type must derive from Delegate.</value> - </data> - <data name="Arg_MustBeDouble" xml:space="preserve"> - <value>Object must be of type Double.</value> - </data> - <data name="Arg_MustBeDriveLetterOrRootDir" xml:space="preserve"> - <value>Object must be a root directory ("C:\\") or a drive letter ("C").</value> - </data> - <data name="Arg_MustBeEnum" xml:space="preserve"> - <value>Type provided must be an Enum.</value> - </data> - <data name="Arg_MustBeEnumBaseTypeOrEnum" xml:space="preserve"> - <value>The value passed in must be an enum base or an underlying type for an enum, such as an Int32.</value> - </data> - <data name="Arg_MustBeGuid" xml:space="preserve"> - <value>Object must be of type GUID.</value> - </data> - <data name="Arg_MustBeIdentityReferenceType" xml:space="preserve"> - <value>Type must be an IdentityReference, such as NTAccount or SecurityIdentifier.</value> - </data> - <data name="Arg_MustBeInt16" xml:space="preserve"> - <value>Object must be of type Int16.</value> - </data> - <data name="Arg_MustBeInt32" xml:space="preserve"> - <value>Object must be of type Int32.</value> - </data> - <data name="Arg_MustBeInt64" xml:space="preserve"> - <value>Object must be of type Int64.</value> - </data> - <data name="Arg_MustBeInterface" xml:space="preserve"> - <value>Type passed must be an interface.</value> - </data> - <data name="Arg_MustBePointer" xml:space="preserve"> - <value>Type must be a Pointer.</value> - </data> - <data name="Arg_MustBePrimArray" xml:space="preserve"> - <value>Object must be an array of primitives.</value> - </data> - <data name="Arg_MustBeSByte" xml:space="preserve"> - <value>Object must be of type SByte.</value> - </data> - <data name="Arg_MustBeSingle" xml:space="preserve"> - <value>Object must be of type Single.</value> - </data> - <data name="Arg_MustBeStatic" xml:space="preserve"> - <value>Method must be a static method.</value> - </data> - <data name="Arg_MustBeString" xml:space="preserve"> - <value>Object must be of type String.</value> - </data> - <data name="Arg_MustBeStringPtrNotAtom" xml:space="preserve"> - <value>The pointer passed in as a String must not be in the bottom 64K of the process's address space.</value> - </data> - <data name="Arg_MustBeTimeSpan" xml:space="preserve"> - <value>Object must be of type TimeSpan.</value> - </data> - <data name="Arg_MustBeTrue" xml:space="preserve"> - <value>Argument must be true.</value> - </data> - <data name="Arg_MustBeType" xml:space="preserve"> - <value>Type must be a type provided by the runtime.</value> - </data> - <data name="Arg_MustBeUInt16" xml:space="preserve"> - <value>Object must be of type UInt16.</value> - </data> - <data name="Arg_MustBeUInt32" xml:space="preserve"> - <value>Object must be of type UInt32.</value> - </data> - <data name="Arg_MustBeUInt64" xml:space="preserve"> - <value>Object must be of type UInt64.</value> - </data> - <data name="Arg_MustBeVersion" xml:space="preserve"> - <value>Object must be of type Version.</value> - </data> - <data name="Arg_MustContainEnumInfo" xml:space="preserve"> - <value>Must specify valid information for parsing in the string.</value> - </data> - <data name="Arg_NamedParamNull" xml:space="preserve"> - <value>Named parameter value must not be null.</value> - </data> - <data name="Arg_NamedParamTooBig" xml:space="preserve"> - <value>Named parameter array cannot be bigger than argument array.</value> - </data> - <data name="Arg_NDirectBadObject" xml:space="preserve"> - <value>No PInvoke conversion exists for value passed to Object-typed parameter.</value> - </data> - <data name="Arg_Need1DArray" xml:space="preserve"> - <value>Array was not a one-dimensional array.</value> - </data> - <data name="Arg_Need2DArray" xml:space="preserve"> - <value>Array was not a two-dimensional array.</value> - </data> - <data name="Arg_Need3DArray" xml:space="preserve"> - <value>Array was not a three-dimensional array.</value> - </data> - <data name="Arg_NeedAtLeast1Rank" xml:space="preserve"> - <value>Must provide at least one rank.</value> - </data> - <data name="Arg_NegativeArgCount" xml:space="preserve"> - <value>Argument count must not be negative.</value> - </data> - <data name="Arg_NoAccessSpec" xml:space="preserve"> - <value>Must specify binding flags describing the invoke operation required (BindingFlags.InvokeMethod CreateInstance GetField SetField GetProperty SetProperty).</value> - </data> - <data name="Arg_NoDefCTor" xml:space="preserve"> - <value>No parameterless constructor defined for this object.</value> - </data> - <data name="Arg_NoImporterCallback" xml:space="preserve"> - <value>Specified type library importer callback was invalid because it did not support the ITypeLibImporterNotifySink interface.</value> - </data> - <data name="Arg_NoITypeInfo" xml:space="preserve"> - <value>Specified TypeInfo was invalid because it did not support the ITypeInfo interface.</value> - </data> - <data name="Arg_NoITypeLib" xml:space="preserve"> - <value>Specified TypeLib was invalid because it did not support the ITypeLib interface.</value> - </data> - <data name="Arg_NonZeroLowerBound" xml:space="preserve"> - <value>The lower bound of target array must be zero.</value> - </data> - <data name="Arg_NoStaticVirtual" xml:space="preserve"> - <value>Method cannot be both static and virtual.</value> - </data> - <data name="Arg_NotFiniteNumberException" xml:space="preserve"> - <value>Number encountered was not a finite quantity.</value> - </data> - <data name="Arg_NotFoundIFace" xml:space="preserve"> - <value>Interface not found.</value> - </data> - <data name="Arg_NotGenericMethodDefinition" xml:space="preserve"> - <value>{0} is not a GenericMethodDefinition. MakeGenericMethod may only be called on a method for which MethodBase.IsGenericMethodDefinition is true.</value> - </data> - <data name="Arg_NotGenericParameter" xml:space="preserve"> - <value>Method may only be called on a Type for which Type.IsGenericParameter is true.</value> - </data> - <data name="Arg_NotGenericTypeDefinition" xml:space="preserve"> - <value>{0} is not a GenericTypeDefinition. MakeGenericType may only be called on a type for which Type.IsGenericTypeDefinition is true.</value> - </data> - <data name="Arg_NotImplementedException" xml:space="preserve"> - <value>The method or operation is not implemented.</value> - </data> - <data name="Arg_NotSupportedException" xml:space="preserve"> - <value>Specified method is not supported.</value> - </data> - <data name="Arg_NullIndex" xml:space="preserve"> - <value>Arrays indexes must be set to an object instance.</value> - </data> - <data name="Arg_NullReferenceException" xml:space="preserve"> - <value>Object reference not set to an instance of an object.</value> - </data> - <data name="Arg_ObjObj" xml:space="preserve"> - <value>Object type cannot be converted to target type.</value> - </data> - <data name="Arg_ObjObjEx" xml:space="preserve"> - <value>Object of type '{0}' cannot be converted to type '{1}'.</value> - </data> - <data name="Arg_OleAutDateInvalid" xml:space="preserve"> - <value>Not a legal OleAut date.</value> - </data> - <data name="Arg_OleAutDateScale" xml:space="preserve"> - <value>OleAut date did not convert to a DateTime correctly.</value> - </data> - <data name="Arg_OverflowException" xml:space="preserve"> - <value>Arithmetic operation resulted in an overflow.</value> - </data> - <data name="Arg_ParameterInfoNullMember" xml:space="preserve"> - <value>The MemberInfo object defining the parameter cannot be null.</value> - </data> - <data name="Arg_ParameterInfoNullModule" xml:space="preserve"> - <value>The Module object containing the parameter cannot be null.</value> - </data> - <data name="Arg_ParamName_Name" xml:space="preserve"> - <value>Parameter name: {0}</value> - </data> - <data name="Arg_ParmArraySize" xml:space="preserve"> - <value>Must specify one or more parameters.</value> - </data> - <data name="Arg_ParmCnt" xml:space="preserve"> - <value>Parameter count mismatch.</value> - </data> - <data name="Arg_Path2IsRooted" xml:space="preserve"> - <value>Second path fragment must not be a drive or UNC name.</value> - </data> - <data name="Arg_PathGlobalRoot" xml:space="preserve"> - <value>Paths that begin with \\\\?\\GlobalRoot are internal to the kernel and should not be opened by managed applications.</value> - </data> - <data name="Arg_PathIllegal" xml:space="preserve"> - <value>The path is not of a legal form.</value> - </data> - <data name="Arg_PathIllegalUNC" xml:space="preserve"> - <value>The UNC path should be of the form \\\\server\\share.</value> - </data> - <data name="Arg_PathIsVolume" xml:space="preserve"> - <value>Path must not be a drive.</value> - </data> - <data name="Arg_PlatformNotSupported" xml:space="preserve"> - <value>Operation is not supported on this platform.</value> - </data> - <data name="Arg_PlatformSecureString" xml:space="preserve"> - <value>SecureString is only supported on Windows 2000 SP3 and higher platforms.</value> - </data> - <data name="Arg_PrimWiden" xml:space="preserve"> - <value>Cannot widen from source type to target type either because the source type is a not a primitive type or the conversion cannot be accomplished.</value> - </data> - <data name="Arg_PropNotFound" xml:space="preserve"> - <value>Could not find the specified property.</value> - </data> - <data name="Arg_PropSetGet" xml:space="preserve"> - <value>Cannot specify both Get and Set on a property.</value> - </data> - <data name="Arg_PropSetInvoke" xml:space="preserve"> - <value>Cannot specify Set on a property and Invoke on a method.</value> - </data> - <data name="Arg_RankException" xml:space="preserve"> - <value>Attempted to operate on an array with the incorrect number of dimensions.</value> - </data> - <data name="Arg_RankIndices" xml:space="preserve"> - <value>Indices length does not match the array rank.</value> - </data> - <data name="Arg_RankMultiDimNotSupported" xml:space="preserve"> - <value>Only single dimensional arrays are supported for the requested action.</value> - </data> - <data name="Arg_RanksAndBounds" xml:space="preserve"> - <value>Number of lengths and lowerBounds must match.</value> - </data> - <data name="Arg_ReflectionOnlyCA" xml:space="preserve"> - <value>It is illegal to reflect on the custom attributes of a Type loaded via ReflectionOnlyGetType (see Assembly.ReflectionOnly) -- use CustomAttributeData instead.</value> - </data> - <data name="Arg_ReflectionOnlyField" xml:space="preserve"> - <value>It is illegal to get or set the value on a field on a Type loaded via ReflectionOnlyGetType.</value> - </data> - <data name="Arg_ReflectionOnlyInvoke" xml:space="preserve"> - <value>It is illegal to invoke a method on a Type loaded via ReflectionOnlyGetType.</value> - </data> - <data name="Arg_RegBadKeyKind" xml:space="preserve"> - <value>The specified RegistryValueKind is an invalid value.</value> - </data> - <data name="Arg_RegGetOverflowBug" xml:space="preserve"> - <value>RegistryKey.GetValue does not allow a String that has a length greater than Int32.MaxValue.</value> - </data> - <data name="Arg_RegInvalidKeyName" xml:space="preserve"> - <value>Registry key name must start with a valid base key name.</value> - </data> - <data name="Arg_RegKeyDelHive" xml:space="preserve"> - <value>Cannot delete a registry hive's subtree.</value> - </data> - <data name="Arg_RegKeyNoRemoteConnect" xml:space="preserve"> - <value>No remote connection to '{0}' while trying to read the registry.</value> - </data> - <data name="Arg_RegKeyNotFound" xml:space="preserve"> - <value>The specified registry key does not exist.</value> - </data> - <data name="Arg_RegKeyOutOfRange" xml:space="preserve"> - <value>Registry HKEY was out of the legal range.</value> - </data> - <data name="Arg_RegKeyStrLenBug" xml:space="preserve"> - <value>Registry key names should not be greater than 255 characters.</value> - </data> - <data name="Arg_RegSetBadArrType" xml:space="preserve"> - <value>RegistryKey.SetValue does not support arrays of type '{0}'. Only Byte[] and String[] are supported.</value> - </data> - <data name="Arg_RegSetMismatchedKind" xml:space="preserve"> - <value>The type of the value object did not match the specified RegistryValueKind or the object could not be properly converted.</value> - </data> - <data name="Arg_RegSetStrArrNull" xml:space="preserve"> - <value>RegistryKey.SetValue does not allow a String[] that contains a null String reference.</value> - </data> - <data name="Arg_RegSubKeyAbsent" xml:space="preserve"> - <value>Cannot delete a subkey tree because the subkey does not exist.</value> - </data> - <data name="Arg_RegSubKeyValueAbsent" xml:space="preserve"> - <value>No value exists with that name.</value> - </data> - <data name="Arg_RegValStrLenBug" xml:space="preserve"> - <value>Registry value names should not be greater than 16,383 characters.</value> - </data> - <data name="Arg_RemoveArgNotFound" xml:space="preserve"> - <value>Cannot remove the specified item because it was not found in the specified Collection.</value> - </data> - <data name="Arg_ResMgrNotResSet" xml:space="preserve"> - <value>Type parameter must refer to a subclass of ResourceSet.</value> - </data> - <data name="Arg_ResourceFileUnsupportedVersion" xml:space="preserve"> - <value>The ResourceReader class does not know how to read this version of .resources files. Expected version: {0} This file: {1}</value> - </data> - <data name="Arg_ResourceNameNotExist" xml:space="preserve"> - <value>The specified resource name "{0}" does not exist in the resource file.</value> - </data> - <data name="Arg_RWLockRestoreException" xml:space="preserve"> - <value>ReaderWriterLock.RestoreLock was called without releasing all locks acquired since the call to ReleaseLock.</value> - </data> - <data name="Arg_SafeArrayRankMismatchException" xml:space="preserve"> - <value>Specified array was not of the expected rank.</value> - </data> - <data name="Arg_SafeArrayTypeMismatchException" xml:space="preserve"> - <value>Specified array was not of the expected type.</value> - </data> - <data name="Arg_SecurityException" xml:space="preserve"> - <value>Security error.</value> - </data> - <data name="Arg_SerializationException" xml:space="preserve"> - <value>Serialization error.</value> - </data> - <data name="Arg_SetMethNotFnd" xml:space="preserve"> - <value>Property set method not found.</value> - </data> - <data name="Arg_StackOverflowException" xml:space="preserve"> - <value>Operation caused a stack overflow.</value> - </data> - <data name="Arg_SurrogatesNotAllowedAsSingleChar" xml:space="preserve"> - <value>Unicode surrogate characters must be written out as pairs together in the same call, not individually. Consider passing in a character array instead.</value> - </data> - <data name="Arg_SynchronizationLockException" xml:space="preserve"> - <value>Object synchronization method was called from an unsynchronized block of code.</value> - </data> - <data name="Arg_SystemException" xml:space="preserve"> - <value>System error.</value> - </data> - <data name="Arg_TargetInvocationException" xml:space="preserve"> - <value>Exception has been thrown by the target of an invocation.</value> - </data> - <data name="Arg_TargetParameterCountException" xml:space="preserve"> - <value>Number of parameters specified does not match the expected number.</value> - </data> - <data name="Arg_ThreadStartException" xml:space="preserve"> - <value>Thread failed to start.</value> - </data> - <data name="Arg_ThreadStateException" xml:space="preserve"> - <value>Thread was in an invalid state for the operation being executed.</value> - </data> - <data name="Arg_TimeoutException" xml:space="preserve"> - <value>The operation has timed out.</value> - </data> - <data name="Arg_TypeAccessException" xml:space="preserve"> - <value>Attempt to access the type failed.</value> - </data> - <data name="Arg_TypedReference_Null" xml:space="preserve"> - <value>The TypedReference must be initialized.</value> - </data> - <data name="Arg_TypeLoadException" xml:space="preserve"> - <value>Failure has occurred while loading a type.</value> - </data> - <data name="Arg_TypeLoadNullStr" xml:space="preserve"> - <value>A null or zero length string does not represent a valid Type.</value> - </data> - <data name="Arg_TypeRefPrimitve" xml:space="preserve"> - <value>TypedReferences cannot be redefined as primitives.</value> - </data> - <data name="Arg_TypeUnloadedException" xml:space="preserve"> - <value>Type had been unloaded.</value> - </data> - <data name="Arg_UnauthorizedAccessException" xml:space="preserve"> - <value>Attempted to perform an unauthorized operation.</value> - </data> - <data name="Arg_UnboundGenField" xml:space="preserve"> - <value>Late bound operations cannot be performed on fields with types for which Type.ContainsGenericParameters is true.</value> - </data> - <data name="Arg_UnboundGenParam" xml:space="preserve"> - <value>Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true.</value> - </data> - <data name="Arg_UnknownTypeCode" xml:space="preserve"> - <value>Unknown TypeCode value.</value> - </data> - <data name="Arg_VarMissNull" xml:space="preserve"> - <value>Missing parameter does not have a default value.</value> - </data> - <data name="Arg_VersionString" xml:space="preserve"> - <value>Version string portion was too short or too long.</value> - </data> - <data name="Arg_VTableCallsNotSupportedException" xml:space="preserve"> - <value>Attempted to make an early bound call on a COM dispatch-only interface.</value> - </data> - <data name="Arg_WrongAsyncResult" xml:space="preserve"> - <value>IAsyncResult object did not come from the corresponding async method on this type.</value> - </data> - <data name="Arg_WrongType" xml:space="preserve"> - <value>The value "{0}" is not of type "{1}" and cannot be used in this generic collection.</value> - </data> - <data name="Argument_AbsolutePathRequired" xml:space="preserve"> - <value>Absolute path information is required.</value> - </data> - <data name="Argument_AddingDuplicate" xml:space="preserve"> - <value>An item with the same key has already been added.</value> - </data> - <data name="Argument_AddingDuplicate__" xml:space="preserve"> - <value>Item has already been added. Key in dictionary: '{0}' Key being added: '{1}'</value> - </data> - <data name="Argument_AddingDuplicateWithKey" xml:space="preserve"> - <value>An item with the same key has already been added. Key: {0}</value> - </data> - <data name="Argument_AdjustmentRulesAmbiguousOverlap" xml:space="preserve"> - <value>The elements of the AdjustmentRule array must not contain ambiguous time periods that extend beyond the DateStart or DateEnd properties of the element.</value> - </data> - <data name="Argument_AdjustmentRulesInvalidOverlap" xml:space="preserve"> - <value>The elements of the AdjustmentRule array must not contain invalid time periods that extend beyond the DateStart or DateEnd properties of the element.</value> - </data> - <data name="Argument_AdjustmentRulesNoNulls" xml:space="preserve"> - <value>The AdjustmentRule array cannot contain null elements.</value> - </data> - <data name="Argument_AdjustmentRulesOutOfOrder" xml:space="preserve"> - <value>The elements of the AdjustmentRule array must be in chronological order and must not overlap.</value> - </data> - <data name="Argument_AdjustmentRulesrDaylightSavingTimeOverlap" xml:space="preserve"> - <value>The elements of the AdjustmentRule array must not contain Daylight Saving Time periods that overlap adjacent elements in such a way as to cause invalid or ambiguous time periods.</value> - </data> - <data name="Argument_AdjustmentRulesrDaylightSavingTimeOverlapNonRuleRange" xml:space="preserve"> - <value>The elements of the AdjustmentRule array must not contain Daylight Saving Time periods that overlap the DateStart or DateEnd properties in such a way as to cause invalid or ambiguous time periods.</value> - </data> - <data name="Argument_AlreadyACCW" xml:space="preserve"> - <value>The object already has a CCW associated with it.</value> - </data> - <data name="Argument_AlreadyBoundOrSyncHandle" xml:space="preserve"> - <value>'handle' has already been bound to the thread pool, or was not opened for asynchronous I/O.</value> - </data> - <data name="Argument_ALSInvalidCapacity" xml:space="preserve"> - <value>Specified capacity must not be less than the current capacity.</value> - </data> - <data name="Argument_ALSInvalidSlot" xml:space="preserve"> - <value>Specified slot number was invalid.</value> - </data> - <data name="Argument_ApplicationTrustShouldHaveIdentity" xml:space="preserve"> - <value>An ApplicationTrust must have an application identity before it can be persisted.</value> - </data> - <data name="Argument_ArgumentZero" xml:space="preserve"> - <value>Argument cannot be zero.</value> - </data> - <data name="Argument_ArrayGetInterfaceMap" xml:space="preserve"> - <value>Interface maps for generic interfaces on arrays cannot be retrieved.</value> - </data> - <data name="Argument_ArraysInvalid" xml:space="preserve"> - <value>Array or pointer types are not valid.</value> - </data> - <data name="Argument_ArrayTooLarge" xml:space="preserve"> - <value>The input array length must not exceed Int32.MaxValue / {0}. Otherwise BitArray.Length would exceed Int32.MaxValue.</value> - </data> - <data name="Argument_AssemblyAlreadyFullTrust" xml:space="preserve"> - <value>Assembly was already fully trusted.</value> - </data> - <data name="Argument_AssemblyNotFullTrust" xml:space="preserve"> - <value>Assembly was not fully trusted.</value> - </data> - <data name="Argument_AssemblyWinMD" xml:space="preserve"> - <value>Assembly must not be a Windows Runtime assembly.</value> - </data> - <data name="Argument_AttributeNamesMustBeUnique" xml:space="preserve"> - <value>Attribute names must be unique.</value> - </data> - <data name="Argument_BadAttributeOnInterfaceMethod" xml:space="preserve"> - <value>Interface method must be abstract and virtual.</value> - </data> - <data name="Argument_BadCAForUnmngRSC" xml:space="preserve"> - <value>Bad '{0}' while generating unmanaged resource information.</value> - </data> - <data name="Argument_BadConstantValue" xml:space="preserve"> - <value>Bad default value.</value> - </data> - <data name="Argument_BadConstructor" xml:space="preserve"> - <value>Cannot have private or static constructor.</value> - </data> - <data name="Argument_BadConstructorCallConv" xml:space="preserve"> - <value>Constructor must have standard calling convention.</value> - </data> - <data name="Argument_BadCurrentLocalVariable" xml:space="preserve"> - <value>Bad current local variable for setting symbol information.</value> - </data> - <data name="Argument_BadExceptionCodeGen" xml:space="preserve"> - <value>Incorrect code generation for exception block.</value> - </data> - <data name="Argument_BadFieldForConstructorBuilder" xml:space="preserve"> - <value>Field must be on the same type of the given ConstructorInfo.</value> - </data> - <data name="Argument_BadFieldSig" xml:space="preserve"> - <value>Field signatures do not have return types.</value> - </data> - <data name="Argument_BadFieldType" xml:space="preserve"> - <value>Bad field type in defining field.</value> - </data> - <data name="Argument_BadFormatSpecifier" xml:space="preserve"> - <value>Format specifier was invalid.</value> - </data> - <data name="Argument_BadImageFormatExceptionResolve" xml:space="preserve"> - <value>A BadImageFormatException has been thrown while parsing the signature. This is likely due to lack of a generic context. Ensure genericTypeArguments and genericMethodArguments are provided and contain enough context.</value> - </data> - <data name="Argument_BadLabel" xml:space="preserve"> - <value>Bad label in ILGenerator.</value> - </data> - <data name="Argument_BadLabelContent" xml:space="preserve"> - <value>Bad label content in ILGenerator.</value> - </data> - <data name="Argument_BadNestedTypeFlags" xml:space="preserve"> - <value>Visibility of interfaces must be one of the following: NestedAssembly, NestedFamANDAssem, NestedFamily, NestedFamORAssem, NestedPrivate or NestedPublic.</value> - </data> - <data name="Argument_BadObjRef" xml:space="preserve"> - <value>Invalid ObjRef provided to '{0}'.</value> - </data> - <data name="Argument_BadParameterCountsForConstructor" xml:space="preserve"> - <value>Parameter count does not match passed in argument value count.</value> - </data> - <data name="Argument_BadParameterTypeForCAB" xml:space="preserve"> - <value>Cannot emit a CustomAttribute with argument of type {0}.</value> - </data> - <data name="Argument_BadParameterTypeForConstructor" xml:space="preserve"> - <value>Passed in argument value at index {0} does not match the parameter type.</value> - </data> - <data name="Argument_BadPersistableModuleInTransientAssembly" xml:space="preserve"> - <value>Cannot have a persistable module in a transient assembly.</value> - </data> - <data name="Argument_BadPInvokeMethod" xml:space="preserve"> - <value>PInvoke methods must be static and native and cannot be abstract.</value> - </data> - <data name="Argument_BadPInvokeOnInterface" xml:space="preserve"> - <value>PInvoke methods cannot exist on interfaces.</value> - </data> - <data name="Argument_BadPropertyForConstructorBuilder" xml:space="preserve"> - <value>Property must be on the same type of the given ConstructorInfo.</value> - </data> - <data name="Argument_BadResourceScopeTypeBits" xml:space="preserve"> - <value>Unknown value for the ResourceScope: {0} Too many resource type bits may be set.</value> - </data> - <data name="Argument_BadResourceScopeVisibilityBits" xml:space="preserve"> - <value>Unknown value for the ResourceScope: {0} Too many resource visibility bits may be set.</value> - </data> - <data name="Argument_BadSigFormat" xml:space="preserve"> - <value>Incorrect signature format.</value> - </data> - <data name="Argument_BadSizeForData" xml:space="preserve"> - <value>Data size must be > 1 and < 0x3f0000</value> - </data> - <data name="Argument_BadTypeAttrAbstractNFinal" xml:space="preserve"> - <value>Bad type attributes. A type cannot be both abstract and final.</value> - </data> - <data name="Argument_BadTypeAttrInvalidLayout" xml:space="preserve"> - <value>Bad type attributes. Invalid layout attribute specified.</value> - </data> - <data name="Argument_BadTypeAttrNestedVisibilityOnNonNestedType" xml:space="preserve"> - <value>Bad type attributes. Nested visibility flag set on a non-nested type.</value> - </data> - <data name="Argument_BadTypeAttrNonNestedVisibilityNestedType" xml:space="preserve"> - <value>Bad type attributes. Non-nested visibility flag set on a nested type.</value> - </data> - <data name="Argument_BadTypeAttrReservedBitsSet" xml:space="preserve"> - <value>Bad type attributes. Reserved bits set on the type.</value> - </data> - <data name="Argument_BadTypeInCustomAttribute" xml:space="preserve"> - <value>An invalid type was used as a custom attribute constructor argument, field or property.</value> - </data> - <data name="Argument_CannotCreateTypedReference" xml:space="preserve"> - <value>Cannot use function evaluation to create a TypedReference object.</value> - </data> - <data name="Argument_CannotGetTypeTokenForByRef" xml:space="preserve"> - <value>Cannot get TypeToken for a ByRef type.</value> - </data> - <data name="Argument_CannotPrepareAbstract" xml:space="preserve"> - <value>Abstract methods cannot be prepared.</value> - </data> - <data name="Argument_CannotSetParentToInterface" xml:space="preserve"> - <value>Cannot set parent to an interface.</value> - </data> - <data name="Argument_CantCallSecObjFunc" xml:space="preserve"> - <value>Cannot evaluate a security function.</value> - </data> - <data name="Argument_CodepageNotSupported" xml:space="preserve"> - <value>{0} is not a supported code page.</value> - </data> - <data name="Argument_CompareOptionOrdinal" xml:space="preserve"> - <value>CompareOption.Ordinal cannot be used with other options.</value> - </data> - <data name="Argument_ConflictingDateTimeRoundtripStyles" xml:space="preserve"> - <value>The DateTimeStyles value RoundtripKind cannot be used with the values AssumeLocal, AssumeUniversal or AdjustToUniversal.</value> - </data> - <data name="Argument_ConflictingDateTimeStyles" xml:space="preserve"> - <value>The DateTimeStyles values AssumeLocal and AssumeUniversal cannot be used together.</value> - </data> - <data name="Argument_ConstantDoesntMatch" xml:space="preserve"> - <value>Constant does not match the defined type.</value> - </data> - <data name="Argument_ConstantNotSupported" xml:space="preserve"> - <value>{0} is not a supported constant type.</value> - </data> - <data name="Argument_ConstantNull" xml:space="preserve"> - <value>Null is not a valid constant value for this type.</value> - </data> - <data name="Argument_ConstructorNeedGenericDeclaringType" xml:space="preserve"> - <value>The specified constructor must be declared on a generic type definition.</value> - </data> - <data name="Argument_ConversionOverflow" xml:space="preserve"> - <value>Conversion buffer overflow.</value> - </data> - <data name="Argument_ConvertMismatch" xml:space="preserve"> - <value>The conversion could not be completed because the supplied DateTime did not have the Kind property set correctly. For example, when the Kind property is DateTimeKind.Local, the source time zone must be TimeZoneInfo.Local.</value> - </data> - <data name="Argument_CORDBBadMethod" xml:space="preserve"> - <value>Cannot find the method on the object instance.</value> - </data> - <data name="Argument_CORDBBadVarArgCallConv" xml:space="preserve"> - <value>Cannot evaluate a VarArgs function.</value> - </data> - <data name="Argument_CultureIetfNotSupported" xml:space="preserve"> - <value>Culture IETF Name {0} is not a recognized IETF name.</value> - </data> - <data name="Argument_CultureInvalidFormat" xml:space="preserve"> - <value>Culture '{0}' is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread's current culture.</value> - </data> - <data name="Argument_CultureInvalidIdentifier" xml:space="preserve"> - <value>{0} is an invalid culture identifier.</value> - </data> - <data name="Argument_CultureIsNeutral" xml:space="preserve"> - <value>Culture ID {0} (0x{0:X4}) is a neutral culture; a region cannot be created from it.</value> - </data> - <data name="Argument_CultureNotSupported" xml:space="preserve"> - <value>Culture is not supported.</value> - </data> - <data name="Argument_CustomAssemblyLoadContextRequestedNameMismatch" xml:space="preserve"> - <value>Resolved assembly's simple name should be the same as of the requested assembly.</value> - </data> - <data name="Argument_CustomCultureCannotBePassedByNumber" xml:space="preserve"> - <value>Customized cultures cannot be passed by LCID, only by name.</value> - </data> - <data name="Argument_cvtres_NotFound" xml:space="preserve"> - <value>Cannot find cvtres.exe</value> - </data> - <data name="Argument_DataLengthDifferent" xml:space="preserve"> - <value>Parameters 'members' and 'data' must have the same length.</value> - </data> - <data name="Argument_DateTimeBadBinaryData" xml:space="preserve"> - <value>The binary data must result in a DateTime with ticks between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.</value> - </data> - <data name="Argument_DateTimeHasTicks" xml:space="preserve"> - <value>The supplied DateTime must have the Year, Month, and Day properties set to 1. The time cannot be specified more precisely than whole milliseconds.</value> - </data> - <data name="Argument_DateTimeHasTimeOfDay" xml:space="preserve"> - <value>The supplied DateTime includes a TimeOfDay setting. This is not supported.</value> - </data> - <data name="Argument_DateTimeIsInvalid" xml:space="preserve"> - <value>The supplied DateTime represents an invalid time. For example, when the clock is adjusted forward, any time in the period that is skipped is invalid.</value> - </data> - <data name="Argument_DateTimeIsNotAmbiguous" xml:space="preserve"> - <value>The supplied DateTime is not in an ambiguous time range.</value> - </data> - <data name="Argument_DateTimeKindMustBeUnspecified" xml:space="preserve"> - <value>The supplied DateTime must have the Kind property set to DateTimeKind.Unspecified.</value> - </data> - <data name="Argument_DateTimeKindMustBeUnspecifiedOrUtc" xml:space="preserve"> - <value>The supplied DateTime must have the Kind property set to DateTimeKind.Unspecified or DateTimeKind.Utc.</value> - </data> - <data name="Argument_DateTimeOffsetInvalidDateTimeStyles" xml:space="preserve"> - <value>The DateTimeStyles value 'NoCurrentDateDefault' is not allowed when parsing DateTimeOffset.</value> - </data> - <data name="Argument_DateTimeOffsetIsNotAmbiguous" xml:space="preserve"> - <value>The supplied DateTimeOffset is not in an ambiguous time range.</value> - </data> - <data name="Argument_DestinationTooShort" xml:space="preserve"> - <value>Destination is too short.</value> - </data> - <data name="Argument_DuplicatedFileName" xml:space="preserve"> - <value>Duplicate file names.</value> - </data> - <data name="Argument_DuplicateModuleName" xml:space="preserve"> - <value>Duplicate dynamic module name within an assembly.</value> - </data> - <data name="Argument_DuplicateName" xml:space="preserve"> - <value>Tried to add NamedPermissionSet with non-unique name.</value> - </data> - <data name="Argument_DuplicateResourceName" xml:space="preserve"> - <value>Duplicate resource name within an assembly.</value> - </data> - <data name="Argument_DuplicateTypeName" xml:space="preserve"> - <value>Duplicate type name within an assembly.</value> - </data> - <data name="Argument_EmitWriteLineType" xml:space="preserve"> - <value>EmitWriteLine does not support this field or local type.</value> - </data> - <data name="Argument_EmptyApplicationName" xml:space="preserve"> - <value>ApplicationId cannot have an empty string for the name.</value> - </data> - <data name="Argument_EmptyDecString" xml:space="preserve"> - <value>Decimal separator cannot be the empty string.</value> - </data> - <data name="Argument_EmptyFileName" xml:space="preserve"> - <value>Empty file name is not legal.</value> - </data> - <data name="Argument_EmptyName" xml:space="preserve"> - <value>Empty name is not legal.</value> - </data> - <data name="Argument_EmptyPath" xml:space="preserve"> - <value>Empty path name is not legal.</value> - </data> - <data name="Argument_EmptyStrongName" xml:space="preserve"> - <value>StrongName cannot have an empty string for the assembly name.</value> - </data> - <data name="Argument_EmptyWaithandleArray" xml:space="preserve"> - <value>Waithandle array may not be empty.</value> - </data> - <data name="Argument_EncoderFallbackNotEmpty" xml:space="preserve"> - <value>Must complete Convert() operation or call Encoder.Reset() before calling GetBytes() or GetByteCount(). Encoder '{0}' fallback '{1}'.</value> - </data> - <data name="Argument_EncodingConversionOverflowBytes" xml:space="preserve"> - <value>The output byte buffer is too small to contain the encoded data, encoding '{0}' fallback '{1}'.</value> - </data> - <data name="Argument_EncodingConversionOverflowChars" xml:space="preserve"> - <value>The output char buffer is too small to contain the decoded characters, encoding '{0}' fallback '{1}'.</value> - </data> - <data name="Argument_EncodingNotSupported" xml:space="preserve"> - <value>'{0}' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.</value> - </data> - <data name="Argument_EnumIsNotIntOrShort" xml:space="preserve"> - <value>The underlying type of enum argument must be Int32 or Int16.</value> - </data> - <data name="Argument_EnumTypeDoesNotMatch" xml:space="preserve"> - <value>The argument type, '{0}', is not the same as the enum type '{1}'.</value> - </data> - <data name="Argument_FallbackBufferNotEmpty" xml:space="preserve"> - <value>Cannot change fallback when buffer is not empty. Previous Convert() call left data in the fallback buffer.</value> - </data> - <data name="Argument_FieldDeclaringTypeGeneric" xml:space="preserve"> - <value>Cannot resolve field {0} because the declaring type of the field handle {1} is generic. Explicitly provide the declaring type to GetFieldFromHandle.</value> - </data> - <data name="Argument_FieldNeedGenericDeclaringType" xml:space="preserve"> - <value>The specified field must be declared on a generic type definition.</value> - </data> - <data name="Argument_FlagNotSupported" xml:space="preserve"> - <value>One or more flags are not supported.</value> - </data> - <data name="Argument_FrameworkNameInvalid" xml:space="preserve"> - <value>FrameworkName is invalid.</value> - </data> - <data name="Argument_FrameworkNameMissingVersion" xml:space="preserve"> - <value>FrameworkName version component is missing.</value> - </data> - <data name="Argument_FrameworkNameTooShort" xml:space="preserve"> - <value>FrameworkName cannot have less than two components or more than three components.</value> - </data> - <data name="Argument_GenConstraintViolation" xml:space="preserve"> - <value>GenericArguments[{0}], '{1}', on '{2}' violates the constraint of type '{3}'.</value> - </data> - <data name="Argument_GenericArgsCount" xml:space="preserve"> - <value>The number of generic arguments provided doesn't equal the arity of the generic type definition.</value> - </data> - <data name="Argument_GenericsInvalid" xml:space="preserve"> - <value>Generic types are not valid.</value> - </data> - <data name="Argument_GlobalFunctionHasToBeStatic" xml:space="preserve"> - <value>Global members must be static.</value> - </data> - <data name="Argument_HandleLeak" xml:space="preserve"> - <value>Cannot pass a GCHandle across AppDomains.</value> - </data> - <data name="Argument_HasToBeArrayClass" xml:space="preserve"> - <value>Must be an array type.</value> - </data> - <data name="Argument_IdnBadBidi" xml:space="preserve"> - <value>Left to right characters may not be mixed with right to left characters in IDN labels.</value> - </data> - <data name="Argument_IdnBadLabelSize" xml:space="preserve"> - <value>IDN labels must be between 1 and 63 characters long.</value> - </data> - <data name="Argument_IdnBadNameSize" xml:space="preserve"> - <value>IDN names must be between 1 and {0} characters long.</value> - </data> - <data name="Argument_IdnBadPunycode" xml:space="preserve"> - <value>Invalid IDN encoded string.</value> - </data> - <data name="Argument_IdnBadStd3" xml:space="preserve"> - <value>Label contains character '{0}' not allowed with UseStd3AsciiRules</value> - </data> - <data name="Argument_IdnIllegalName" xml:space="preserve"> - <value>Decoded string is not a valid IDN name.</value> - </data> - <data name="Argument_IllegalAppBase" xml:space="preserve"> - <value>The application base specified is not valid.</value> - </data> - <data name="Argument_IllegalAppId" xml:space="preserve"> - <value>Application identity does not have same number of components as manifest paths.</value> - </data> - <data name="Argument_IllegalAppIdMismatch" xml:space="preserve"> - <value>Application identity does not match identities in manifests.</value> - </data> - <data name="Argument_IllegalEnvVarName" xml:space="preserve"> - <value>Environment variable name cannot contain equal character.</value> - </data> - <data name="Argument_IllegalName" xml:space="preserve"> - <value>Illegal name.</value> - </data> - <data name="Argument_IllegalZone" xml:space="preserve"> - <value>Illegal security permission zone specified.</value> - </data> - <data name="Argument_ImplementIComparable" xml:space="preserve"> - <value>At least one object must implement IComparable.</value> - </data> - <data name="Argument_ImproperType" xml:space="preserve"> - <value>Improper types in collection.</value> - </data> - <data name="Argument_IndexOutOfArrayBounds" xml:space="preserve"> - <value>The specified index is out of bounds of the specified array.</value> - </data> - <data name="Argument_InsufficientSpaceToCopyCollection" xml:space="preserve"> - <value>The specified space is not sufficient to copy the elements from this Collection.</value> - </data> - <data name="Argument_InterfaceMap" xml:space="preserve"> - <value>'this' type cannot be an interface itself.</value> - </data> - <data name="Argument_InvalidAnyFlag" xml:space="preserve"> - <value>No flags can be set.</value> - </data> - <data name="Argument_InvalidAppendMode" xml:space="preserve"> - <value>Append access can be requested only in write-only mode.</value> - </data> - <data name="Argument_InvalidAppId" xml:space="preserve"> - <value>Invalid identity: no deployment or application identity specified.</value> - </data> - <data name="Argument_InvalidArgumentForComparison" xml:space="preserve"> - <value>Type of argument is not compatible with the generic comparer.</value> - </data> - <data name="Argument_InvalidArrayLength" xml:space="preserve"> - <value>Length of the array must be {0}.</value> - </data> - <data name="Argument_InvalidArrayType" xml:space="preserve"> - <value>Target array type is not compatible with the type of items in the collection.</value> - </data> - <data name="Argument_InvalidAssemblyName" xml:space="preserve"> - <value>Assembly names may not begin with whitespace or contain the characters '/', or '\\' or ':'.</value> - </data> - <data name="Argument_InvalidCalendar" xml:space="preserve"> - <value>Not a valid calendar for the given culture.</value> - </data> - <data name="Argument_InvalidCharSequence" xml:space="preserve"> - <value>Invalid Unicode code point found at index {0}.</value> - </data> - <data name="Argument_InvalidCharSequenceNoIndex" xml:space="preserve"> - <value>String contains invalid Unicode code points.</value> - </data> - <data name="Argument_InvalidCodePageBytesIndex" xml:space="preserve"> - <value>Unable to translate bytes {0} at index {1} from specified code page to Unicode.</value> - </data> - <data name="Argument_InvalidCodePageConversionIndex" xml:space="preserve"> - <value>Unable to translate Unicode character \\u{0:X4} at index {1} to specified code page.</value> - </data> - <data name="Argument_InvalidConstructorDeclaringType" xml:space="preserve"> - <value>The specified constructor must be declared on the generic type definition of the specified type.</value> - </data> - <data name="Argument_InvalidConstructorInfo" xml:space="preserve"> - <value>The ConstructorInfo object is not valid.</value> - </data> - <data name="Argument_InvalidCultureName" xml:space="preserve"> - <value>Culture name '{0}' is not supported.</value> - </data> - <data name="Argument_InvalidDateTimeKind" xml:space="preserve"> - <value>Invalid DateTimeKind value.</value> - </data> - <data name="Argument_InvalidDateTimeStyles" xml:space="preserve"> - <value>An undefined DateTimeStyles value is being used.</value> - </data> - <data name="Argument_InvalidDigitSubstitution" xml:space="preserve"> - <value>The DigitSubstitution property must be of a valid member of the DigitShapes enumeration. Valid entries include Context, NativeNational or None.</value> - </data> - <data name="Argument_InvalidDirectory" xml:space="preserve"> - <value>Invalid directory, '{0}'.</value> - </data> - <data name="Argument_InvalidDirectoryOnUrl" xml:space="preserve"> - <value>Invalid directory on URL.</value> - </data> - <data name="Argument_InvalidElementName" xml:space="preserve"> - <value>Invalid element name '{0}'.</value> - </data> - <data name="Argument_InvalidElementTag" xml:space="preserve"> - <value>Invalid element tag '{0}'.</value> - </data> - <data name="Argument_InvalidElementText" xml:space="preserve"> - <value>Invalid element text '{0}'.</value> - </data> - <data name="Argument_InvalidElementValue" xml:space="preserve"> - <value>Invalid element value '{0}'.</value> - </data> - <data name="Argument_InvalidEnum" xml:space="preserve"> - <value>The Enum type should contain one and only one instance field.</value> - </data> - <data name="Argument_InvalidEnumValue" xml:space="preserve"> - <value>The value '{0}' is not valid for this usage of the type {1}.</value> - </data> - <data name="Argument_InvalidFieldDeclaringType" xml:space="preserve"> - <value>The specified field must be declared on the generic type definition of the specified type.</value> - </data> - <data name="Argument_InvalidFieldInfo" xml:space="preserve"> - <value>The FieldInfo object is not valid.</value> - </data> - <data name="Argument_InvalidFileModeAndAccessCombo" xml:space="preserve"> - <value>Combining FileMode: {0} with FileAccess: {1} is invalid.</value> - </data> - <data name="Argument_InvalidFileModeAndRightsCombo" xml:space="preserve"> - <value>Combining FileMode: {0} with FileSystemRights: {1} is invalid.</value> - </data> - <data name="Argument_InvalidFileModeTruncateAndRightsCombo" xml:space="preserve"> - <value>Combining FileMode: {0} with FileSystemRights: {1} is invalid. FileMode.Truncate is valid only when used with FileSystemRights.Write.</value> - </data> - <data name="Argument_InvalidFlag" xml:space="preserve"> - <value>Value of flags is invalid.</value> - </data> - <data name="Argument_InvalidGenericArg" xml:space="preserve"> - <value>The generic type parameter was not valid</value> - </data> - <data name="Argument_InvalidGenericInstantiation" xml:space="preserve"> - <value>The given generic instantiation was invalid.</value> - </data> - <data name="Argument_InvalidGenericInstArray" xml:space="preserve"> - <value>Generic arguments must be provided for each generic parameter and each generic argument must be a RuntimeType.</value> - </data> - <data name="Argument_InvalidGroupSize" xml:space="preserve"> - <value>Every element in the value array should be between one and nine, except for the last element, which can be zero.</value> - </data> - <data name="Argument_InvalidHandle" xml:space="preserve"> - <value>The handle is invalid.</value> - </data> - <data name="Argument_InvalidHexFormat" xml:space="preserve"> - <value>Improperly formatted hex string.</value> - </data> - <data name="Argument_InvalidHighSurrogate" xml:space="preserve"> - <value>Found a high surrogate char without a following low surrogate at index: {0}. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters.</value> - </data> - <data name="Argument_InvalidId" xml:space="preserve"> - <value>The specified ID parameter '{0}' is not supported.</value> - </data> - <data name="Argument_InvalidKey" xml:space="preserve"> - <value>Key was invalid.</value> - </data> - <data name="Argument_InvalidKeyStore" xml:space="preserve"> - <value>'{0}' is not a valid KeyStore name.</value> - </data> - <data name="Argument_InvalidKindOfTypeForCA" xml:space="preserve"> - <value>This type cannot be represented as a custom attribute.</value> - </data> - <data name="Argument_InvalidLabel" xml:space="preserve"> - <value>Invalid Label.</value> - </data> - <data name="Argument_InvalidLowSurrogate" xml:space="preserve"> - <value>Found a low surrogate char without a preceding high surrogate at index: {0}. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters.</value> - </data> - <data name="Argument_InvalidMarshalByRefObject" xml:space="preserve"> - <value>The MarshalByRefObject is not valid.</value> - </data> - <data name="Argument_InvalidMemberForNamedArgument" xml:space="preserve"> - <value>The member must be either a field or a property.</value> - </data> - <data name="Argument_InvalidMethodDeclaringType" xml:space="preserve"> - <value>The specified method must be declared on the generic type definition of the specified type.</value> - </data> - <data name="Argument_InvalidName" xml:space="preserve"> - <value>Invalid name.</value> - </data> - <data name="Argument_InvalidNativeDigitCount" xml:space="preserve"> - <value>The NativeDigits array must contain exactly ten members.</value> - </data> - <data name="Argument_InvalidNativeDigitValue" xml:space="preserve"> - <value>Each member of the NativeDigits array must be a single text element (one or more UTF16 code points) with a Unicode Nd (Number, Decimal Digit) property indicating it is a digit.</value> - </data> - <data name="Argument_InvalidNeutralRegionName" xml:space="preserve"> - <value>The region name {0} should not correspond to neutral culture; a specific culture name is required.</value> - </data> - <data name="Argument_InvalidNormalizationForm" xml:space="preserve"> - <value>Invalid or unsupported normalization form.</value> - </data> - <data name="Argument_InvalidNumberOfMembers" xml:space="preserve"> - <value>MemberData contains an invalid number of members.</value> - </data> - <data name="Argument_InvalidNumberStyles" xml:space="preserve"> - <value>An undefined NumberStyles value is being used.</value> - </data> - <data name="Argument_InvalidOffLen" xml:space="preserve"> - <value>Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.</value> - </data> - <data name="Argument_InvalidOpCodeOnDynamicMethod" xml:space="preserve"> - <value>Ldtoken, Ldftn and Ldvirtftn OpCodes cannot target DynamicMethods.</value> - </data> - <data name="Argument_InvalidParameterInfo" xml:space="preserve"> - <value>The ParameterInfo object is not valid.</value> - </data> - <data name="Argument_InvalidParamInfo" xml:space="preserve"> - <value>Invalid type for ParameterInfo member in Attribute class.</value> - </data> - <data name="Argument_InvalidPathChars" xml:space="preserve"> - <value>Illegal characters in path.</value> - </data> - <data name="Argument_InvalidPermissionState" xml:space="preserve"> - <value>Invalid permission state.</value> - </data> - <data name="Argument_InvalidREG_TZI_FORMAT" xml:space="preserve"> - <value>The REG_TZI_FORMAT structure is corrupt.</value> - </data> - <data name="Argument_InvalidRegionName" xml:space="preserve"> - <value>Region name '{0}' is not supported.</value> - </data> - <data name="Argument_InvalidRegistryKeyPermissionCheck" xml:space="preserve"> - <value>The specified RegistryKeyPermissionCheck value is invalid.</value> - </data> - <data name="Argument_InvalidRegistryOptionsCheck" xml:space="preserve"> - <value>The specified RegistryOptions value is invalid.</value> - </data> - <data name="Argument_InvalidRegistryViewCheck" xml:space="preserve"> - <value>The specified RegistryView value is invalid.</value> - </data> - <data name="Argument_InvalidResourceCultureName" xml:space="preserve"> - <value>The given culture name '{0}' cannot be used to locate a resource file. Resource filenames must consist of only letters, numbers, hyphens or underscores.</value> - </data> - <data name="Argument_InvalidSafeBufferOffLen" xml:space="preserve"> - <value>Offset and length were greater than the size of the SafeBuffer.</value> - </data> - <data name="Argument_InvalidSafeHandle" xml:space="preserve"> - <value>The SafeHandle is invalid.</value> - </data> - <data name="Argument_InvalidSeekOrigin" xml:space="preserve"> - <value>Invalid seek origin.</value> - </data> - <data name="Argument_InvalidSerializedString" xml:space="preserve"> - <value>The specified serialized string '{0}' is not supported.</value> - </data> - <data name="Argument_InvalidSite" xml:space="preserve"> - <value>Invalid site.</value> - </data> - <data name="Argument_InvalidSubPath" xml:space="preserve"> - <value>The directory specified, '{0}', is not a subdirectory of '{1}'.</value> - </data> - <data name="Argument_InvalidTimeSpanStyles" xml:space="preserve"> - <value>An undefined TimeSpanStyles value is being used.</value> - </data> - <data name="Argument_InvalidToken" xml:space="preserve"> - <value>Token {0:x} is not valid in the scope of module {1}.</value> - </data> - <data name="Argument_InvalidType" xml:space="preserve"> - <value>The type of arguments passed into generic comparer methods is invalid.</value> - </data> - <data name="Argument_InvalidTypeForCA" xml:space="preserve"> - <value>Cannot build type parameter for custom attribute with a type that does not support the AssemblyQualifiedName property. The type instance supplied was of type '{0}'.</value> - </data> - <data name="Argument_InvalidTypeForDynamicMethod" xml:space="preserve"> - <value>Invalid type owner for DynamicMethod.</value> - </data> - <data name="Argument_InvalidTypeName" xml:space="preserve"> - <value>The name of the type is invalid.</value> - </data> - <data name="Argument_InvalidTypeToken" xml:space="preserve"> - <value>Token {0:x} is not a valid Type token.</value> - </data> - <data name="Argument_InvalidTypeWithPointersNotSupported" xml:space="preserve"> - <value>Cannot use type '{0}'. Only value types without pointers or references are supported.</value> - </data> - <data name="Argument_InvalidUnity" xml:space="preserve"> - <value>Invalid Unity type.</value> - </data> - <data name="Argument_InvalidUrl" xml:space="preserve"> - <value>Invalid URL.</value> - </data> - <data name="Argument_InvalidValue" xml:space="preserve"> - <value>Value was invalid.</value> - </data> - <data name="Argument_InvalidXML" xml:space="preserve"> - <value>Invalid Xml.</value> - </data> - <data name="Argument_InvalidXMLBadVersion" xml:space="preserve"> - <value>Invalid Xml - can only parse elements of version one.</value> - </data> - <data name="Argument_InvalidXMLElement" xml:space="preserve"> - <value>Invalid XML. Missing required tag <{0}> for type '{1}'.</value> - </data> - <data name="Argument_InvalidXMLMissingAttr" xml:space="preserve"> - <value>Invalid XML. Missing required attribute '{0}'.</value> - </data> - <data name="Argument_ItemNotExist" xml:space="preserve"> - <value>The specified item does not exist in this KeyedCollection.</value> - </data> - <data name="Argument_LargeInteger" xml:space="preserve"> - <value>Integer or token was too large to be encoded.</value> - </data> - <data name="Argument_LongEnvVarName" xml:space="preserve"> - <value>Environment variable name cannot contain 1024 or more characters.</value> - </data> - <data name="Argument_LongEnvVarValue" xml:space="preserve"> - <value>Environment variable name or value is too long.</value> - </data> - <data name="Argument_ManifestFileDoesNotExist" xml:space="preserve"> - <value>The specified manifest file does not exist.</value> - </data> - <data name="Argument_MemberAndArray" xml:space="preserve"> - <value>Cannot supply both a MemberInfo and an Array to indicate the parent of a value type.</value> - </data> - <data name="Argument_MethodDeclaringTypeGeneric" xml:space="preserve"> - <value>Cannot resolve method {0} because the declaring type of the method handle {1} is generic. Explicitly provide the declaring type to GetMethodFromHandle.</value> - </data> - <data name="Argument_MethodDeclaringTypeGenericLcg" xml:space="preserve"> - <value>Method '{0}' has a generic declaring type '{1}'. Explicitly provide the declaring type to GetTokenFor.</value> - </data> - <data name="Argument_MethodNeedGenericDeclaringType" xml:space="preserve"> - <value>The specified method cannot be dynamic or global and must be declared on a generic type definition.</value> - </data> - <data name="Argument_MethodRedefined" xml:space="preserve"> - <value>Method has been already defined.</value> - </data> - <data name="Argument_MinMaxValue" xml:space="preserve"> - <value>'{0}' cannot be greater than {1}.</value> - </data> - <data name="Argument_MismatchedArrays" xml:space="preserve"> - <value>Two arrays, {0} and {1}, must be of the same size.</value> - </data> - <data name="Argument_MissingDefaultConstructor" xml:space="preserve"> - <value>was missing default constructor.</value> - </data> - <data name="Argument_ModuleAlreadyLoaded" xml:space="preserve"> - <value>The specified module has already been loaded.</value> - </data> - <data name="Argument_MustBeFalse" xml:space="preserve"> - <value>Argument must be initialized to false</value> - </data> - <data name="Argument_MustBeInterfaceMethod" xml:space="preserve"> - <value>The MemberInfo must be an interface method.</value> - </data> - <data name="Argument_MustBeRuntimeAssembly" xml:space="preserve"> - <value>Assembly must be a runtime Assembly object.</value> - </data> - <data name="Argument_MustBeRuntimeFieldInfo" xml:space="preserve"> - <value>FieldInfo must be a runtime FieldInfo object.</value> - </data> - <data name="Argument_MustBeRuntimeMethodInfo" xml:space="preserve"> - <value>MethodInfo must be a runtime MethodInfo object.</value> - </data> - <data name="Argument_MustBeRuntimeModule" xml:space="preserve"> - <value>Module must be a runtime Module object.</value> - </data> - <data name="Argument_MustBeRuntimeParameterInfo" xml:space="preserve"> - <value>ParameterInfo must be a runtime ParameterInfo object.</value> - </data> - <data name="Argument_MustBeRuntimeReflectionObject" xml:space="preserve"> - <value>The object must be a runtime Reflection object.</value> - </data> - <data name="Argument_MustBeRuntimeType" xml:space="preserve"> - <value>Type must be a runtime Type object.</value> - </data> - <data name="Argument_MustBeString" xml:space="preserve"> - <value>String is too long or has invalid contents.</value> - </data> - <data name="Argument_MustBeTypeBuilder" xml:space="preserve"> - <value>'type' must contain a TypeBuilder as a generic argument.</value> - </data> - <data name="Argument_MustHaveAttributeBaseClass" xml:space="preserve"> - <value>Type passed in must be derived from System.Attribute or System.Attribute itself.</value> - </data> - <data name="Argument_MustHaveLayoutOrBeBlittable" xml:space="preserve"> - <value>The specified structure must be blittable or have layout information.</value> - </data> - <data name="Argument_MustSupplyContainer" xml:space="preserve"> - <value>When supplying a FieldInfo for fixing up a nested type, a valid ID for that containing object must also be supplied.</value> - </data> - <data name="Argument_MustSupplyParent" xml:space="preserve"> - <value>When supplying the ID of a containing object, the FieldInfo that identifies the current field within that object must also be supplied.</value> - </data> - <data name="Argument_NameContainsInvalidCharacters" xml:space="preserve"> - <value>The name '{0}' contains characters that are not valid for a Culture or Region.</value> - </data> - <data name="Argument_NameTooLong" xml:space="preserve"> - <value>The name '{0}' is too long to be a Culture or Region name, which is limited to {1} characters.</value> - </data> - <data name="Argument_NativeOverlappedAlreadyFree" xml:space="preserve"> - <value>'overlapped' has already been freed.</value> - </data> - <data name="Argument_NativeOverlappedWrongBoundHandle" xml:space="preserve"> - <value>'overlapped' was not allocated by this ThreadPoolBoundHandle instance.</value> - </data> - <data name="Argument_NativeResourceAlreadyDefined" xml:space="preserve"> - <value>Native resource has already been defined.</value> - </data> - <data name="Argument_NeedGenericMethodDefinition" xml:space="preserve"> - <value>Method must represent a generic method definition on a generic type definition.</value> - </data> - <data name="Argument_NeedNonGenericObject" xml:space="preserve"> - <value>The specified object must not be an instance of a generic type.</value> - </data> - <data name="Argument_NeedNonGenericType" xml:space="preserve"> - <value>The specified Type must not be a generic type definition.</value> - </data> - <data name="Argument_NeedStructWithNoRefs" xml:space="preserve"> - <value>The specified Type must be a struct containing no references.</value> - </data> - <data name="Argument_NeverValidGenericArgument" xml:space="preserve"> - <value>The type '{0}' may not be used as a type argument.</value> - </data> - <data name="Argument_NoClass" xml:space="preserve"> - <value>Element does not specify a class.</value> - </data> - <data name="Argument_NoDomainManager" xml:space="preserve"> - <value>The domain manager specified by the host could not be instantiated.</value> - </data> - <data name="Argument_NoEra" xml:space="preserve"> - <value>No Era was supplied.</value> - </data> - <data name="Argument_NoMain" xml:space="preserve"> - <value>Main entry point not defined.</value> - </data> - <data name="Argument_NoModuleFileExtension" xml:space="preserve"> - <value>Module file name '{0}' must have file extension.</value> - </data> - <data name="Argument_NoNestedMarshal" xml:space="preserve"> - <value>Only LPArray or SafeArray has nested unmanaged marshal.</value> - </data> - <data name="Argument_NonNullObjAndCtx" xml:space="preserve"> - <value>Either obj or ctx must be null.</value> - </data> - <data name="Argument_NoRegionInvariantCulture" xml:space="preserve"> - <value>There is no region associated with the Invariant Culture (Culture ID: 0x7F).</value> - </data> - <data name="Argument_NoSpecificCulture" xml:space="preserve"> - <value>Please select a specific culture, such as zh-CN, zh-HK, zh-TW, zh-MO, zh-SG.</value> - </data> - <data name="Argument_NotACodeGroupType" xml:space="preserve"> - <value>The type does not inherit from CodeGroup</value> - </data> - <data name="Argument_NotACustomMarshaler" xml:space="preserve"> - <value>Not a custom marshal.</value> - </data> - <data name="Argument_NotAMembershipCondition" xml:space="preserve"> - <value>The type does not implement IMembershipCondition</value> - </data> - <data name="Argument_NotAPermissionElement" xml:space="preserve"> - <value>'elem' was not a permission element.</value> - </data> - <data name="Argument_NotAPermissionType" xml:space="preserve"> - <value>The type does not implement IPermission</value> - </data> - <data name="Argument_NotASimpleNativeType" xml:space="preserve"> - <value>The UnmanagedType passed to DefineUnmanagedMarshal is not a simple type. None of the following values may be used: UnmanagedType.ByValTStr, UnmanagedType.SafeArray, UnmanagedType.ByValArray, UnmanagedType.LPArray, UnmanagedType.CustomMarshaler.</value> - </data> - <data name="Argument_NotATP" xml:space="preserve"> - <value>Type must be a TransparentProxy</value> - </data> - <data name="Argument_NotAWritableProperty" xml:space="preserve"> - <value>Not a writable property.</value> - </data> - <data name="Argument_NotEnoughBytesToRead" xml:space="preserve"> - <value>There are not enough bytes remaining in the accessor to read at this position.</value> - </data> - <data name="Argument_NotEnoughBytesToWrite" xml:space="preserve"> - <value>There are not enough bytes remaining in the accessor to write at this position.</value> - </data> - <data name="Argument_NotEnoughGenArguments" xml:space="preserve"> - <value>The type or method has {1} generic parameter(s), but {0} generic argument(s) were provided. A generic argument must be provided for each generic parameter.</value> - </data> - <data name="Argument_NotExceptionType" xml:space="preserve"> - <value>Does not extend Exception.</value> - </data> - <data name="Argument_NotInExceptionBlock" xml:space="preserve"> - <value>Not currently in an exception block.</value> - </data> - <data name="Argument_NotInTheSameModuleBuilder" xml:space="preserve"> - <value>The argument passed in was not from the same ModuleBuilder.</value> - </data> - <data name="Argument_NotMethodCallOpcode" xml:space="preserve"> - <value>The specified opcode cannot be passed to EmitCall.</value> - </data> - <data name="Argument_NotSerializable" xml:space="preserve"> - <value>Argument passed in is not serializable.</value> - </data> - <data name="Argument_NotSimpleFileName" xml:space="preserve"> - <value>The filename must not include a path specification.</value> - </data> - <data name="Argument_NoUnderlyingCCW" xml:space="preserve"> - <value>The object has no underlying COM data associated with it.</value> - </data> - <data name="Argument_NoUninitializedStrings" xml:space="preserve"> - <value>Uninitialized Strings cannot be created.</value> - </data> - <data name="Argument_NoUnmanagedElementCount" xml:space="preserve"> - <value>Unmanaged marshal does not have ElementCount.</value> - </data> - <data name="Argument_NPMSInvalidName" xml:space="preserve"> - <value>Name can be neither null nor empty.</value> - </data> - <data name="Argument_NullFullTrustAssembly" xml:space="preserve"> - <value>A null StrongName was found in the full trust assembly list.</value> - </data> - <data name="Argument_ObjIsWinRTObject" xml:space="preserve"> - <value>The object's type must not be a Windows Runtime type.</value> - </data> - <data name="Argument_ObjNotComObject" xml:space="preserve"> - <value>The object's type must be __ComObject or derived from __ComObject.</value> - </data> - <data name="Argument_OffsetAndCapacityOutOfBounds" xml:space="preserve"> - <value>Offset and capacity were greater than the size of the view.</value> - </data> - <data name="Argument_OffsetAndLengthOutOfBounds" xml:space="preserve"> - <value>Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection.</value> - </data> - <data name="Argument_OffsetLocalMismatch" xml:space="preserve"> - <value>The UTC Offset of the local dateTime parameter does not match the offset argument.</value> - </data> - <data name="Argument_OffsetOfFieldNotFound" xml:space="preserve"> - <value>Field passed in is not a marshaled member of the type '{0}'.</value> - </data> - <data name="Argument_OffsetOutOfRange" xml:space="preserve"> - <value>Offset must be within plus or minus 14 hours.</value> - </data> - <data name="Argument_OffsetPrecision" xml:space="preserve"> - <value>Offset must be specified in whole minutes.</value> - </data> - <data name="Argument_OffsetUtcMismatch" xml:space="preserve"> - <value>The UTC Offset for Utc DateTime instances must be 0.</value> - </data> - <data name="Argument_OneOfCulturesNotSupported" xml:space="preserve"> - <value>Culture name {0} or {1} is not supported.</value> - </data> - <data name="Argument_OnlyMscorlib" xml:space="preserve"> - <value>Only mscorlib's assembly is valid.</value> - </data> - <data name="Argument_OutOfOrderDateTimes" xml:space="preserve"> - <value>The DateStart property must come before the DateEnd property.</value> - </data> - <data name="Argument_PathEmpty" xml:space="preserve"> - <value>Path cannot be the empty string or all whitespace.</value> - </data> - <data name="Argument_PathFormatNotSupported" xml:space="preserve"> - <value>The given path's format is not supported.</value> - </data> - <data name="Argument_PathUriFormatNotSupported" xml:space="preserve"> - <value>URI formats are not supported.</value> - </data> - <data name="Argument_PolicyFileDoesNotExist" xml:space="preserve"> - <value>The requested policy file does not exist.</value> - </data> - <data name="Argument_PreAllocatedAlreadyAllocated" xml:space="preserve"> - <value>'preAllocated' is already in use.</value> - </data> - <data name="Argument_RecursiveFallback" xml:space="preserve"> - <value>Recursive fallback not allowed for character \\u{0:X4}.</value> - </data> - <data name="Argument_RecursiveFallbackBytes" xml:space="preserve"> - <value>Recursive fallback not allowed for bytes {0}.</value> - </data> - <data name="Argument_RedefinedLabel" xml:space="preserve"> - <value>Label multiply defined.</value> - </data> - <data name="Argument_RelativeUrlMembershipCondition" xml:space="preserve"> - <value>UrlMembershipCondition requires an absolute URL.</value> - </data> - <data name="Argument_ResolveField" xml:space="preserve"> - <value>Token {0:x} is not a valid FieldInfo token in the scope of module {1}.</value> - </data> - <data name="Argument_ResolveFieldHandle" xml:space="preserve"> - <value>Type handle '{0}' and field handle with declaring type '{1}' are incompatible. Get RuntimeFieldHandle and declaring RuntimeTypeHandle off the same FieldInfo.</value> - </data> - <data name="Argument_ResolveMember" xml:space="preserve"> - <value>Token {0:x} is not a valid MemberInfo token in the scope of module {1}.</value> - </data> - <data name="Argument_ResolveMethod" xml:space="preserve"> - <value>Token {0:x} is not a valid MethodBase token in the scope of module {1}.</value> - </data> - <data name="Argument_ResolveMethodHandle" xml:space="preserve"> - <value>Type handle '{0}' and method handle with declaring type '{1}' are incompatible. Get RuntimeMethodHandle and declaring RuntimeTypeHandle off the same MethodBase.</value> - </data> - <data name="Argument_ResolveModuleType" xml:space="preserve"> - <value>Token {0} resolves to the special module type representing this module.</value> - </data> - <data name="Argument_ResolveString" xml:space="preserve"> - <value>Token {0:x} is not a valid string token in the scope of module {1}.</value> - </data> - <data name="Argument_ResolveType" xml:space="preserve"> - <value>Token {0:x} is not a valid Type token in the scope of module {1}.</value> - </data> - <data name="Argument_ResourceScopeWrongDirection" xml:space="preserve"> - <value>Resource type in the ResourceScope enum is going from a more restrictive resource type to a more general one. From: "{0}" To: "{1}"</value> - </data> - <data name="Argument_ResultCalendarRange" xml:space="preserve"> - <value>The result is out of the supported range for this calendar. The result should be between {0} (Gregorian date) and {1} (Gregorian date), inclusive.</value> - </data> - <data name="Argument_ResultIslamicCalendarRange" xml:space="preserve"> - <value>The date is out of the supported range for the Islamic calendar. The date should be greater than July 18th, 622 AD (Gregorian date).</value> - </data> - <data name="Argument_SeekOverflow" xml:space="preserve"> - <value>The specified seek offset '{0}' would result in a negative Stream position.</value> - </data> - <data name="Argument_SemaphoreInitialMaximum" xml:space="preserve"> - <value>The initial count for the semaphore must be greater than or equal to zero and less than the maximum count.</value> - </data> - <data name="Argument_ShouldNotSpecifyExceptionType" xml:space="preserve"> - <value>Should not specify exception type for catch clause for filter block.</value> - </data> - <data name="Argument_ShouldOnlySetVisibilityFlags" xml:space="preserve"> - <value>Should only set visibility flags when creating EnumBuilder.</value> - </data> - <data name="Argument_SigIsFinalized" xml:space="preserve"> - <value>Completed signature cannot be modified.</value> - </data> - <data name="Argument_StreamNotReadable" xml:space="preserve"> - <value>Stream was not readable.</value> - </data> - <data name="Argument_StreamNotWritable" xml:space="preserve"> - <value>Stream was not writable.</value> - </data> - <data name="Argument_StringFirstCharIsZero" xml:space="preserve"> - <value>The first char in the string is the null character.</value> - </data> - <data name="Argument_StringZeroLength" xml:space="preserve"> - <value>String cannot be of zero length.</value> - </data> - <data name="Argument_StructMustNotBeValueClass" xml:space="preserve"> - <value>The structure must not be a value class.</value> - </data> - <data name="Argument_TimeSpanHasSeconds" xml:space="preserve"> - <value>The TimeSpan parameter cannot be specified more precisely than whole minutes.</value> - </data> - <data name="Argument_TimeZoneInfoBadTZif" xml:space="preserve"> - <value>The tzfile does not begin with the magic characters 'TZif'. Please verify that the file is not corrupt.</value> - </data> - <data name="Argument_TimeZoneInfoInvalidTZif" xml:space="preserve"> - <value>The TZif data structure is corrupt.</value> - </data> - <data name="Argument_ToExclusiveLessThanFromExclusive" xml:space="preserve"> - <value>fromInclusive must be less than or equal to toExclusive.</value> - </data> - <data name="Argument_TooManyFinallyClause" xml:space="preserve"> - <value>Exception blocks may have at most one finally clause.</value> - </data> - <data name="Argument_TransitionTimesAreIdentical" xml:space="preserve"> - <value>The DaylightTransitionStart property must not equal the DaylightTransitionEnd property.</value> - </data> - <data name="Argument_TypeDoesNotContainMethod" xml:space="preserve"> - <value>Type does not contain the given method.</value> - </data> - <data name="Argument_TypedReferenceInvalidField" xml:space="preserve"> - <value>Field in TypedReferences cannot be static or init only.</value> - </data> - <data name="Argument_TypeIsWinRTType" xml:space="preserve"> - <value>The type must not be a Windows Runtime type.</value> - </data> - <data name="Argument_TypeMustBeComCreatable" xml:space="preserve"> - <value>The type must be creatable from COM.</value> - </data> - <data name="Argument_TypeMustBeVisibleFromCom" xml:space="preserve"> - <value>The specified type must be visible from COM.</value> - </data> - <data name="Argument_TypeMustNotBeComImport" xml:space="preserve"> - <value>The type must not be imported from COM.</value> - </data> - <data name="Argument_TypeNameTooLong" xml:space="preserve"> - <value>Type name was too long. The fully qualified type name must be less than 1,024 characters.</value> - </data> - <data name="Argument_TypeNotActivatableViaWindowsRuntime" xml:space="preserve"> - <value>Type '{0}' does not have an activation factory because it is not activatable by Windows Runtime.</value> - </data> - <data name="Argument_TypeNotComObject" xml:space="preserve"> - <value>The type must be __ComObject or be derived from __ComObject.</value> - </data> - <data name="Argument_TypeNotValid" xml:space="preserve"> - <value>The Type object is not valid.</value> - </data> - <data name="Argument_UnableToGeneratePermissionSet" xml:space="preserve"> - <value>Unable to generate permission set; input XML may be malformed.</value> - </data> - <data name="Argument_UnableToParseManifest" xml:space="preserve"> - <value>Unexpected error while parsing the specified manifest.</value> - </data> - <data name="Argument_UnclosedExceptionBlock" xml:space="preserve"> - <value>The IL Generator cannot be used while there are unclosed exceptions.</value> - - </data> - <data name="Argument_UnequalMembers" xml:space="preserve"> - <value>Supplied MemberInfo does not match the expected type.</value> - </data> - <data name="Argument_Unexpected_TypeSource" xml:space="preserve"> - <value>Unexpected TypeKind when marshaling Windows.Foundation.TypeName.</value> - </data> - <data name="Argument_UnknownUnmanagedCallConv" xml:space="preserve"> - <value>Unknown unmanaged calling convention for function signature.</value> - </data> - <data name="Argument_UnmanagedMemAccessorWrapAround" xml:space="preserve"> - <value>The UnmanagedMemoryAccessor capacity and offset would wrap around the high end of the address space.</value> - </data> - <data name="Argument_UnmatchedMethodForLocal" xml:space="preserve"> - <value>Local passed in does not belong to this ILGenerator.</value> - </data> - <data name="Argument_UnmatchingSymScope" xml:space="preserve"> - <value>Non-matching symbol scope.</value> - </data> - <data name="Argument_UnrecognizedLoaderOptimization" xml:space="preserve"> - <value>Unrecognized LOADER_OPTIMIZATION property value. Supported values may include "SingleDomain", "MultiDomain", "MultiDomainHost", and "NotSpecified".</value> - </data> - <data name="Argument_UnrestrictedIdentityPermission" xml:space="preserve"> - <value>Identity permissions cannot be unrestricted.</value> - </data> - <data name="Argument_UTCOutOfRange" xml:space="preserve"> - <value>The UTC time represented when the offset is applied must be between year 0 and 10,000.</value> - </data> - <data name="Argument_VerStringTooLong" xml:space="preserve"> - <value>The unmanaged Version information is too large to persist.</value> - </data> - <data name="Argument_WaitHandleNameTooLong" xml:space="preserve"> - <value>The name can be no more than {0} characters in length.</value> - </data> - <data name="Argument_WinRTSystemRuntimeType" xml:space="preserve"> - <value>Cannot marshal type '{0}' to Windows Runtime. Only 'System.RuntimeType' is supported.</value> - </data> - <data name="Argument_WrongElementType" xml:space="preserve"> - <value>'{0}' element required.</value> - </data> - <data name="Argument_WrongType" xml:space="preserve"> - <value>Operation on type '{0}' attempted with target of incorrect type.</value> - </data> - <data name="ArgumentException_BadMethodImplBody" xml:space="preserve"> - <value>MethodOverride's body must be from this type.</value> - </data> - <data name="ArgumentException_BufferNotFromPool" xml:space="preserve"> - <value>The buffer is not associated with this pool and may not be returned to it.</value> - </data> - <data name="ArgumentException_InvalidAceBinaryForm" xml:space="preserve"> - <value>The binary form of an ACE object is invalid.</value> - </data> - <data name="ArgumentException_InvalidAclBinaryForm" xml:space="preserve"> - <value>The binary form of an ACL object is invalid.</value> - </data> - <data name="ArgumentException_InvalidSDSddlForm" xml:space="preserve"> - <value>The SDDL form of a security descriptor object is invalid.</value> - </data> - <data name="ArgumentException_MinSortingVersion" xml:space="preserve"> - <value>The runtime does not support a version of "{0}" less than {1}.</value> - </data> - <data name="ArgumentException_NotAllCustomSortingFuncsDefined" xml:space="preserve"> - <value>Implementations of all the NLS functions must be provided.</value> - </data> - <data name="ArgumentException_OtherNotArrayOfCorrectLength" xml:space="preserve"> - <value>Object is not a array with the same number of elements as the array to compare it to.</value> - </data> - <data name="ArgumentException_TupleIncorrectType" xml:space="preserve"> - <value>Argument must be of type {0}.</value> - </data> - <data name="ArgumentException_TupleLastArgumentNotATuple" xml:space="preserve"> - <value>The last element of an eight element tuple must be a Tuple.</value> - </data> - <data name="ArgumentException_TupleNonIComparableElement" xml:space="preserve"> - <value>The tuple contains an element of type {0} which does not implement the IComparable interface.</value> - </data> - <data name="ArgumentException_ValueTupleIncorrectType" xml:space="preserve"> - <value>Argument must be of type {0}.</value> - </data> - <data name="ArgumentException_ValueTupleLastArgumentNotAValueTuple" xml:space="preserve"> - <value>The last element of an eight element ValueTuple must be a ValueTuple.</value> - </data> - <data name="ArgumentNull_ApplicationTrust" xml:space="preserve"> - <value>The application trust cannot be null.</value> - </data> - <data name="ArgumentNull_Array" xml:space="preserve"> - <value>Array cannot be null.</value> - </data> - <data name="ArgumentNull_ArrayElement" xml:space="preserve"> - <value>At least one element in the specified array was null.</value> - </data> - <data name="ArgumentNull_ArrayValue" xml:space="preserve"> - <value>Found a null value within an array.</value> - </data> - <data name="ArgumentNull_Assembly" xml:space="preserve"> - <value>Assembly cannot be null.</value> - </data> - <data name="ArgumentNull_AssemblyName" xml:space="preserve"> - <value>AssemblyName cannot be null.</value> - </data> - <data name="ArgumentNull_AssemblyNameName" xml:space="preserve"> - <value>AssemblyName.Name cannot be null or an empty string.</value> - </data> - <data name="ArgumentNull_Buffer" xml:space="preserve"> - <value>Buffer cannot be null.</value> - </data> - <data name="ArgumentNull_Child" xml:space="preserve"> - <value>Cannot have a null child.</value> - </data> - <data name="ArgumentNull_Collection" xml:space="preserve"> - <value>Collection cannot be null.</value> - </data> - <data name="ArgumentNull_CriticalHandle" xml:space="preserve"> - <value>CriticalHandle cannot be null.</value> - </data> - <data name="ArgumentNull_CultureInfo" xml:space="preserve"> - <value>CultureInfo cannot be null.</value> - </data> - <data name="ArgumentNull_Dictionary" xml:space="preserve"> - <value>Dictionary cannot be null.</value> - </data> - <data name="ArgumentNull_FileName" xml:space="preserve"> - <value>File name cannot be null.</value> - </data> - <data name="ArgumentNull_Generic" xml:space="preserve"> - <value>Value cannot be null.</value> - </data> - <data name="ArgumentNull_Graph" xml:space="preserve"> - <value>Object Graph cannot be null.</value> - </data> - <data name="ArgumentNull_GUID" xml:space="preserve"> - <value>GUID cannot be null.</value> - </data> - <data name="ArgumentNull_Key" xml:space="preserve"> - <value>Key cannot be null.</value> - </data> - <data name="ArgumentNull_NullMember" xml:space="preserve"> - <value>Member at position {0} was null.</value> - </data> - <data name="ArgumentNull_Obj" xml:space="preserve"> - <value>Object cannot be null.</value> - </data> - <data name="ArgumentNull_Path" xml:space="preserve"> - <value>Path cannot be null.</value> - </data> - <data name="ArgumentNull_SafeHandle" xml:space="preserve"> - <value>SafeHandle cannot be null.</value> - </data> - <data name="ArgumentNull_Stream" xml:space="preserve"> - <value>Stream cannot be null.</value> - </data> - <data name="ArgumentNull_String" xml:space="preserve"> - <value>String reference not set to an instance of a String.</value> - </data> - <data name="ArgumentNull_Type" xml:space="preserve"> - <value>Type cannot be null.</value> - </data> - <data name="ArgumentNull_TypedRefType" xml:space="preserve"> - <value>Type in TypedReference cannot be null.</value> - </data> - <data name="ArgumentNull_TypeRequiredByResourceScope" xml:space="preserve"> - <value>The type parameter cannot be null when scoping the resource's visibility to Private or Assembly.</value> - </data> - <data name="ArgumentNull_Waithandles" xml:space="preserve"> - <value>The waitHandles parameter cannot be null.</value> - </data> - <data name="ArgumentNull_WithParamName" xml:space="preserve"> - <value>Parameter '{0}' cannot be null.</value> - </data> - <data name="ArgumentOutOfRange_ActualValue" xml:space="preserve"> - <value>Actual value was {0}.</value> - </data> - <data name="ArgumentOutOfRange_AddressSpace" xml:space="preserve"> - <value>The number of bytes cannot exceed the virtual address space on a 32 bit machine.</value> - </data> - <data name="ArgumentOutOfRange_AddValue" xml:space="preserve"> - <value>Value to add was out of range.</value> - </data> - <data name="ArgumentOutOfRange_ArrayLB" xml:space="preserve"> - <value>Number was less than the array's lower bound in the first dimension.</value> - </data> - <data name="ArgumentOutOfRange_ArrayLBAndLength" xml:space="preserve"> - <value>Higher indices will exceed Int32.MaxValue because of large lower bound and/or length.</value> - </data> - <data name="ArgumentOutOfRange_ArrayLength" xml:space="preserve"> - <value>The length of the array must be between {0} and {1}, inclusive.</value> - </data> - <data name="ArgumentOutOfRange_ArrayLengthMultiple" xml:space="preserve"> - <value>The length of the array must be a multiple of {0}.</value> - </data> - <data name="ArgumentOutOfRange_ArrayListInsert" xml:space="preserve"> - <value>Insertion index was out of range. Must be non-negative and less than or equal to size.</value> - </data> - <data name="ArgumentOutOfRange_ArrayTooSmall" xml:space="preserve"> - <value>Destination array is not long enough to copy all the required data. Check array length and offset.</value> - </data> - <data name="ArgumentOutOfRange_BadHourMinuteSecond" xml:space="preserve"> - <value>Hour, Minute, and Second parameters describe an un-representable DateTime.</value> - </data> - <data name="ArgumentOutOfRange_BadYearMonthDay" xml:space="preserve"> - <value>Year, Month, and Day parameters describe an un-representable DateTime.</value> - </data> - <data name="ArgumentOutOfRange_BeepFrequency" xml:space="preserve"> - <value>Console.Beep's frequency must be between {0} and {1}.</value> - </data> - <data name="ArgumentOutOfRange_BiggerThanCollection" xml:space="preserve"> - <value>Larger than collection size.</value> - </data> - <data name="ArgumentOutOfRange_BinaryReaderFillBuffer" xml:space="preserve"> - <value>The number of bytes requested does not fit into BinaryReader's internal buffer.</value> - </data> - <data name="ArgumentOutOfRange_Bounds_Lower_Upper" xml:space="preserve"> - <value>Argument must be between {0} and {1}.</value> - </data> - <data name="ArgumentOutOfRange_CalendarRange" xml:space="preserve"> - <value>Specified time is not supported in this calendar. It should be between {0} (Gregorian date) and {1} (Gregorian date), inclusive.</value> - </data> - <data name="ArgumentOutOfRange_Capacity" xml:space="preserve"> - <value>Capacity exceeds maximum capacity.</value> - </data> - <data name="ArgumentOutOfRange_ConsoleBufferBoundaries" xml:space="preserve"> - <value>The value must be greater than or equal to zero and less than the console's buffer size in that dimension.</value> - </data> - <data name="ArgumentOutOfRange_ConsoleBufferLessThanWindowSize" xml:space="preserve"> - <value>The console buffer size must not be less than the current size and position of the console window, nor greater than or equal to Int16.MaxValue.</value> - </data> - <data name="ArgumentOutOfRange_ConsoleKey" xml:space="preserve"> - <value>Console key values must be between 0 and 255.</value> - </data> - <data name="ArgumentOutOfRange_ConsoleTitleTooLong" xml:space="preserve"> - <value>The console title is too long.</value> - </data> - <data name="ArgumentOutOfRange_ConsoleWindowBufferSize" xml:space="preserve"> - <value>The new console window size would force the console buffer size to be too large.</value> - </data> - <data name="ArgumentOutOfRange_ConsoleWindowPos" xml:space="preserve"> - <value>The window position must be set such that the current window size fits within the console's buffer, and the numbers must not be negative.</value> - </data> - <data name="ArgumentOutOfRange_ConsoleWindowSize_Size" xml:space="preserve"> - <value>The value must be less than the console's current maximum window size of {0} in that dimension. Note that this value depends on screen resolution and the console font.</value> - </data> - <data name="ArgumentOutOfRange_Count" xml:space="preserve"> - <value>Count must be positive and count must refer to a location within the string/array/collection.</value> - </data> - <data name="ArgumentOutOfRange_CursorSize" xml:space="preserve"> - <value>The cursor size is invalid. It must be a percentage between 1 and 100.</value> - </data> - <data name="ArgumentOutOfRange_DateArithmetic" xml:space="preserve"> - <value>The added or subtracted value results in an un-representable DateTime.</value> - </data> - <data name="ArgumentOutOfRange_DateTimeBadMonths" xml:space="preserve"> - <value>Months value must be between +/-120000.</value> - </data> - <data name="ArgumentOutOfRange_DateTimeBadTicks" xml:space="preserve"> - <value>Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.</value> - </data> - <data name="ArgumentOutOfRange_DateTimeBadYears" xml:space="preserve"> - <value>Years value must be between +/-10000.</value> - </data> - <data name="ArgumentOutOfRange_Day" xml:space="preserve"> - <value>Day must be between 1 and {0} for month {1}.</value> - </data> - <data name="ArgumentOutOfRange_DayOfWeek" xml:space="preserve"> - <value>The DayOfWeek enumeration must be in the range 0 through 6.</value> - </data> - <data name="ArgumentOutOfRange_DayParam" xml:space="preserve"> - <value>The Day parameter must be in the range 1 through 31.</value> - </data> - <data name="ArgumentOutOfRange_DecimalRound" xml:space="preserve"> - <value>Decimal can only round to between 0 and 28 digits of precision.</value> - </data> - <data name="ArgumentOutOfRange_DecimalScale" xml:space="preserve"> - <value>Decimal's scale value must be between 0 and 28, inclusive.</value> - </data> - <data name="ArgumentOutOfRange_EndIndexStartIndex" xml:space="preserve"> - <value>endIndex cannot be greater than startIndex.</value> - </data> - <data name="ArgumentOutOfRange_Enum" xml:space="preserve"> - <value>Enum value was out of legal range.</value> - </data> - <data name="ArgumentOutOfRange_Era" xml:space="preserve"> - <value>Time value was out of era range.</value> - </data> - <data name="ArgumentOutOfRange_FileLengthTooBig" xml:space="preserve"> - <value>Specified file length was too large for the file system.</value> - </data> - <data name="ArgumentOutOfRange_FileTimeInvalid" xml:space="preserve"> - <value>Not a valid Win32 FileTime.</value> - </data> - <data name="ArgumentOutOfRange_GenericPositive" xml:space="preserve"> - <value>Value must be positive.</value> - </data> - <data name="ArgumentOutOfRange_GetByteCountOverflow" xml:space="preserve"> - <value>Too many characters. The resulting number of bytes is larger than what can be returned as an int.</value> - </data> - <data name="ArgumentOutOfRange_GetCharCountOverflow" xml:space="preserve"> - <value>Too many bytes. The resulting number of chars is larger than what can be returned as an int.</value> - </data> - <data name="ArgumentOutOfRange_HashtableLoadFactor" xml:space="preserve"> - <value>Load factor needs to be between 0.1 and 1.0.</value> - </data> - <data name="ArgumentOutOfRange_HugeArrayNotSupported" xml:space="preserve"> - <value>Arrays larger than 2GB are not supported.</value> - </data> - <data name="ArgumentOutOfRange_Index" xml:space="preserve"> - <value>Index was out of range. Must be non-negative and less than the size of the collection.</value> - </data> - <data name="ArgumentOutOfRange_IndexCount" xml:space="preserve"> - <value>Index and count must refer to a location within the string.</value> - </data> - <data name="ArgumentOutOfRange_IndexCountBuffer" xml:space="preserve"> - <value>Index and count must refer to a location within the buffer.</value> - </data> - <data name="ArgumentOutOfRange_IndexLargerThanMaxValue" xml:space="preserve"> - <value>This collection cannot work with indices larger than Int32.MaxValue - 1 (0x7FFFFFFF - 1).</value> - </data> - <data name="ArgumentOutOfRange_IndexLength" xml:space="preserve"> - <value>Index and length must refer to a location within the string.</value> - </data> - <data name="ArgumentOutOfRange_IndexOutOfRange" xml:space="preserve"> - <value>The specified index is outside the current index range of this collection.</value> - </data> - <data name="ArgumentOutOfRange_IndexString" xml:space="preserve"> - <value>Index was out of range. Must be non-negative and less than the length of the string.</value> - </data> - <data name="ArgumentOutOfRange_InvalidEraValue" xml:space="preserve"> - <value>Era value was not valid.</value> - </data> - <data name="ArgumentOutOfRange_InvalidHighSurrogate" xml:space="preserve"> - <value>A valid high surrogate character is between 0xd800 and 0xdbff, inclusive.</value> - </data> - <data name="ArgumentOutOfRange_InvalidLowSurrogate" xml:space="preserve"> - <value>A valid low surrogate character is between 0xdc00 and 0xdfff, inclusive.</value> - </data> - <data name="ArgumentOutOfRange_InvalidThreshold" xml:space="preserve"> - <value>The specified threshold for creating dictionary is out of range.</value> - </data> - <data name="ArgumentOutOfRange_InvalidUserDefinedAceType" xml:space="preserve"> - <value>User-defined ACEs must not have a well-known ACE type.</value> - </data> - <data name="ArgumentOutOfRange_InvalidUTF32" xml:space="preserve"> - <value>A valid UTF32 value is between 0x000000 and 0x10ffff, inclusive, and should not include surrogate codepoint values (0x00d800 ~ 0x00dfff).</value> - </data> - <data name="ArgumentOutOfRange_Length" xml:space="preserve"> - <value>The specified length exceeds maximum capacity of SecureString.</value> - </data> - <data name="ArgumentOutOfRange_LengthGreaterThanCapacity" xml:space="preserve"> - <value>The length cannot be greater than the capacity.</value> - </data> - <data name="ArgumentOutOfRange_LengthTooLarge" xml:space="preserve"> - <value>The specified length exceeds the maximum value of {0}.</value> - </data> - <data name="ArgumentOutOfRange_LessEqualToIntegerMaxVal" xml:space="preserve"> - <value>Argument must be less than or equal to 2^31 - 1 milliseconds.</value> - </data> - <data name="ArgumentOutOfRange_ListInsert" xml:space="preserve"> - <value>Index must be within the bounds of the List.</value> - </data> - <data name="ArgumentOutOfRange_MaxArgExceeded" xml:space="preserve"> - <value>The total number of parameters must not exceed {0}.</value> - </data> - <data name="ArgumentOutOfRange_MaxStringsExceeded" xml:space="preserve"> - <value>The number of String parameters must not exceed {0}.</value> - </data> - <data name="ArgumentOutOfRange_Month" xml:space="preserve"> - <value>Month must be between one and twelve.</value> - </data> - <data name="ArgumentOutOfRange_MonthParam" xml:space="preserve"> - <value>The Month parameter must be in the range 1 through 12.</value> - </data> - <data name="ArgumentOutOfRange_MustBeNonNegInt32" xml:space="preserve"> - <value>Value must be non-negative and less than or equal to Int32.MaxValue.</value> - </data> - <data name="ArgumentOutOfRange_MustBeNonNegNum" xml:space="preserve"> - <value>'{0}' must be non-negative.</value> - </data> - <data name="ArgumentOutOfRange_MustBePositive" xml:space="preserve"> - <value>'{0}' must be greater than zero.</value> - </data> - <data name="ArgumentOutOfRange_NeedNonNegNum" xml:space="preserve"> - <value>Non-negative number required.</value> - </data> - <data name="ArgumentOutOfRange_NeedNonNegOrNegative1" xml:space="preserve"> - <value>Number must be either non-negative and less than or equal to Int32.MaxValue or -1.</value> - </data> - <data name="ArgumentOutOfRange_NeedPosNum" xml:space="preserve"> - <value>Positive number required.</value> - </data> - <data name="ArgumentOutOfRange_NeedValidId" xml:space="preserve"> - <value>The ID parameter must be in the range {0} through {1}.</value> - </data> - <data name="ArgumentOutOfRange_NegativeCapacity" xml:space="preserve"> - <value>Capacity must be positive.</value> - </data> - <data name="ArgumentOutOfRange_NegativeCount" xml:space="preserve"> - <value>Count cannot be less than zero.</value> - </data> - <data name="ArgumentOutOfRange_NegativeLength" xml:space="preserve"> - <value>Length cannot be less than zero.</value> - </data> - <data name="ArgumentOutOfRange_NegFileSize" xml:space="preserve"> - <value>Length must be non-negative.</value> - </data> - <data name="ArgumentOutOfRange_ObjectID" xml:space="preserve"> - <value>objectID cannot be less than or equal to zero.</value> - </data> - <data name="ArgumentOutOfRange_OffsetLength" xml:space="preserve"> - <value>Offset and length must refer to a position in the string.</value> - </data> - <data name="ArgumentOutOfRange_OffsetOut" xml:space="preserve"> - <value>Either offset did not refer to a position in the string, or there is an insufficient length of destination character array.</value> - </data> - <data name="ArgumentOutOfRange_ParamSequence" xml:space="preserve"> - <value>The specified parameter index is not in range.</value> - </data> - <data name="ArgumentOutOfRange_PartialWCHAR" xml:space="preserve"> - <value>Pointer startIndex and length do not refer to a valid string.</value> - </data> - <data name="ArgumentOutOfRange_PeriodTooLarge" xml:space="preserve"> - <value>Period must be less than 2^32-2.</value> - </data> - <data name="ArgumentOutOfRange_PositionLessThanCapacityRequired" xml:space="preserve"> - <value>The position may not be greater or equal to the capacity of the accessor.</value> - </data> - <data name="ArgumentOutOfRange_QueueGrowFactor" xml:space="preserve"> - <value>Queue grow factor must be between {0} and {1}.</value> - </data> - <data name="ArgumentOutOfRange_Range" xml:space="preserve"> - <value>Valid values are between {0} and {1}, inclusive.</value> - </data> - <data name="ArgumentOutOfRange_RoundingDigits" xml:space="preserve"> - <value>Rounding digits must be between 0 and 15, inclusive.</value> - </data> - <data name="ArgumentOutOfRange_SmallCapacity" xml:space="preserve"> - <value>capacity was less than the current size.</value> - </data> - <data name="ArgumentOutOfRange_SmallMaxCapacity" xml:space="preserve"> - <value>MaxCapacity must be one or greater.</value> - </data> - <data name="ArgumentOutOfRange_StartIndex" xml:space="preserve"> - <value>StartIndex cannot be less than zero.</value> - </data> - <data name="ArgumentOutOfRange_StartIndexLargerThanLength" xml:space="preserve"> - <value>startIndex cannot be larger than length of string.</value> - </data> - <data name="ArgumentOutOfRange_StartIndexLessThanLength" xml:space="preserve"> - <value>startIndex must be less than length of string.</value> - </data> - <data name="ArgumentOutOfRange_StreamLength" xml:space="preserve"> - <value>Stream length must be non-negative and less than 2^31 - 1 - origin.</value> - </data> - <data name="ArgumentOutOfRange_TimeoutTooLarge" xml:space="preserve"> - <value>Time-out interval must be less than 2^32-2.</value> - </data> - <data name="ArgumentOutOfRange_UIntPtrMax" xml:space="preserve"> - <value>The length of the buffer must be less than the maximum UIntPtr value for your platform.</value> - </data> - <data name="ArgumentOutOfRange_UnmanagedMemStreamLength" xml:space="preserve"> - <value>UnmanagedMemoryStream length must be non-negative and less than 2^63 - 1 - baseAddress.</value> - </data> - <data name="ArgumentOutOfRange_UnmanagedMemStreamWrapAround" xml:space="preserve"> - <value>The UnmanagedMemoryStream capacity would wrap around the high end of the address space.</value> - </data> - <data name="ArgumentOutOfRange_UtcOffset" xml:space="preserve"> - <value>The TimeSpan parameter must be within plus or minus 14.0 hours.</value> - </data> - <data name="ArgumentOutOfRange_UtcOffsetAndDaylightDelta" xml:space="preserve"> - <value>The sum of the BaseUtcOffset and DaylightDelta properties must within plus or minus 14.0 hours.</value> - </data> - <data name="ArgumentOutOfRange_Version" xml:space="preserve"> - <value>Version's parameters must be greater than or equal to zero.</value> - </data> - <data name="ArgumentOutOfRange_Week" xml:space="preserve"> - <value>The Week parameter must be in the range 1 through 5.</value> - </data> - <data name="ArgumentOutOfRange_Year" xml:space="preserve"> - <value>Year must be between 1 and 9999.</value> - </data> - <data name="Arithmetic_NaN" xml:space="preserve"> - <value>Function does not accept floating point Not-a-Number values.</value> - </data> - <data name="ArrayTypeMismatch_CantAssignType" xml:space="preserve"> - <value>Source array type cannot be assigned to destination array type.</value> - </data> - <data name="ArrayTypeMismatch_ConstrainedCopy" xml:space="preserve"> - <value>Array.ConstrainedCopy will only work on array types that are provably compatible, without any form of boxing, unboxing, widening, or casting of each array element. Change the array types (i.e., copy a Derived[] to a Base[]), or use a mitigation strategy in the CER for Array.Copy's less powerful reliability contract, such as cloning the array or throwing away the potentially corrupt destination array.</value> - </data> - <data name="Arugment_EmitMixedContext1" xml:space="preserve"> - <value>Type '{0}' was loaded in the ReflectionOnly context but the AssemblyBuilder was not created as AssemblyBuilderAccess.ReflectionOnly.</value> - </data> - <data name="Arugment_EmitMixedContext2" xml:space="preserve"> - <value>Type '{0}' was not loaded in the ReflectionOnly context but the AssemblyBuilder was created as AssemblyBuilderAccess.ReflectionOnly.</value> - </data> - <data name="AssertionFailed" xml:space="preserve"> - <value>Assertion failed.</value> - </data> - <data name="AssertionFailed_Cnd" xml:space="preserve"> - <value>Assertion failed: {0}</value> - </data> - <data name="AssumptionFailed" xml:space="preserve"> - <value>Assumption failed.</value> - </data> - <data name="AssumptionFailed_Cnd" xml:space="preserve"> - <value>Assumption failed: {0}</value> - </data> - <data name="AsyncMethodBuilder_InstanceNotInitialized" xml:space="preserve"> - <value>The builder was not properly initialized.</value> - </data> - <data name="AwaitableAwaiter_InstanceNotInitialized" xml:space="preserve"> - <value>The awaitable or awaiter was not properly initialized.</value> - </data> - <data name="BadImageFormat_BadILFormat" xml:space="preserve"> - <value>Bad IL format.</value> - </data> - <data name="BadImageFormat_InvalidType" xml:space="preserve"> - <value>Corrupt .resources file. The specified type doesn't exist.</value> - </data> - <data name="BadImageFormat_NegativeStringLength" xml:space="preserve"> - <value>Corrupt .resources file. String length must be non-negative.</value> - </data> - <data name="BadImageFormat_ParameterSignatureMismatch" xml:space="preserve"> - <value>The parameters and the signature of the method don't match.</value> - </data> - <data name="BadImageFormat_ResourceDataLengthInvalid" xml:space="preserve"> - <value>Corrupt .resources file. The specified data length '{0}' is not a valid position in the stream.</value> - </data> - <data name="BadImageFormat_ResourceNameCorrupted" xml:space="preserve"> - <value>Corrupt .resources file. A resource name extends past the end of the stream.</value> - </data> - <data name="BadImageFormat_ResourceNameCorrupted_NameIndex" xml:space="preserve"> - <value>Corrupt .resources file. The resource name for name index {0} extends past the end of the stream.</value> - </data> - <data name="BadImageFormat_ResourcesDataInvalidOffset" xml:space="preserve"> - <value>Corrupt .resources file. Invalid offset '{0}' into data section.</value> - </data> - <data name="BadImageFormat_ResourcesHeaderCorrupted" xml:space="preserve"> - <value>Corrupt .resources file. Unable to read resources from this file because of invalid header information. Try regenerating the .resources file.</value> - </data> - <data name="BadImageFormat_ResourcesIndexInvalid" xml:space="preserve"> - <value>Corrupt .resources file. The resource index '{0}' is outside the valid range.</value> - </data> - <data name="BadImageFormat_ResourcesIndexTooLong" xml:space="preserve"> - <value>Corrupt .resources file. String for name index '{0}' extends past the end of the file.</value> - </data> - <data name="BadImageFormat_ResourcesNameInvalidOffset" xml:space="preserve"> - <value>Corrupt .resources file. Invalid offset '{0}' into name section.</value> - </data> - <data name="BadImageFormat_ResourcesNameTooLong" xml:space="preserve"> - <value>Corrupt .resources file. Resource name extends past the end of the file.</value> - </data> - <data name="BadImageFormat_ResTypeAndSerBlobMismatch" xml:space="preserve"> - <value>The type serialized in the .resources file was not the same type that the .resources file said it contained. Expected '{0}' but read '{1}'.</value> - </data> - <data name="BadImageFormat_StreamPositionInvalid" xml:space="preserve"> - <value>Corrupt .resources file. The specified position '{0}' is not a valid position in the stream.</value> - </data> - <data name="BadImageFormat_TypeMismatch" xml:space="preserve"> - <value>Corrupt .resources file. The specified type doesn't match the available data in the stream.</value> - </data> - <data name="CancellationToken_CreateLinkedToken_TokensIsEmpty" xml:space="preserve"> - <value>No tokens were supplied.</value> - </data> - <data name="CancellationToken_SourceDisposed" xml:space="preserve"> - <value>The CancellationTokenSource associated with this CancellationToken has been disposed.</value> - </data> - <data name="CancellationTokenSource_Disposed" xml:space="preserve"> - <value>The CancellationTokenSource has been disposed.</value> - </data> - <data name="ConcurrentCollection_SyncRoot_NotSupported" xml:space="preserve"> - <value>The SyncRoot property may not be used for the synchronization of concurrent collections.</value> - </data> - <data name="ConcurrentDictionary_ArrayIncorrectType" xml:space="preserve"> - <value>The array is multidimensional, or the type parameter for the set cannot be cast automatically to the type of the destination array.</value> - </data> - <data name="ConcurrentDictionary_ArrayNotLargeEnough" xml:space="preserve"> - <value>The index is equal to or greater than the length of the array, or the number of elements in the dictionary is greater than the available space from index to the end of the destination array.</value> - </data> - <data name="ConcurrentDictionary_CapacityMustNotBeNegative" xml:space="preserve"> - <value>The capacity argument must be greater than or equal to zero.</value> - </data> - <data name="ConcurrentDictionary_ConcurrencyLevelMustBePositive" xml:space="preserve"> - <value>The concurrencyLevel argument must be positive.</value> - </data> - <data name="ConcurrentDictionary_IndexIsNegative" xml:space="preserve"> - <value>The index argument is less than zero.</value> - </data> - <data name="ConcurrentDictionary_ItemKeyIsNull" xml:space="preserve"> - <value>TKey is a reference type and item.Key is null.</value> - </data> - <data name="ConcurrentDictionary_KeyAlreadyExisted" xml:space="preserve"> - <value>The key already existed in the dictionary.</value> - </data> - <data name="ConcurrentDictionary_SourceContainsDuplicateKeys" xml:space="preserve"> - <value>The source argument contains duplicate keys.</value> - </data> - <data name="ConcurrentDictionary_TypeOfKeyIncorrect" xml:space="preserve"> - <value>The key was of an incorrect type for this dictionary.</value> - </data> - <data name="ConcurrentDictionary_TypeOfValueIncorrect" xml:space="preserve"> - <value>The value was of an incorrect type for this dictionary.</value> - </data> - <data name="ConcurrentStack_PushPopRange_CountOutOfRange" xml:space="preserve"> - <value>The count argument must be greater than or equal to zero.</value> - </data> - <data name="ConcurrentStack_PushPopRange_InvalidCount" xml:space="preserve"> - <value>The sum of the startIndex and count arguments must be less than or equal to the collection's Count.</value> - </data> - <data name="ConcurrentStack_PushPopRange_StartOutOfRange" xml:space="preserve"> - <value>The startIndex argument must be greater than or equal to zero.</value> - </data> - <data name="ConcurrentStackQueue_OnDeserialization_NoData" xml:space="preserve"> - <value>The serialization stream contains no elements.</value> - </data> - <data name="CountdownEvent_Decrement_BelowZero" xml:space="preserve"> - <value>Invalid attempt made to decrement the event's count below zero.</value> - </data> - <data name="CountdownEvent_Increment_AlreadyMax" xml:space="preserve"> - <value>The increment operation would cause the CurrentCount to overflow.</value> - </data> - <data name="CountdownEvent_Increment_AlreadyZero" xml:space="preserve"> - <value>The event is already signaled and cannot be incremented.</value> - </data> - <data name="Cryptography_CryptoStream_FlushFinalBlockTwice" xml:space="preserve"> - <value>FlushFinalBlock() method was called twice on a CryptoStream. It can only be called once.</value> - </data> - <data name="Cryptography_CSSM_Error" xml:space="preserve"> - <value>Error 0x{0} from the operating system security framework: '{1}'.</value> - </data> - <data name="Cryptography_CSSM_Error_Unknown" xml:space="preserve"> - <value>Error 0x{0} from the operating system security framework.</value> - </data> - <data name="Cryptography_HashKeySet" xml:space="preserve"> - <value>Hash key cannot be changed after the first write to the stream.</value> - </data> - <data name="Cryptography_HashNotYetFinalized" xml:space="preserve"> - <value>Hash must be finalized before the hash value is retrieved.</value> - </data> - <data name="Cryptography_InsufficientBuffer" xml:space="preserve"> - <value>Input buffer contains insufficient data.</value> - </data> - <data name="Cryptography_InvalidBlockSize" xml:space="preserve"> - <value>Specified block size is not valid for this algorithm.</value> - </data> - <data name="Cryptography_InvalidCipherMode" xml:space="preserve"> - <value>Specified cipher mode is not valid for this algorithm.</value> - </data> - <data name="Cryptography_InvalidDSASignatureSize" xml:space="preserve"> - <value>Length of the DSA signature was not 40 bytes.</value> - </data> - <data name="Cryptography_InvalidHandle" xml:space="preserve"> - <value>{0} is an invalid handle.</value> - </data> - <data name="Cryptography_InvalidIVSize" xml:space="preserve"> - <value>Specified initialization vector (IV) does not match the block size for this algorithm.</value> - </data> - <data name="Cryptography_InvalidKeySize" xml:space="preserve"> - <value>Specified key is not a valid size for this algorithm.</value> - </data> - <data name="Cryptography_InvalidOID" xml:space="preserve"> - <value>Object identifier (OID) is unknown.</value> - </data> - <data name="Cryptography_OAEPDecoding" xml:space="preserve"> - <value>Error occurred while decoding OAEP padding.</value> - </data> - <data name="Cryptography_PasswordDerivedBytes_FewBytesSalt" xml:space="preserve"> - <value>Salt is not at least eight bytes.</value> - </data> - <data name="Cryptography_PasswordDerivedBytes_InvalidIV" xml:space="preserve"> - <value>The Initialization vector should have the same length as the algorithm block size in bytes.</value> - </data> - <data name="Cryptography_PKCS7_InvalidPadding" xml:space="preserve"> - <value>Padding is invalid and cannot be removed.</value> - </data> - <data name="Cryptography_SSE_InvalidDataSize" xml:space="preserve"> - <value>Length of the data to encrypt is invalid.</value> - </data> - <data name="Cryptography_UnknownHashAlgorithm" xml:space="preserve"> - <value>'{0}' is not a known hash algorithm.</value> - </data> - <data name="Cryptography_X509_ExportFailed" xml:space="preserve"> - <value>The certificate export operation failed.</value> - </data> - <data name="Cryptography_X509_InvalidContentType" xml:space="preserve"> - <value>Invalid content type.</value> - </data> - <data name="Error_SecurityPolicyFileParse" xml:space="preserve"> - <value>Error occurred while parsing the '{0}' policy level. The default policy level was used instead.</value> - </data> - <data name="Error_SecurityPolicyFileParseEx" xml:space="preserve"> - <value>Error '{1}' occurred while parsing the '{0}' policy level. The default policy level was used instead.</value> - </data> - <data name="event_Barrier_PhaseFinished" xml:space="preserve"> - <value>Barrier finishing phase {1}.</value> - </data> - <data name="event_ConcurrentBag_TryPeekSteals" xml:space="preserve"> - <value>ConcurrentBag stealing in TryPeek.</value> - </data> - <data name="event_ConcurrentBag_TryTakeSteals" xml:space="preserve"> - <value>ConcurrentBag stealing in TryTake.</value> - </data> - <data name="event_ConcurrentDictionary_AcquiringAllLocks" xml:space="preserve"> - <value>ConcurrentDictionary acquiring all locks on {0} bucket(s).</value> - </data> - <data name="event_ConcurrentStack_FastPopFailed" xml:space="preserve"> - <value>Pop from ConcurrentStack spun {0} time(s).</value> - </data> - <data name="event_ConcurrentStack_FastPushFailed" xml:space="preserve"> - <value>Push to ConcurrentStack spun {0} time(s).</value> - </data> - <data name="event_ParallelFork" xml:space="preserve"> - <value>Task {1} entering fork/join {2}.</value> - </data> - <data name="event_ParallelInvokeBegin" xml:space="preserve"> - <value>Beginning ParallelInvoke {2} from Task {1} for {4} actions.</value> - </data> - <data name="event_ParallelInvokeEnd" xml:space="preserve"> - <value>Ending ParallelInvoke {2}.</value> - </data> - <data name="event_ParallelJoin" xml:space="preserve"> - <value>Task {1} leaving fork/join {2}.</value> - </data> - <data name="event_ParallelLoopBegin" xml:space="preserve"> - <value>Beginning {3} loop {2} from Task {1}.</value> - </data> - <data name="event_ParallelLoopEnd" xml:space="preserve"> - <value>Ending loop {2} after {3} iterations.</value> - </data> - <data name="event_SpinLock_FastPathFailed" xml:space="preserve"> - <value>SpinLock beginning to spin.</value> - </data> - <data name="event_SpinWait_NextSpinWillYield" xml:space="preserve"> - <value>Next spin will yield.</value> - </data> - <data name="event_TaskCompleted" xml:space="preserve"> - <value>Task {2} completed.</value> - </data> - <data name="event_TaskScheduled" xml:space="preserve"> - <value>Task {2} scheduled to TaskScheduler {0}.</value> - </data> - <data name="event_TaskStarted" xml:space="preserve"> - <value>Task {2} executing.</value> - </data> - <data name="event_TaskWaitBegin" xml:space="preserve"> - <value>Beginning wait ({3}) on Task {2}.</value> - </data> - <data name="event_TaskWaitEnd" xml:space="preserve"> - <value>Ending wait on Task {2}.</value> - </data> - <data name="EventSource_AbstractMustNotDeclareEventMethods" xml:space="preserve"> - <value>Abstract event source must not declare event methods ({0} with ID {1}).</value> - </data> - <data name="EventSource_AbstractMustNotDeclareKTOC" xml:space="preserve"> - <value>Abstract event source must not declare {0} nested type.</value> - </data> - <data name="EventSource_AddScalarOutOfRange" xml:space="preserve"> - <value>Getting out of bounds during scalar addition.</value> - </data> - <data name="EventSource_AttributeOnNonVoid" xml:space="preserve"> - <value>Event attribute placed on method {0} which does not return 'void'.</value> - </data> - <data name="EventSource_ChannelTypeDoesNotMatchEventChannelValue" xml:space="preserve"> - <value>Channel {0} does not match event channel value {1}.</value> - </data> - <data name="EventSource_DataDescriptorsOutOfRange" xml:space="preserve"> - <value>Data descriptors are out of range.</value> - </data> - <data name="EventSource_DuplicateStringKey" xml:space="preserve"> - <value>Multiple definitions for string "{0}".</value> - </data> - <data name="EventSource_EnumKindMismatch" xml:space="preserve"> - <value>The type of {0} is not expected in {1}.</value> - </data> - <data name="EventSource_EtwAlreadyRegistered" xml:space="preserve"> - <value>The provider has already been registered with the operating system.</value> - </data> - <data name="EventSource_EventChannelOutOfRange" xml:space="preserve"> - <value>Channel {0} has a value of {1} which is outside the legal range (16-254).</value> - </data> - <data name="EventSource_EventIdReused" xml:space="preserve"> - <value>Event {0} has ID {1} which is already in use.</value> - </data> - <data name="EventSource_EventMustHaveTaskIfNonDefaultOpcode" xml:space="preserve"> - <value>Event {0} (with ID {1}) has a non-default opcode but not a task.</value> - </data> - <data name="EventSource_EventMustNotBeExplicitImplementation" xml:space="preserve"> - <value>Event method {0} (with ID {1}) is an explicit interface method implementation. Re-write method as implicit implementation.</value> - </data> - <data name="EventSource_EventNameDoesNotEqualTaskPlusOpcode" xml:space="preserve"> - <value>Event {0} (with ID {1}) has a name that is not the concatenation of its task name and opcode.</value> - </data> - <data name="EventSource_EventNameReused" xml:space="preserve"> - <value>Event name {0} used more than once. If you wish to overload a method, the overloaded method should have a NonEvent attribute.</value> - </data> - <data name="EventSource_EventParametersMismatch" xml:space="preserve"> - <value>Event {0} was called with {1} argument(s), but it is defined with {2} parameter(s).</value> - </data> - <data name="EventSource_EventSourceGuidInUse" xml:space="preserve"> - <value>An instance of EventSource with Guid {0} already exists.</value> - </data> - <data name="EventSource_EventWithAdminChannelMustHaveMessage" xml:space="preserve"> - <value>Event {0} specifies an Admin channel {1}. It must specify a Message property.</value> - </data> - <data name="EventSource_IllegalKeywordsValue" xml:space="preserve"> - <value>Keyword {0} has a value of {1} which is outside the legal range (0-0x0000080000000000).</value> - </data> - <data name="EventSource_IllegalOpcodeValue" xml:space="preserve"> - <value>Opcode {0} has a value of {1} which is outside the legal range (11-238).</value> - </data> - <data name="EventSource_IllegalTaskValue" xml:space="preserve"> - <value>Task {0} has a value of {1} which is outside the legal range (1-65535).</value> - </data> - <data name="EventSource_IncorrentlyAuthoredTypeInfo" xml:space="preserve"> - <value>Incorrectly-authored TypeInfo - a type should be serialized as one field or as one group</value> - </data> - <data name="EventSource_InvalidCommand" xml:space="preserve"> - <value>Invalid command value.</value> - </data> - <data name="EventSource_InvalidEventFormat" xml:space="preserve"> - <value>Can't specify both etw event format flags.</value> - </data> - <data name="EventSource_KeywordCollision" xml:space="preserve"> - <value>Keywords {0} and {1} are defined with the same value ({2}).</value> - </data> - <data name="EventSource_KeywordNeedPowerOfTwo" xml:space="preserve"> - <value>Value {0} for keyword {1} needs to be a power of 2.</value> - </data> - <data name="EventSource_ListenerCreatedInsideCallback" xml:space="preserve"> - <value>Creating an EventListener inside a EventListener callback.</value> - </data> - <data name="EventSource_ListenerNotFound" xml:space="preserve"> - <value>Listener not found.</value> - </data> - <data name="EventSource_ListenerWriteFailure" xml:space="preserve"> - <value>An error occurred when writing to a listener.</value> - </data> - <data name="EventSource_MaxChannelExceeded" xml:space="preserve"> - <value>Attempt to define more than the maximum limit of 8 channels for a provider.</value> - </data> - <data name="EventSource_MismatchIdToWriteEvent" xml:space="preserve"> - <value>Event {0} is givien event ID {1} but {2} was passed to WriteEvent.</value> - </data> - <data name="EventSource_NeedGuid" xml:space="preserve"> - <value>The Guid of an EventSource must be non zero.</value> - </data> - <data name="EventSource_NeedName" xml:space="preserve"> - <value>The name of an EventSource must not be null.</value> - </data> - <data name="EventSource_NeedPositiveId" xml:space="preserve"> - <value>Event IDs must be positive integers.</value> - </data> - <data name="EventSource_NoFreeBuffers" xml:space="preserve"> - <value>No Free Buffers available from the operating system (e.g. event rate too fast).</value> - </data> - <data name="EventSource_NonCompliantTypeError" xml:space="preserve"> - <value>The API supports only anonymous types or types decorated with the EventDataAttribute. Non-compliant type: {0} dataType.</value> - </data> - <data name="EventSource_NoRelatedActivityId" xml:space="preserve"> - <value>EventSource expects the first parameter of the Event method to be of type Guid and to be named "relatedActivityId" when calling WriteEventWithRelatedActivityId.</value> - </data> - <data name="EventSource_NotSupportedArrayOfBinary" xml:space="preserve"> - <value>Arrays of Binary are not supported.</value> - </data> - <data name="EventSource_NotSupportedArrayOfNil" xml:space="preserve"> - <value>Arrays of Nil are not supported.</value> - </data> - <data name="EventSource_NotSupportedArrayOfNullTerminatedString" xml:space="preserve"> - <value>Arrays of null-terminated string are not supported.</value> - </data> - <data name="EventSource_NotSupportedCustomSerializedData" xml:space="preserve"> - <value>Enumerables of custom-serialized data are not supported</value> - </data> - <data name="EventSource_NotSupportedEnumType" xml:space="preserve"> - <value>Enum type {0} underlying type {1} is not supported for serialization.</value> - </data> - <data name="EventSource_NotSupportedNestedArraysEnums" xml:space="preserve"> - <value>Nested arrays/enumerables are not supported.</value> - </data> - <data name="EventSource_NullInput" xml:space="preserve"> - <value>Null passed as a event argument.</value> - </data> - <data name="EventSource_OpcodeCollision" xml:space="preserve"> - <value>Opcodes {0} and {1} are defined with the same value ({2}).</value> - </data> - <data name="EventSource_PayloadTooBig" xml:space="preserve"> - <value>The payload for a single event is too large.</value> - </data> - <data name="EventSource_PeriodIllegalInProviderName" xml:space="preserve"> - <value>Period character ('.') is illegal in an ETW provider name ({0}).</value> - </data> - <data name="EventSource_PinArrayOutOfRange" xml:space="preserve"> - <value>Pins are out of range.</value> - </data> - <data name="EventSource_RecursiveTypeDefinition" xml:space="preserve"> - <value>Recursive type definition is not supported.</value> - </data> - <data name="EventSource_ReservedKeywords" xml:space="preserve"> - <value>Keywords values larger than 0x0000100000000000 are reserved for system use</value> - </data> - <data name="EventSource_ReservedOpcode" xml:space="preserve"> - <value>Opcode values less than 11 are reserved for system use.</value> - </data> - <data name="EventSource_SessionIdError" xml:space="preserve"> - <value>Bit position in AllKeywords ({0}) must equal the command argument named "EtwSessionKeyword" ({1}).</value> - </data> - <data name="EventSource_StopsFollowStarts" xml:space="preserve"> - <value>An event with stop suffix must follow a corresponding event with a start suffix.</value> - </data> - <data name="EventSource_TaskCollision" xml:space="preserve"> - <value>Tasks {0} and {1} are defined with the same value ({2}).</value> - </data> - <data name="EventSource_TaskOpcodePairReused" xml:space="preserve"> - <value>Event {0} (with ID {1}) has the same task/opcode pair as event {2} (with ID {3}).</value> - </data> - <data name="EventSource_TooManyArgs" xml:space="preserve"> - <value>Too many arguments.</value> - </data> - <data name="EventSource_TooManyFields" xml:space="preserve"> - <value>Too many fields in structure.</value> - </data> - <data name="EventSource_ToString" xml:space="preserve"> - <value>EventSource({0}, {1})</value> - </data> - <data name="EventSource_TypeMustBeSealedOrAbstract" xml:space="preserve"> - <value>Event source types must be sealed or abstract.</value> - </data> - <data name="EventSource_TypeMustDeriveFromEventSource" xml:space="preserve"> - <value>Event source types must derive from EventSource.</value> - </data> - <data name="EventSource_UndefinedChannel" xml:space="preserve"> - <value>Use of undefined channel value {0} for event {1}.</value> - </data> - <data name="EventSource_UndefinedKeyword" xml:space="preserve"> - <value>Use of undefined keyword value {0} for event {1}.</value> - </data> - <data name="EventSource_UndefinedOpcode" xml:space="preserve"> - <value>Use of undefined opcode value {0} for event {1}.</value> - </data> - <data name="EventSource_UnsupportedEventTypeInManifest" xml:space="preserve"> - <value>Unsupported type {0} in event source.</value> - </data> - <data name="EventSource_UnsupportedMessageProperty" xml:space="preserve"> - <value>Event {0} specifies an illegal or unsupported formatting message ("{1}").</value> - </data> - <data name="EventSource_VarArgsParameterMismatch" xml:space="preserve"> - <value>The parameters to the Event method do not match the parameters to the WriteEvent method. This may cause the event to be displayed incorrectly.</value> - </data> - <data name="Exception_EndOfInnerExceptionStack" xml:space="preserve"> - <value>--- End of inner exception stack trace ---</value> - </data> - <data name="Exception_EndStackTraceFromPreviousThrow" xml:space="preserve"> - <value>--- End of stack trace from previous location where exception was thrown ---</value> - </data> - <data name="Exception_WasThrown" xml:space="preserve"> - <value>Exception of type '{0}' was thrown.</value> - </data> - <data name="ExecutionContext_ExceptionInAsyncLocalNotification" xml:space="preserve"> - <value>An exception was not handled in an AsyncLocal<T> notification callback.</value> - </data> - <data name="ExecutionContext_UndoFailed" xml:space="preserve"> - <value>Undo operation on a component context threw an exception</value> - </data> - <data name="ExecutionEngine_InvalidAttribute" xml:space="preserve"> - <value>Attribute cannot have multiple definitions.</value> - </data> - <data name="ExecutionEngine_MissingSecurityDescriptor" xml:space="preserve"> - <value>Unable to retrieve security descriptor for this frame.</value> - </data> - <data name="FieldAccess_InitOnly" xml:space="preserve"> - <value>InitOnly (aka ReadOnly) fields can only be initialized in the type/instance constructor.</value> - </data> - <data name="FileNotFound_ResolveAssembly" xml:space="preserve"> - <value>Could not resolve assembly '{0}'.</value> - </data> - <data name="FileSecurityState_OperationNotPermitted" xml:space="preserve"> - <value>File operation not permitted. Access to path '{0}' is denied.</value> - </data> - <data name="Format_AttributeUsage" xml:space="preserve"> - <value>Duplicate AttributeUsageAttribute found on attribute type {0}.</value> - </data> - <data name="Format_Bad7BitInt32" xml:space="preserve"> - <value>Too many bytes in what should have been a 7 bit encoded Int32.</value> - </data> - <data name="Format_BadBase" xml:space="preserve"> - <value>Invalid digits for the specified base.</value> - </data> - <data name="Format_BadBase64Char" xml:space="preserve"> - <value>The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters.</value> - </data> - <data name="Format_BadBase64CharArrayLength" xml:space="preserve"> - <value>Invalid length for a Base-64 char array or string.</value> - </data> - <data name="Format_BadBoolean" xml:space="preserve"> - <value>String was not recognized as a valid Boolean.</value> - </data> - <data name="Format_BadDatePattern" xml:space="preserve"> - <value>Could not determine the order of year, month, and date from '{0}'.</value> - </data> - <data name="Format_BadDateTime" xml:space="preserve"> - <value>String was not recognized as a valid DateTime.</value> - </data> - <data name="Format_BadDateTimeCalendar" xml:space="preserve"> - <value>The DateTime represented by the string is not supported in calendar {0}.</value> - </data> - <data name="Format_BadDayOfWeek" xml:space="preserve"> - <value>String was not recognized as a valid DateTime because the day of week was incorrect.</value> - </data> - <data name="Format_BadFormatSpecifier" xml:space="preserve"> - <value>Format specifier was invalid.</value> - </data> - <data name="Format_BadQuote" xml:space="preserve"> - <value>Cannot find a matching quote character for the character '{0}'.</value> - </data> - <data name="Format_BadTimeSpan" xml:space="preserve"> - <value>String was not recognized as a valid TimeSpan.</value> - </data> - <data name="Format_DateOutOfRange" xml:space="preserve"> - <value>The DateTime represented by the string is out of range.</value> - </data> - <data name="Format_EmptyInputString" xml:space="preserve"> - <value>Input string was either empty or contained only whitespace.</value> - </data> - <data name="Format_ExtraJunkAtEnd" xml:space="preserve"> - <value>Additional non-parsable characters are at the end of the string.</value> - </data> - <data name="Format_GuidBrace" xml:space="preserve"> - <value>Expected {0xdddddddd, etc}.</value> - </data> - <data name="Format_GuidBraceAfterLastNumber" xml:space="preserve"> - <value>Could not find a brace, or the length between the previous token and the brace was zero (i.e., '0x,'etc.).</value> - </data> - <data name="Format_GuidComma" xml:space="preserve"> - <value>Could not find a comma, or the length between the previous token and the comma was zero (i.e., '0x,'etc.).</value> - </data> - <data name="Format_GuidDashes" xml:space="preserve"> - <value>Dashes are in the wrong position for GUID parsing.</value> - </data> - <data name="Format_GuidEndBrace" xml:space="preserve"> - <value>Could not find the ending brace.</value> - </data> - <data name="Format_GuidHexPrefix" xml:space="preserve"> - <value>Expected hex 0x in '{0}'.</value> - </data> - <data name="Format_GuidInvalidChar" xml:space="preserve"> - <value>Guid string should only contain hexadecimal characters.</value> - </data> - <data name="Format_GuidInvLen" xml:space="preserve"> - <value>Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx).</value> - </data> - <data name="Format_GuidUnrecognized" xml:space="preserve"> - <value>Unrecognized Guid format.</value> - </data> - <data name="Format_IndexOutOfRange" xml:space="preserve"> - <value>Index (zero based) must be greater than or equal to zero and less than the size of the argument list.</value> - </data> - <data name="Format_InvalidEnumFormatSpecification" xml:space="preserve"> - <value>Format String can be only "G", "g", "X", "x", "F", "f", "D" or "d".</value> - </data> - <data name="Format_InvalidGuidFormatSpecification" xml:space="preserve"> - <value>Format String can be only "D", "d", "N", "n", "P", "p", "B", "b", "X" or "x".</value> - </data> - <data name="Format_InvalidString" xml:space="preserve"> - <value>Input string was not in a correct format.</value> - </data> - <data name="Format_MissingIncompleteDate" xml:space="preserve"> - <value>There must be at least a partial date with a year present in the input.</value> - </data> - <data name="Format_NeedSingleChar" xml:space="preserve"> - <value>String must be exactly one character long.</value> - </data> - <data name="Format_NoParsibleDigits" xml:space="preserve"> - <value>Could not find any recognizable digits.</value> - </data> - <data name="Format_OffsetOutOfRange" xml:space="preserve"> - <value>The time zone offset must be within plus or minus 14 hours.</value> - </data> - <data name="Format_RepeatDateTimePattern" xml:space="preserve"> - <value>DateTime pattern '{0}' appears more than once with different values.</value> - </data> - <data name="Format_StringZeroLength" xml:space="preserve"> - <value>String cannot have zero length.</value> - </data> - <data name="Format_TwoTimeZoneSpecifiers" xml:space="preserve"> - <value>The String being parsed cannot contain two TimeZone specifiers.</value> - </data> - <data name="Format_UnknowDateTimeWord" xml:space="preserve"> - <value>The string was not recognized as a valid DateTime. There is an unknown word starting at index {0}.</value> - </data> - <data name="Format_UTCOutOfRange" xml:space="preserve"> - <value>The UTC representation of the date falls outside the year range 1-9999.</value> - </data> - <data name="GAC_ToString" xml:space="preserve"> - <value>GAC</value> - </data> - <data name="Globalization_cp_1200" xml:space="preserve"> - <value>Unicode</value> - </data> - <data name="Globalization_cp_12000" xml:space="preserve"> - <value>Unicode (UTF-32)</value> - </data> - <data name="Globalization_cp_12001" xml:space="preserve"> - <value>Unicode (UTF-32 Big-Endian)</value> - </data> - <data name="Globalization_cp_1201" xml:space="preserve"> - <value>Unicode (Big-Endian)</value> - </data> - <data name="Globalization_cp_20127" xml:space="preserve"> - <value>US-ASCII</value> - </data> - <data name="Globalization_cp_28591" xml:space="preserve"> - <value>Western European (ISO)</value> - </data> - <data name="Globalization_cp_65000" xml:space="preserve"> - <value>Unicode (UTF-7)</value> - </data> - <data name="Globalization_cp_65001" xml:space="preserve"> - <value>Unicode (UTF-8)</value> - </data> - <data name="Hash_ToString" xml:space="preserve"> - <value>Hash - {0} = {1}</value> - </data> - <data name="HostProtection_DemandedResources" xml:space="preserve"> - <value>The demanded resources were:</value> - </data> - <data name="HostProtection_HostProtection" xml:space="preserve"> - <value>Attempted to perform an operation that was forbidden by the CLR host.</value> - </data> - <data name="HostProtection_ProtectedResources" xml:space="preserve"> - <value>The protected resources (only available with full trust) were:</value> - </data> - <data name="IndexOutOfRange_ArrayRankIndex" xml:space="preserve"> - <value>Array does not have that many dimensions.</value> - </data> - <data name="IndexOutOfRange_IORaceCondition" xml:space="preserve"> - <value>Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader.</value> - </data> - <data name="IndexOutOfRange_UMSPosition" xml:space="preserve"> - <value>Unmanaged memory stream position was beyond the capacity of the stream.</value> - </data> - <data name="InsufficientMemory_MemFailPoint" xml:space="preserve"> - <value>Insufficient available memory to meet the expected demands of an operation at this time. Please try again later.</value> - </data> - <data name="InsufficientMemory_MemFailPoint_TooBig" xml:space="preserve"> - <value>Insufficient memory to meet the expected demands of an operation, and this system is likely to never satisfy this request. If this is a 32 bit system, consider booting in 3 GB mode.</value> - </data> - <data name="InsufficientMemory_MemFailPoint_VAFrag" xml:space="preserve"> - <value>Insufficient available memory to meet the expected demands of an operation at this time, possibly due to virtual address space fragmentation. Please try again later.</value> - </data> - <data name="Interop_COM_TypeMismatch" xml:space="preserve"> - <value>Type mismatch between source and destination types.</value> - </data> - <data name="Interop_Marshal_Unmappable_Char" xml:space="preserve"> - <value>Cannot marshal: Encountered unmappable character.</value> - </data> - <data name="InvalidCast_CannotCastNullToValueType" xml:space="preserve"> - <value>Null object cannot be converted to a value type.</value> - </data> - <data name="InvalidCast_CannotCoerceByRefVariant" xml:space="preserve"> - <value>Object cannot be coerced to the original type of the ByRef VARIANT it was obtained from.</value> - </data> - <data name="InvalidCast_DBNull" xml:space="preserve"> - <value>Object cannot be cast to DBNull.</value> - </data> - <data name="InvalidCast_DownCastArrayElement" xml:space="preserve"> - <value>At least one element in the source array could not be cast down to the destination array type.</value> - </data> - <data name="InvalidCast_Empty" xml:space="preserve"> - <value>Object cannot be cast to Empty.</value> - </data> - <data name="InvalidCast_FromDBNull" xml:space="preserve"> - <value>Object cannot be cast from DBNull to other types.</value> - </data> - <data name="InvalidCast_FromTo" xml:space="preserve"> - <value>Invalid cast from '{0}' to '{1}'.</value> - </data> - <data name="InvalidCast_IConvertible" xml:space="preserve"> - <value>Object must implement IConvertible.</value> - </data> - <data name="InvalidCast_OATypeMismatch" xml:space="preserve"> - <value>OleAut reported a type mismatch.</value> - </data> - <data name="InvalidCast_StoreArrayElement" xml:space="preserve"> - <value>Object cannot be stored in an array of this type.</value> - </data> - <data name="InvalidCast_WinRTIPropertyValueArrayCoersion" xml:space="preserve"> - <value>Object in an IPropertyValue is of type '{0}' which cannot be convereted to a '{1}' due to array element '{2}': {3}.</value> - </data> - <data name="InvalidCast_WinRTIPropertyValueCoersion" xml:space="preserve"> - <value>Object in an IPropertyValue is of type '{0}' with value '{1}', which cannot be converted to a '{2}'.</value> - </data> - <data name="InvalidCast_WinRTIPropertyValueElement" xml:space="preserve"> - <value>Object in an IPropertyValue is of type '{0}', which cannot be converted to a '{1}'.</value> - </data> - <data name="InvalidOperation_ActivationArgsAppTrustMismatch" xml:space="preserve"> - <value>The activation arguments and application trust for the AppDomain must correspond to the same application identity.</value> - </data> - <data name="InvalidOperation_AddContextFrozen" xml:space="preserve"> - <value>Attempted to add properties to a frozen context.</value> - </data> - <data name="InvalidOperation_AnonymousCannotImpersonate" xml:space="preserve"> - <value>An anonymous identity cannot perform an impersonation.</value> - </data> - <data name="InvalidOperation_ApartmentStateSwitchFailed" xml:space="preserve"> - <value>Failed to set the specified COM apartment state.</value> - </data> - <data name="InvalidOperation_APIInvalidForCurrentContext" xml:space="preserve"> - <value>The API '{0}' cannot be used on the current platform. See http://go.microsoft.com/fwlink/?LinkId=248273 for more information.</value> - </data> - <data name="InvalidOperation_AppDomainSandboxAPINeedsExplicitAppBase" xml:space="preserve"> - <value>This API requires the ApplicationBase to be specified explicitly in the AppDomainSetup parameter.</value> - </data> - <data name="InvalidOperation_AsmLoadedForReflectionOnly" xml:space="preserve"> - <value>Assembly has been loaded as ReflectionOnly. This API requires an assembly capable of execution.</value> - </data> - <data name="InvalidOperation_AssemblyHasBeenSaved" xml:space="preserve"> - <value>Assembly '{0}' has been saved.</value> - </data> - <data name="InvalidOperation_AssertTransparentCode" xml:space="preserve"> - <value>Cannot perform CAS Asserts in Security Transparent methods</value> - </data> - <data name="InvalidOperation_AsyncFlowCtrlCtxMismatch" xml:space="preserve"> - <value>AsyncFlowControl objects can be used to restore flow only on a Context that had its flow suppressed.</value> - </data> - <data name="InvalidOperation_AsyncIOInProgress" xml:space="preserve"> - <value>The stream is currently in use by a previous operation on the stream.</value> - </data> - <data name="InvalidOperation_BadEmptyMethodBody" xml:space="preserve"> - <value>Method '{0}' does not have a method body.</value> - </data> - <data name="InvalidOperation_BadILGeneratorUsage" xml:space="preserve"> - <value>ILGenerator usage is invalid.</value> - </data> - <data name="InvalidOperation_BadInstructionOrIndexOutOfBound" xml:space="preserve"> - <value>MSIL instruction is invalid or index is out of bounds.</value> - </data> - <data name="InvalidOperation_BadInterfaceNotAbstract" xml:space="preserve"> - <value>Interface must be declared abstract.</value> - </data> - <data name="InvalidOperation_BadMethodBody" xml:space="preserve"> - <value>Method '{0}' cannot have a method body.</value> - </data> - <data name="InvalidOperation_BadResourceContainer" xml:space="preserve"> - <value>Unable to add resource to transient module or transient assembly.</value> - </data> - <data name="InvalidOperation_BadTransientModuleReference" xml:space="preserve"> - <value>Unable to make a reference to a transient module from a non-transient module.</value> - </data> - <data name="InvalidOperation_BadTypeAttributesNotAbstract" xml:space="preserve"> - <value>Type must be declared abstract if any of its methods are abstract.</value> - </data> - <data name="InvalidOperation_CalledTwice" xml:space="preserve"> - <value>The method cannot be called twice on the same instance.</value> - </data> - <data name="InvalidOperation_CannotAlterAssembly" xml:space="preserve"> - <value>Unable to alter assembly information.</value> - </data> - <data name="InvalidOperation_CannotCopyUsedContext" xml:space="preserve"> - <value>Only newly captured contexts can be copied</value> - - </data> - <data name="InvalidOperation_CannotImportGlobalFromDifferentModule" xml:space="preserve"> - <value>Unable to import a global method or field from a different module.</value> - </data> - <data name="InvalidOperation_CannotOverrideSetWithoutRevert" xml:space="preserve"> - <value>Must override both HostExecutionContextManager.SetHostExecutionContext and HostExecutionContextManager.Revert.</value> - </data> - <data name="InvalidOperation_CannotRemoveFromStackOrQueue" xml:space="preserve"> - <value>Removal is an invalid operation for Stack or Queue.</value> - </data> - <data name="InvalidOperation_CannotRemoveLastFromEmptyCollection" xml:space="preserve"> - <value>Cannot remove the last element from an empty collection.</value> - </data> - <data name="InvalidOperation_CannotRestoreUnsupressedFlow" xml:space="preserve"> - <value>Cannot restore context flow when it is not suppressed.</value> - </data> - <data name="InvalidOperation_CannotSupressFlowMultipleTimes" xml:space="preserve"> - <value>Context flow is already suppressed.</value> - </data> - <data name="InvalidOperation_CannotUseAFCMultiple" xml:space="preserve"> - <value>AsyncFlowControl object can be used only once to call Undo().</value> - </data> - <data name="InvalidOperation_CannotUseAFCOtherThread" xml:space="preserve"> - <value>AsyncFlowControl object must be used on the thread where it was created.</value> - </data> - <data name="InvalidOperation_CannotUseSwitcherOtherThread" xml:space="preserve"> - <value>Undo operation must be performed on the thread where the corresponding context was Set.</value> - </data> - <data name="InvalidOperation_CantCancelCtrlBreak" xml:space="preserve"> - <value>Applications may not prevent control-break from terminating their process.</value> - </data> - <data name="InvalidOperation_CantInstantiateAbstractClass" xml:space="preserve"> - <value>Instances of abstract classes cannot be created.</value> - </data> - <data name="InvalidOperation_CantInstantiateFunctionPointer" xml:space="preserve"> - <value>Instances of function pointers cannot be created.</value> - </data> - <data name="InvalidOperation_CantSaveTransientAssembly" xml:space="preserve"> - <value>Cannot save a transient assembly.</value> - </data> - <data name="InvalidOperation_ClaimCannotBeRemoved" xml:space="preserve"> - <value>The Claim '{0}' was not able to be removed. It is either not part of this Identity or it is a claim that is owned by the Principal that contains this Identity. For example, the Principal will own the claim when creating a GenericPrincipal with roles. The roles will be exposed through the Identity that is passed in the constructor, but not actually owned by the Identity. Similar logic exists for a RolePrincipal.</value> - </data> - <data name="InvalidOperation_CollectionBackingDictionaryTooLarge" xml:space="preserve"> - <value>The collection backing this Dictionary contains too many elements.</value> - </data> - <data name="InvalidOperation_CollectionBackingListTooLarge" xml:space="preserve"> - <value>The collection backing this List contains too many elements.</value> - </data> - <data name="InvalidOperation_CollectionCorrupted" xml:space="preserve"> - <value>A prior operation on this collection was interrupted by an exception. Collection's state is no longer trusted.</value> - </data> - <data name="InvalidOperation_ComputerName" xml:space="preserve"> - <value>Computer name could not be obtained.</value> - </data> - <data name="InvalidOperation_ConsoleKeyAvailableOnFile" xml:space="preserve"> - <value>Cannot see if a key has been pressed when either application does not have a console or when console input has been redirected from a file. Try Console.In.Peek.</value> - </data> - <data name="InvalidOperation_ConsoleReadKeyOnFile" xml:space="preserve"> - <value>Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read.</value> - </data> - <data name="InvalidOperation_ConstructorNotAllowedOnInterface" xml:space="preserve"> - <value>Interface cannot have constructors.</value> - </data> - <data name="InvalidOperation_ContextAlreadyFrozen" xml:space="preserve"> - <value>Context is already frozen.</value> - </data> - <data name="InvalidOperation_CriticalTransparentAreMutuallyExclusive" xml:space="preserve"> - <value>SecurityTransparent and SecurityCritical attributes cannot be applied to the assembly scope at the same time.</value> - </data> - <data name="InvalidOperation_DateTimeParsing" xml:space="preserve"> - <value>Internal Error in DateTime and Calendar operations.</value> - </data> - <data name="InvalidOperation_DebuggerLaunchFailed" xml:space="preserve"> - <value>Debugger unable to launch.</value> - </data> - <data name="InvalidOperation_DefaultConstructorDefineBody" xml:space="preserve"> - <value>The method body of the default constructor cannot be changed.</value> - </data> - <data name="InvalidOperation_DefaultConstructorILGen" xml:space="preserve"> - <value>Unable to access ILGenerator on a constructor created with DefineDefaultConstructor.</value> - </data> - <data name="InvalidOperation_DuplicatePropertyName" xml:space="preserve"> - <value>Another property by this name already exists.</value> - </data> - <data name="InvalidOperation_EmptyQueue" xml:space="preserve"> - <value>Queue empty.</value> - </data> - <data name="InvalidOperation_EmptyStack" xml:space="preserve"> - <value>Stack empty.</value> - </data> - <data name="InvalidOperation_EndInvokeCalledMultiple" xml:space="preserve"> - <value>EndInvoke can only be called once for each asynchronous operation.</value> - </data> - <data name="InvalidOperation_EndReadCalledMultiple" xml:space="preserve"> - <value>EndRead can only be called once for each asynchronous operation.</value> - </data> - <data name="InvalidOperation_EndWriteCalledMultiple" xml:space="preserve"> - <value>EndWrite can only be called once for each asynchronous operation.</value> - </data> - <data name="InvalidOperation_EntryMethodNotDefinedInAssembly" xml:space="preserve"> - <value>Entry method is not defined in the same assembly.</value> - </data> - <data name="InvalidOperation_EnumEnded" xml:space="preserve"> - <value>Enumeration already finished.</value> - </data> - <data name="InvalidOperation_EnumFailedVersion" xml:space="preserve"> - <value>Collection was modified; enumeration operation may not execute.</value> - </data> - <data name="InvalidOperation_EnumNotStarted" xml:space="preserve"> - <value>Enumeration has not started. Call MoveNext.</value> - </data> - <data name="InvalidOperation_EnumOpCantHappen" xml:space="preserve"> - <value>Enumeration has either not started or has already finished.</value> - </data> - <data name="InvalidOperation_EventInfoNotAvailable" xml:space="preserve"> - <value>This API does not support EventInfo tokens.</value> - </data> - <data name="InvalidOperation_EventTokenTableRequiresDelegate" xml:space="preserve"> - <value>Type '{0}' is not a delegate type. EventTokenTable may only be used with delegate types.</value> - </data> - <data name="InvalidOperation_ExceptionStateCrossAppDomain" xml:space="preserve"> - <value>Thread.ExceptionState cannot access an ExceptionState from a different AppDomain.</value> - </data> - <data name="InvalidOperation_GenericParametersAlreadySet" xml:space="preserve"> - <value>The generic parameters are already defined on this MethodBuilder.</value> - </data> - <data name="InvalidOperation_GetVersion" xml:space="preserve"> - <value>OSVersion's call to GetVersionEx failed.</value> - </data> - <data name="InvalidOperation_GlobalsHaveBeenCreated" xml:space="preserve"> - <value>Type definition of the global function has been completed.</value> - </data> - <data name="InvalidOperation_HandleIsNotInitialized" xml:space="preserve"> - <value>Handle is not initialized.</value> - </data> - <data name="InvalidOperation_HandleIsNotPinned" xml:space="preserve"> - <value>Handle is not pinned.</value> - </data> - <data name="InvalidOperation_HashInsertFailed" xml:space="preserve"> - <value>Hashtable insert failed. Load factor too high. The most common cause is multiple threads writing to the Hashtable simultaneously.</value> - </data> - <data name="InvalidOperation_HostModifiedSecurityState" xml:space="preserve"> - <value>The security state of an AppDomain was modified by an AppDomainManager configured with the NoSecurityChanges flag.</value> - </data> - <data name="InvalidOperation_IComparerFailed" xml:space="preserve"> - <value>Failed to compare two elements in the array.</value> - </data> - <data name="InvalidOperation_InternalState" xml:space="preserve"> - <value>Invalid internal state.</value> - </data> - <data name="InvalidOperation_InvalidComRegFunctionSig" xml:space="preserve"> - <value>COM register function must have a System.Type parameter and a void return type.</value> - </data> - <data name="InvalidOperation_InvalidComUnRegFunctionSig" xml:space="preserve"> - <value>COM unregister function must have a System.Type parameter and a void return type.</value> - </data> - <data name="InvalidOperation_MetaDataError" xml:space="preserve"> - <value>Metadata operation failed.</value> - </data> - <data name="InvalidOperation_Method" xml:space="preserve"> - <value>This method is not supported by the current object.</value> - </data> - <data name="InvalidOperation_MethodBaked" xml:space="preserve"> - <value>Type definition of the method is complete.</value> - </data> - <data name="InvalidOperation_MethodBuilderBaked" xml:space="preserve"> - <value>The signature of the MethodBuilder can no longer be modified because an operation on the MethodBuilder caused the methodDef token to be created. For example, a call to SetCustomAttribute requires the methodDef token to emit the CustomAttribute token.</value> - </data> - <data name="InvalidOperation_MethodHasBody" xml:space="preserve"> - <value>Method already has a body.</value> - </data> - <data name="InvalidOperation_MismatchedAsyncResult" xml:space="preserve"> - <value>The IAsyncResult object provided does not match this delegate.</value> - </data> - <data name="InvalidOperation_ModificationOfNonCanonicalAcl" xml:space="preserve"> - <value>This access control list is not in canonical form and therefore cannot be modified.</value> - </data> - <data name="InvalidOperation_ModifyRONumFmtInfo" xml:space="preserve"> - <value>Unable to modify a read-only NumberFormatInfo object.</value> - </data> - <data name="InvalidOperation_ModuleHasBeenSaved" xml:space="preserve"> - <value>Module '{0}' has been saved.</value> - </data> - <data name="InvalidOperation_MultipleComRegFunctions" xml:space="preserve"> - <value>Type '{0}' has more than one COM registration function.</value> - </data> - <data name="InvalidOperation_MultipleComUnRegFunctions" xml:space="preserve"> - <value>Type '{0}' has more than one COM unregistration function.</value> - </data> - <data name="InvalidOperation_MustBeSameThread" xml:space="preserve"> - <value>This operation must take place on the same thread on which the object was created.</value> - </data> - <data name="InvalidOperation_MustCallInitialize" xml:space="preserve"> - <value>You must call Initialize on this object instance before using it.</value> - </data> - <data name="InvalidOperation_MustLockForReadOrWrite" xml:space="preserve"> - <value>Object must be locked for read or write.</value> - </data> - <data name="InvalidOperation_MustLockForWrite" xml:space="preserve"> - <value>Object must be locked for read.</value> - </data> - <data name="InvalidOperation_MustRevertPrivilege" xml:space="preserve"> - <value>Must revert the privilege prior to attempting this operation.</value> - </data> - <data name="InvalidOperation_NativeOverlappedReused" xml:space="preserve"> - <value>NativeOverlapped cannot be reused for multiple operations.</value> - </data> - <data name="InvalidOperation_NoAsmCodeBase" xml:space="preserve"> - <value>Assembly does not have a code base.</value> - </data> - <data name="InvalidOperation_NoAsmName" xml:space="preserve"> - <value>Assembly does not have an assembly name. In order to be registered for use by COM, an assembly must have a valid assembly name.</value> - </data> - <data name="InvalidOperation_NoMultiModuleAssembly" xml:space="preserve"> - <value>You cannot have more than one dynamic module in each dynamic assembly in this version of the runtime.</value> - </data> - <data name="InvalidOperation_NonStaticComRegFunction" xml:space="preserve"> - <value>COM register function must be static.</value> - </data> - <data name="InvalidOperation_NonStaticComUnRegFunction" xml:space="preserve"> - <value>COM unregister function must be static.</value> - </data> - <data name="InvalidOperation_NoPublicAddMethod" xml:space="preserve"> - <value>Cannot add the event handler since no public add method exists for the event.</value> - </data> - <data name="InvalidOperation_NoPublicRemoveMethod" xml:space="preserve"> - <value>Cannot remove the event handler since no public remove method exists for the event.</value> - </data> - <data name="InvalidOperation_NoSecurityDescriptor" xml:space="preserve"> - <value>The object does not contain a security descriptor.</value> - </data> - <data name="InvalidOperation_NotADebugModule" xml:space="preserve"> - <value>Not a debug ModuleBuilder.</value> - </data> - <data name="InvalidOperation_NotAllowedInDynamicMethod" xml:space="preserve"> - <value>The requested operation is invalid for DynamicMethod.</value> - </data> - <data name="InvalidOperation_NotAllowedInReflectionOnly" xml:space="preserve"> - <value>The requested operation is invalid in the ReflectionOnly context.</value> - </data> - <data name="InvalidOperation_NotAVarArgCallingConvention" xml:space="preserve"> - <value>Calling convention must be VarArgs.</value> - </data> - <data name="InvalidOperation_NotCurrentDomain" xml:space="preserve"> - <value>You can only define a dynamic assembly on the current AppDomain.</value> - </data> - <data name="InvalidOperation_NotGenericType" xml:space="preserve"> - <value>This operation is only valid on generic types.</value> - </data> - <data name="InvalidOperation_NotNewCaptureContext" xml:space="preserve"> - <value>Cannot apply a context that has been marshaled across AppDomains, that was not acquired through a Capture operation or that has already been the argument to a Set call.</value> - </data> - <data name="InvalidOperation_NotSupportedOnWinRTEvent" xml:space="preserve"> - <value>Adding or removing event handlers dynamically is not supported on WinRT events.</value> - </data> - <data name="InvalidOperation_NotWithConcurrentGC" xml:space="preserve"> - <value>This API is not available when the concurrent GC is enabled.</value> - </data> - <data name="InvalidOperation_NoUnderlyingTypeOnEnum" xml:space="preserve"> - <value>Underlying type information on enumeration is not specified.</value> - </data> - <data name="InvalidOperation_NoValue" xml:space="preserve"> - <value>Nullable object must have a value.</value> - </data> - <data name="InvalidOperation_NullArray" xml:space="preserve"> - <value>The underlying array is null.</value> - </data> - <data name="InvalidOperation_NullContext" xml:space="preserve"> - <value>Cannot call Set on a null context</value> - </data> - <data name="InvalidOperation_NullModuleHandle" xml:space="preserve"> - <value>The requested operation is invalid when called on a null ModuleHandle.</value> - </data> - <data name="InvalidOperation_OnlyValidForDS" xml:space="preserve"> - <value>Adding ACEs with Object Flags and Object GUIDs is only valid for directory-object ACLs.</value> - </data> - <data name="InvalidOperation_OpenLocalVariableScope" xml:space="preserve"> - <value>Local variable scope was not properly closed.</value> - </data> - <data name="InvalidOperation_Overlapped_Pack" xml:space="preserve"> - <value>Cannot pack a packed Overlapped again.</value> - </data> - <data name="InvalidOperation_PIAMustBeStrongNamed" xml:space="preserve"> - <value>Primary interop assemblies must be strongly named.</value> - </data> - <data name="InvalidOperation_PropertyInfoNotAvailable" xml:space="preserve"> - <value>This API does not support PropertyInfo tokens.</value> - </data> - <data name="InvalidOperation_ReadOnly" xml:space="preserve"> - <value>Instance is read-only.</value> - </data> - <data name="InvalidOperation_RegRemoveSubKey" xml:space="preserve"> - <value>Registry key has subkeys and recursive removes are not supported by this method.</value> - </data> - <data name="InvalidOperation_ResMgrBadResSet_Type" xml:space="preserve"> - <value>'{0}': ResourceSet derived classes must provide a constructor that takes a String file name and a constructor that takes a Stream.</value> - </data> - <data name="InvalidOperation_ResourceNotStream_Name" xml:space="preserve"> - <value>Resource '{0}' was not a Stream - call GetObject instead.</value> - </data> - <data name="InvalidOperation_ResourceNotString_Name" xml:space="preserve"> - <value>Resource '{0}' was not a String - call GetObject instead.</value> - </data> - <data name="InvalidOperation_ResourceNotString_Type" xml:space="preserve"> - <value>Resource was of type '{0}' instead of String - call GetObject instead.</value> - </data> - <data name="InvalidOperation_ResourceWriterSaved" xml:space="preserve"> - <value>The resource writer has already been closed and cannot be edited.</value> - </data> - <data name="InvalidOperation_SetData" xml:space="preserve"> - <value>An additional permission should not be supplied for setting loader information.</value> - </data> - <data name="InvalidOperation_SetData_OnlyLocationURI" xml:space="preserve"> - <value>SetData cannot be used to set the value for '{0}'.</value> - </data> - <data name="InvalidOperation_SetData_OnlyOnce" xml:space="preserve"> - <value>SetData can only be used to set the value of a given name once.</value> - </data> - <data name="InvalidOperation_SetVolumeLabelFailed" xml:space="preserve"> - <value>Volume labels can only be set for writable local volumes.</value> - </data> - <data name="InvalidOperation_ShouldNotHaveMethodBody" xml:space="preserve"> - <value>Method body should not exist.</value> - </data> - <data name="InvalidOperation_SlotHasBeenFreed" xml:space="preserve"> - <value>LocalDataStoreSlot storage has been freed.</value> - </data> - <data name="InvalidOperation_StrongNameKeyPairRequired" xml:space="preserve"> - <value>A strong name key pair is required to emit a strong-named dynamic assembly.</value> - </data> - <data name="InvalidOperation_SwitcherCtxMismatch" xml:space="preserve"> - <value>The Undo operation encountered a context that is different from what was applied in the corresponding Set operation. The possible cause is that a context was Set on the thread and not reverted(undone).</value> - </data> - <data name="InvalidOperation_ThreadAPIsNotSupported" xml:space="preserve"> - <value>Use CompressedStack.(Capture/Run) or ExecutionContext.(Capture/Run) APIs instead.</value> - </data> - <data name="InvalidOperation_ThreadWrongThreadStart" xml:space="preserve"> - <value>The thread was created with a ThreadStart delegate that does not accept a parameter.</value> - </data> - <data name="InvalidOperation_TimeoutsNotSupported" xml:space="preserve"> - <value>Timeouts are not supported on this stream.</value> - </data> - <data name="InvalidOperation_TypeCannotBeBoxed" xml:space="preserve"> - <value>The given type cannot be boxed.</value> - </data> - <data name="InvalidOperation_TypeHasBeenCreated" xml:space="preserve"> - <value>Unable to change after type has been created.</value> - </data> - <data name="InvalidOperation_TypeNotCreated" xml:space="preserve"> - <value>Type has not been created.</value> - </data> - <data name="InvalidOperation_UnderlyingArrayListChanged" xml:space="preserve"> - <value>This range in the underlying list is invalid. A possible cause is that elements were removed.</value> - </data> - <data name="InvalidOperation_UnexpectedWin32Error" xml:space="preserve"> - <value>Unexpected error when calling an operating system function. The returned error code is 0x{0:x}.</value> - </data> - <data name="InvalidOperation_UnknownEnumType" xml:space="preserve"> - <value>Unknown enum type.</value> - </data> - <data name="InvalidOperation_UserDomainName" xml:space="preserve"> - <value>UserDomainName native call failed.</value> - </data> - <data name="InvalidOperation_WaitOnTransparentProxy" xml:space="preserve"> - <value>Cannot wait on a transparent proxy.</value> - </data> - <data name="InvalidOperation_WithoutARM" xml:space="preserve"> - <value>This API is not available when AppDomain Resource Monitoring is not turned on.</value> - </data> - <data name="InvalidOperation_WriteOnce" xml:space="preserve"> - <value>This property has already been set and cannot be modified.</value> - </data> - <data name="InvalidOperation_WrongAsyncResultOrEndCalledMultiple" xml:space="preserve"> - <value>Either the IAsyncResult object did not come from the corresponding async method on this type, or the End method was called multiple times with the same IAsyncResult.</value> - </data> - <data name="InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple" xml:space="preserve"> - <value>Either the IAsyncResult object did not come from the corresponding async method on this type, or EndRead was called multiple times with the same IAsyncResult.</value> - </data> - <data name="InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple" xml:space="preserve"> - <value>Either the IAsyncResult object did not come from the corresponding async method on this type, or EndWrite was called multiple times with the same IAsyncResult.</value> - </data> - <data name="InvalidOperationException_ActorGraphCircular" xml:space="preserve"> - <value>Actor cannot be set so that circular directed graph will exist chaining the subjects together.</value> - </data> - <data name="InvalidProgram_Default" xml:space="preserve"> - <value>Common Language Runtime detected an invalid program.</value> - </data> - <data name="InvalidTimeZone_InvalidFileData" xml:space="preserve"> - <value>The time zone ID '{0}' was found on the local computer, but the file at '{1}' was corrupt.</value> - </data> - <data name="InvalidTimeZone_InvalidRegistryData" xml:space="preserve"> - <value>The time zone ID '{0}' was found on the local computer, but the registry information was corrupt.</value> - </data> - <data name="InvalidTimeZone_InvalidWin32APIData" xml:space="preserve"> - <value>The Local time zone was found on the local computer, but the data was corrupt.</value> - </data> - <data name="InvalidTimeZone_JulianDayNotSupported" xml:space="preserve"> - <value>Julian dates in POSIX strings are unsupported.</value> - </data> - <data name="InvalidTimeZone_NoTTInfoStructures" xml:space="preserve"> - <value>There are no ttinfo structures in the tzfile. At least one ttinfo structure is required in order to construct a TimeZoneInfo object.</value> - </data> - <data name="InvalidTimeZone_UnparseablePosixMDateString" xml:space="preserve"> - <value>'{0}' is not a valid POSIX-TZ-environment-variable MDate rule. A valid rule has the format 'Mm.w.d'.</value> - </data> - <data name="InvariantFailed" xml:space="preserve"> - <value>Invariant failed.</value> - </data> - <data name="InvariantFailed_Cnd" xml:space="preserve"> - <value>Invariant failed: {0}</value> - </data> - <data name="IO_DriveNotFound_Drive" xml:space="preserve"> - <value>Could not find the drive '{0}'. The drive might not be ready or might not be mapped.</value> - </data> - <data name="IO_EOF_ReadBeyondEOF" xml:space="preserve"> - <value>Unable to read beyond the end of the stream.</value> - </data> - <data name="IO_FileLoad" xml:space="preserve"> - <value>Could not load the specified file.</value> - </data> - <data name="IO_FileName_Name" xml:space="preserve"> - <value>File name: '{0}'</value> - </data> - <data name="IO_FileNotFound" xml:space="preserve"> - <value>Unable to find the specified file.</value> - </data> - <data name="IO_FileNotFound_FileName" xml:space="preserve"> - <value>Could not find file '{0}'.</value> - </data> - <data name="IO_AlreadyExists_Name" xml:space="preserve"> - <value>Cannot create "{0}" because a file or directory with the same name already exists.</value> - </data> - <data name="IO_BindHandleFailed" xml:space="preserve"> - <value>BindHandle for ThreadPool failed on this handle.</value> - </data> - <data name="IO_CannotCreateDirectory" xml:space="preserve"> - <value>The specified directory '{0}' cannot be created.</value> - </data> - <data name="IO_FileExists_Name" xml:space="preserve"> - <value>The file '{0}' already exists.</value> - </data> - <data name="IO_FileStreamHandlePosition" xml:space="preserve"> - <value>The OS handle's position is not what FileStream expected. Do not use a handle simultaneously in one FileStream and in Win32 code or another FileStream. This may cause data loss.</value> - </data> - <data name="IO_FileTooLong2GB" xml:space="preserve"> - <value>The file is too long. This operation is currently limited to supporting files less than 2 gigabytes in size.</value> - </data> - <data name="IO_FileTooLongOrHandleNotSync" xml:space="preserve"> - <value>IO operation will not work. Most likely the file will become too long or the handle was not opened to support synchronous IO operations.</value> - </data> - <data name="IO_FixedCapacity" xml:space="preserve"> - <value>Unable to expand length of this stream beyond its capacity.</value> - </data> - <data name="IO_InvalidStringLen_Len" xml:space="preserve"> - <value>BinaryReader encountered an invalid string length of {0} characters.</value> - </data> - <data name="IO_NoConsole" xml:space="preserve"> - <value>There is no console.</value> - </data> - <data name="IO_NoPermissionToDirectoryName" xml:space="preserve"> - <value><Path discovery permission to the specified directory was denied.></value> - </data> - <data name="IO_SeekAppendOverwrite" xml:space="preserve"> - <value>Unable seek backward to overwrite data that previously existed in a file opened in Append mode.</value> - </data> - <data name="IO_SeekBeforeBegin" xml:space="preserve"> - <value>An attempt was made to move the position before the beginning of the stream.</value> - </data> - <data name="IO_SetLengthAppendTruncate" xml:space="preserve"> - <value>Unable to truncate data that previously existed in a file opened in Append mode.</value> - </data> - <data name="IO_SharingViolation_File" xml:space="preserve"> - <value>The process cannot access the file '{0}' because it is being used by another process.</value> - </data> - <data name="IO_SharingViolation_NoFileName" xml:space="preserve"> - <value>The process cannot access the file because it is being used by another process.</value> - </data> - <data name="IO_SourceDestMustBeDifferent" xml:space="preserve"> - <value>Source and destination path must be different.</value> - </data> - <data name="IO_SourceDestMustHaveSameRoot" xml:space="preserve"> - <value>Source and destination path must have identical roots. Move will not work across volumes.</value> - </data> - <data name="IO_StreamTooLong" xml:space="preserve"> - <value>Stream was too long.</value> - </data> - <data name="IO_PathNotFound_NoPathName" xml:space="preserve"> - <value>Could not find a part of the path.</value> - </data> - <data name="IO_PathNotFound_Path" xml:space="preserve"> - <value>Could not find a part of the path '{0}'.</value> - </data> - <data name="IO_PathTooLong" xml:space="preserve"> - <value>The specified file name or path is too long, or a component of the specified path is too long.</value> - </data> - <data name="IO_StreamWriterBufferedDataLost" xml:space="preserve"> - <value>A StreamWriter was not closed and all buffered data within that StreamWriter was not flushed to the underlying stream. (This was detected when the StreamWriter was finalized with data in its buffer.) A portion of the data was lost. Consider one of calling Close(), Flush(), setting the StreamWriter's AutoFlush property to true, or allocating the StreamWriter with a "using" statement. Stream type: {0}\r\nFile name: {1}\r\nAllocated from:\r\n {2}</value> - </data> - <data name="IO_StreamWriterBufferedDataLostCaptureAllocatedFromCallstackNotEnabled" xml:space="preserve"> - <value>callstack information is not captured by default for performance reasons. Please enable captureAllocatedCallStack config switch for streamWriterBufferedDataLost MDA (refer to MSDN MDA documentation for how to do this).</value> - </data> - <data name="IO_UnknownFileName" xml:space="preserve"> - <value>[Unknown]</value> - </data> - <data name="Lazy_CreateValue_NoParameterlessCtorForT" xml:space="preserve"> - <value>The lazily-initialized type does not have a public, parameterless constructor.</value> - </data> - <data name="Lazy_ctor_deserialization_ValueInvalid" xml:space="preserve"> - <value>The Value cannot be null.</value> - </data> - <data name="Lazy_ctor_InfoNull" xml:space="preserve"> - <value>The info argument is null.</value> - </data> - <data name="Lazy_ctor_ModeInvalid" xml:space="preserve"> - <value>The mode argument specifies an invalid value.</value> - </data> - <data name="Lazy_ctor_ValueSelectorNull" xml:space="preserve"> - <value>The valueSelector argument is null.</value> - </data> - <data name="Lazy_StaticInit_InvalidOperation" xml:space="preserve"> - <value>ValueFactory returned null.</value> - </data> - <data name="Lazy_ToString_ValueNotCreated" xml:space="preserve"> - <value>Value is not created.</value> - </data> - <data name="Lazy_Value_RecursiveCallsToValue" xml:space="preserve"> - <value>ValueFactory attempted to access the Value property of this instance.</value> - </data> - <data name="Loader_ContextPolicies" xml:space="preserve"> - <value>Context Policies:</value> - </data> - <data name="Loader_InvalidPath" xml:space="preserve"> - <value>Relative path must be a string that contains the substring, "..", or does not contain a root directory.</value> - </data> - <data name="Loader_Name" xml:space="preserve"> - <value>Name:</value> - </data> - <data name="Loader_NoContextPolicies" xml:space="preserve"> - <value>There are no context policies.</value> - </data> - <data name="LoadOfFxAssemblyNotSupported_AppX" xml:space="preserve"> - <value>{0} of .NET Framework assemblies is not supported in AppX.</value> - </data> - <data name="ManualResetEventSlim_ctor_SpinCountOutOfRange" xml:space="preserve"> - <value>The spinCount argument must be in the range 0 to {0}, inclusive.</value> - </data> - <data name="ManualResetEventSlim_ctor_TooManyWaiters" xml:space="preserve"> - <value>There are too many threads currently waiting on the event. A maximum of {0} waiting threads are supported.</value> - </data> - <data name="ManualResetEventSlim_Disposed" xml:space="preserve"> - <value>The event has been disposed.</value> - </data> - <data name="Marshaler_StringTooLong" xml:space="preserve"> - <value>Marshaler restriction: Excessively long string.</value> - </data> - <data name="MissingConstructor_Name" xml:space="preserve"> - <value>Constructor on type '{0}' not found.</value> - </data> - <data name="MissingField" xml:space="preserve"> - <value>Field not found.</value> - </data> - <data name="MissingField_Name" xml:space="preserve"> - <value>Field '{0}' not found.</value> - </data> - <data name="MissingManifestResource_LooselyLinked" xml:space="preserve"> - <value>Could not find a manifest resource entry called "{0}" in assembly "{1}". Please check spelling, capitalization, and build rules to ensure "{0}" is being linked into the assembly.</value> - </data> - <data name="MissingManifestResource_MultipleBlobs" xml:space="preserve"> - <value>A case-insensitive lookup for resource file "{0}" in assembly "{1}" found multiple entries. Remove the duplicates or specify the exact case.</value> - </data> - <data name="MissingManifestResource_NoNeutralAsm" xml:space="preserve"> - <value>Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "{0}" was correctly embedded or linked into assembly "{1}" at compile time, or that all the satellite assemblies required are loadable and fully signed.</value> - </data> - <data name="MissingManifestResource_NoNeutralDisk" xml:space="preserve"> - <value>Could not find any resources appropriate for the specified culture (or the neutral culture) on disk.</value> - </data> - <data name="MissingManifestResource_NoPRIresources" xml:space="preserve"> - <value>Unable to open Package Resource Index.</value> - </data> - <data name="MissingManifestResource_ResWFileNotLoaded" xml:space="preserve"> - <value>Unable to load resources for resource file "{0}" in package "{1}".</value> - </data> - <data name="MissingMember" xml:space="preserve"> - <value>Member not found.</value> - </data> - <data name="MissingMember_Name" xml:space="preserve"> - <value>Member '{0}' not found.</value> - </data> - <data name="MissingMemberNestErr" xml:space="preserve"> - <value>TypedReference can only be made on nested value Types.</value> - </data> - <data name="MissingMemberTypeRef" xml:space="preserve"> - <value>FieldInfo does not match the target Type.</value> - </data> - <data name="MissingMethod_Name" xml:space="preserve"> - <value>Method '{0}' not found.</value> - </data> - <data name="MissingModule" xml:space="preserve"> - <value>Module '{0}' not found.</value> - </data> - <data name="MissingSatelliteAssembly_Culture_Name" xml:space="preserve"> - <value>The satellite assembly named "{1}" for fallback culture "{0}" either could not be found or could not be loaded. This is generally a setup problem. Please consider reinstalling or repairing the application.</value> - </data> - <data name="MissingSatelliteAssembly_Default" xml:space="preserve"> - <value>Resource lookup fell back to the ultimate fallback resources in a satellite assembly, but that satellite either was not found or could not be loaded. Please consider reinstalling or repairing the application.</value> - </data> - <data name="MissingType" xml:space="preserve"> - <value>Type '{0}' not found.</value> - </data> - <data name="Multicast_Combine" xml:space="preserve"> - <value>Delegates that are not of type MulticastDelegate may not be combined.</value> - </data> - <data name="MustUseCCRewrite" xml:space="preserve"> - <value>An assembly (probably "{1}") must be rewritten using the code contracts binary rewriter (CCRewrite) because it is calling Contract.{0} and the CONTRACTS_FULL symbol is defined. Remove any explicit definitions of the CONTRACTS_FULL symbol from your project and rebuild. CCRewrite can be downloaded from http://go.microsoft.com/fwlink/?LinkID=169180. \r\nAfter the rewriter is installed, it can be enabled in Visual Studio from the project's Properties page on the Code Contracts pane. Ensure that "Perform Runtime Contract Checking" is enabled, which will define CONTRACTS_FULL.</value> - </data> - <data name="NoDebugResources" xml:space="preserve"> - <value>[{0}]\r\nArguments: {1}\r\nDebugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663AndVersion={2}AndFile={3}AndKey={4}</value> - </data> - <data name="NotImplemented_ResourcesLongerThanInt64Max" xml:space="preserve"> - <value>Resource files longer than 2^63 bytes are not currently implemented.</value> - </data> - <data name="NotSupported_AbstractNonCLS" xml:space="preserve"> - <value>This non-CLS method is not implemented.</value> - </data> - <data name="NotSupported_ActivAttr" xml:space="preserve"> - <value>Activation Attributes are not supported.</value> - </data> - <data name="NotSupported_ActivAttrOnNonMBR" xml:space="preserve"> - <value>Activation Attributes are not supported for types not deriving from MarshalByRefObject.</value> - </data> - <data name="NotSupported_ActivForCom" xml:space="preserve"> - <value>Activation Attributes not supported for COM Objects.</value> - </data> - <data name="NotSupported_AmbiguousIdentity" xml:space="preserve"> - <value>The operation is ambiguous because the permission represents multiple identities.</value> - </data> - <data name="NotSupported_AppX" xml:space="preserve"> - <value>{0} is not supported in AppX.</value> - </data> - <data name="NotSupported_AssemblyLoadCodeBase" xml:space="preserve"> - <value>Assembly.Load with a Codebase is not supported.</value> - </data> - <data name="NotSupported_AssemblyLoadFromHash" xml:space="preserve"> - <value>Assembly.LoadFrom with hashValue is not supported.</value> - </data> - <data name="NotSupported_ByRefLike" xml:space="preserve"> - <value>Cannot create boxed ByRef-like values.</value> - </data> - <data name="NotSupported_ByRefLikeArray" xml:space="preserve"> - <value>Cannot create arrays of ByRef-like values.</value> - </data> - <data name="NotSupported_ByRefReturn" xml:space="preserve"> - <value>ByRef return value not supported in reflection invocation.</value> - </data> - <data name="NotSupported_CallToVarArg" xml:space="preserve"> - <value>Vararg calling convention not supported.</value> - </data> - <data name="NotSupported_CannotCallEqualsOnSpan" xml:space="preserve"> - <value>Equals() on Span and ReadOnlySpan is not supported. Use operator== instead.</value> - </data> - <data name="NotSupported_CannotCallGetHashCodeOnSpan" xml:space="preserve"> - <value>GetHashCode() on Span and ReadOnlySpan is not supported.</value> - </data> - <data name="NotSupported_CannotSaveModuleIndividually" xml:space="preserve"> - <value>Unable to save a ModuleBuilder if it was created underneath an AssemblyBuilder. Call Save on the AssemblyBuilder instead.</value> - </data> - <data name="NotSupported_CannotWriteToBufferedStreamIfReadBufferCannotBeFlushed" xml:space="preserve"> - <value>Cannot write to a BufferedStream while the read buffer is not empty if the underlying stream is not seekable. Ensure that the stream underlying this BufferedStream can seek or avoid interleaving read and write operations on this BufferedStream.</value> - </data> - <data name="NotSupported_ChangeType" xml:space="preserve"> - <value>ChangeType operation is not supported.</value> - </data> - <data name="NotSupported_CodePage50229" xml:space="preserve"> - <value>The ISO-2022-CN Encoding (Code page 50229) is not supported.</value> - </data> - <data name="NotSupported_CollectibleAssemblyResolve" xml:space="preserve"> - <value>Resolving to a collectible assembly is not supported.</value> - </data> - <data name="NotSupported_CollectibleBoundNonCollectible" xml:space="preserve"> - <value>A non-collectible assembly may not reference a collectible assembly.</value> - </data> - <data name="NotSupported_CollectibleCOM" xml:space="preserve"> - <value>COM Interop is not supported for collectible types.</value> - </data> - <data name="NotSupported_CollectibleDelegateMarshal" xml:space="preserve"> - <value>Delegate marshaling for types within collectible assemblies is not supported.</value> - </data> - <data name="NotSupported_Constructor" xml:space="preserve"> - <value>Object cannot be created through this constructor.</value> - </data> - <data name="NotSupported_CreateInstanceWithTypeBuilder" xml:space="preserve"> - <value>CreateInstance cannot be used with an object of type TypeBuilder.</value> - </data> - <data name="NotSupported_DBNullSerial" xml:space="preserve"> - <value>Only one DBNull instance may exist, and calls to DBNull deserialization methods are not allowed.</value> - </data> - <data name="NotSupported_DeclarativeUnion" xml:space="preserve"> - <value>Declarative unionizing of these permissions is not supported.</value> - </data> - <data name="NotSupported_DeclSecVarArg" xml:space="preserve"> - <value>Assert, Deny, and PermitOnly are not supported on methods with a Vararg calling convention.</value> - </data> - <data name="NotSupported_DelegateCreationFromPT" xml:space="preserve"> - <value>Application code cannot use Activator.CreateInstance to create types that derive from System.Delegate. Delegate.CreateDelegate can be used instead.</value> - </data> - <data name="NotSupported_DelegateMarshalToWrongDomain" xml:space="preserve"> - <value>Delegates cannot be marshaled from native code into a domain other than their home domain.</value> - </data> - <data name="NotSupported_DelegateSerHolderSerial" xml:space="preserve"> - <value>DelegateSerializationHolder objects are designed to represent a delegate during serialization and are not serializable themselves.</value> - </data> - <data name="NotSupported_DynamicAssembly" xml:space="preserve"> - <value>The invoked member is not supported in a dynamic assembly.</value> - </data> - <data name="NotSupported_DynamicAssemblyNoRunAccess" xml:space="preserve"> - <value>Cannot execute code on a dynamic assembly without run access.</value> - </data> - <data name="NotSupported_DynamicMethodFlags" xml:space="preserve"> - <value>Wrong MethodAttributes or CallingConventions for DynamicMethod. Only public, static, standard supported</value> - </data> - <data name="NotSupported_DynamicModule" xml:space="preserve"> - <value>The invoked member is not supported in a dynamic module.</value> - </data> - <data name="NotSupported_EncryptionNeedsNTFS" xml:space="preserve"> - <value>File encryption support only works on NTFS partitions.</value> - </data> - <data name="NotSupported_FileStreamOnNonFiles" xml:space="preserve"> - <value>FileStream was asked to open a device that was not a file. For support for devices like 'com1:' or 'lpt1:', call CreateFile, then use the FileStream constructors that take an OS handle as an IntPtr.</value> - </data> - <data name="NotSupported_FixedSizeCollection" xml:space="preserve"> - <value>Collection was of a fixed size.</value> - </data> - <data name="NotSupported_GenericMethod" xml:space="preserve"> - <value>Generic methods with NativeCallableAttribute are not supported.</value> - </data> - <data name="NotSupported_GetMethod" xml:space="preserve"> - <value>The 'get' method is not supported on this property.</value> - </data> - <data name="NotSupported_GlobalFunctionNotBaked" xml:space="preserve"> - <value>The type definition of the global function is not completed.</value> - </data> - <data name="NotSupported_GlobalMethodSerialization" xml:space="preserve"> - <value>Serialization of global methods (including implicit serialization via the use of asynchronous delegates) is not supported.</value> - </data> - <data name="NotSupported_IDispInvokeDefaultMemberWithNamedArgs" xml:space="preserve"> - <value>Invoking default method with named arguments is not supported.</value> - </data> - <data name="NotSupported_IllegalOneByteBranch" xml:space="preserve"> - <value>Illegal one-byte branch at position: {0}. Requested branch was: {1}.</value> - </data> - <data name="NotSupported_InComparableType" xml:space="preserve"> - <value>A type must implement IComparable<T> or IComparable to support comparison.</value> - </data> - <data name="NotSupported_KeyCollectionSet" xml:space="preserve"> - <value>Mutating a key collection derived from a dictionary is not allowed.</value> - </data> - <data name="NotSupported_ManagedActivation" xml:space="preserve"> - <value>Cannot create uninitialized instances of types requiring managed activation.</value> - </data> - <data name="NotSupported_MaxValue" xml:space="preserve"> - <value>The arithmetic type '{0}' does not have a maximum value.</value> - </data> - <data name="NotSupported_MaxWaitHandles" xml:space="preserve"> - <value>The number of WaitHandles must be less than or equal to 64.</value> - </data> - <data name="NotSupported_MemStreamNotExpandable" xml:space="preserve"> - <value>Memory stream is not expandable.</value> - </data> - <data name="NotSupported_Method" xml:space="preserve"> - <value>Method is not supported.</value> - </data> - <data name="NotSupported_MinValue" xml:space="preserve"> - <value>The arithmetic type '{0}' does not have a minimum value.</value> - </data> - <data name="NotSupported_MustBeModuleBuilder" xml:space="preserve"> - <value>Module argument must be a ModuleBuilder.</value> - </data> - <data name="NotSupported_NativeCallableTarget" xml:space="preserve"> - <value>Methods with NativeCallableAttribute cannot be used as delegate target.</value> - </data> - <data name="NotSupported_NegativeInfinity" xml:space="preserve"> - <value>The arithmetic type '{0}' cannot represent negative infinity.</value> - </data> - <data name="NotSupported_NoCodepageData" xml:space="preserve"> - <value>No data is available for encoding {0}. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method.</value> - </data> - <data name="NotSupported_NonBlittableTypes" xml:space="preserve"> - <value>Non-blittable parameter types are not supported for NativeCallable methods.</value> - </data> - <data name="NotSupported_NonReflectedType" xml:space="preserve"> - <value>Not supported in a non-reflected type.</value> - </data> - <data name="NotSupported_NonStaticMethod" xml:space="preserve"> - <value>Non-static methods with NativeCallableAttribute are not supported.</value> - </data> - <data name="NotSupported_NonUrlAttrOnMBR" xml:space="preserve"> - <value>UrlAttribute is the only attribute supported for MarshalByRefObject.</value> - </data> - <data name="NotSupported_NoParentDefaultConstructor" xml:space="preserve"> - <value>Parent does not have a default constructor. The default constructor must be explicitly defined.</value> - </data> - <data name="NotSupported_NotAllTypesAreBaked" xml:space="preserve"> - <value>Type '{0}' was not completed.</value> - </data> - <data name="NotSupported_NotDynamicModule" xml:space="preserve"> - <value>The MethodRental.SwapMethodBody method can only be called to swap the method body of a method in a dynamic module.</value> - </data> - <data name="NotSupported_NoTypeInfo" xml:space="preserve"> - <value>Cannot resolve {0} to a TypeInfo object.</value> - </data> - <data name="NotSupported_NYI" xml:space="preserve"> - <value>This feature is not currently implemented.</value> - </data> - <data name="NotSupported_ObsoleteResourcesFile" xml:space="preserve"> - <value>Found an obsolete .resources file in assembly '{0}'. Rebuild that .resources file then rebuild that assembly.</value> - </data> - <data name="NotSupported_OleAutBadVarType" xml:space="preserve"> - <value>The given Variant type is not supported by this OleAut function.</value> - </data> - <data name="NotSupported_One" xml:space="preserve"> - <value>The arithmetic type '{0}' cannot represent the number one.</value> - </data> - <data name="NotSupported_OpenType" xml:space="preserve"> - <value>Cannot create arrays of open type.</value> - </data> - <data name="NotSupported_OutputStreamUsingTypeBuilder" xml:space="preserve"> - <value>Output streams do not support TypeBuilders.</value> - </data> - <data name="NotSupported_PIAInAppxProcess" xml:space="preserve"> - <value>A Primary Interop Assembly is not supported in AppX.</value> - </data> - <data name="NotSupported_PopulateData" xml:space="preserve"> - <value>This Surrogate does not support PopulateData().</value> - </data> - <data name="NotSupported_PositiveInfinity" xml:space="preserve"> - <value>The arithmetic type '{0}' cannot represent positive infinity.</value> - </data> - <data name="NotSupported_RangeCollection" xml:space="preserve"> - <value>The specified operation is not supported on Ranges.</value> - </data> - <data name="NotSupported_Reading" xml:space="preserve"> - <value>Accessor does not support reading.</value> - </data> - <data name="NotSupported_ReadOnlyCollection" xml:space="preserve"> - <value>Collection is read-only.</value> - </data> - <data name="NotSupported_ReflectionOnlyGetType" xml:space="preserve"> - <value>Type.ReflectionOnlyGetType is not supported.</value> - </data> - <data name="NotSupported_ReflectionOnlyLoad" xml:space="preserve"> - <value>Assembly.ReflectionOnlyLoad is not supported.</value> - </data> - <data name="NotSupported_ResourceObjectSerialization" xml:space="preserve"> - <value>Cannot read resources that depend on serialization.</value> - </data> - <data name="NotSupported_SecurityPermissionUnion" xml:space="preserve"> - <value>Union is not implemented.</value> - </data> - <data name="NotSupported_SetMethod" xml:space="preserve"> - <value>The 'set' method is not supported on this property.</value> - </data> - <data name="NotSupported_SignalAndWaitSTAThread" xml:space="preserve"> - <value>SignalAndWait on a STA thread is not supported.</value> - </data> - <data name="NotSupported_SortedListNestedWrite" xml:space="preserve"> - <value>This operation is not supported on SortedList nested types because they require modifying the original SortedList.</value> - </data> - <data name="NotSupported_StringComparison" xml:space="preserve"> - <value>The string comparison type passed in is currently not supported.</value> - </data> - <data name="NotSupported_SubclassOverride" xml:space="preserve"> - <value>Derived classes must provide an implementation.</value> - </data> - <data name="NotSupported_SymbolMethod" xml:space="preserve"> - <value>Not supported in an array method of a type definition that is not complete.</value> - </data> - <data name="NotSupported_TooManyArgs" xml:space="preserve"> - <value>Stack size too deep. Possibly too many arguments.</value> - </data> - <data name="NotSupported_Type" xml:space="preserve"> - <value>Type is not supported.</value> - </data> - <data name="NotSupported_TypeCannotDeserialized" xml:space="preserve"> - <value>Direct deserialization of type '{0}' is not supported.</value> - </data> - <data name="NotSupported_TypeNotYetCreated" xml:space="preserve"> - <value>The invoked member is not supported before the type is created.</value> - </data> - <data name="NotSupported_UmsSafeBuffer" xml:space="preserve"> - <value>This operation is not supported for an UnmanagedMemoryStream created from a SafeBuffer.</value> - </data> - <data name="NotSupported_UnitySerHolder" xml:space="preserve"> - <value>The UnitySerializationHolder object is designed to transmit information about other types and is not serializable itself.</value> - </data> - <data name="NotSupported_UnknownTypeCode" xml:space="preserve"> - <value>TypeCode '{0}' was not valid.</value> - </data> - <data name="NotSupported_UnreadableStream" xml:space="preserve"> - <value>Stream does not support reading.</value> - </data> - <data name="NotSupported_UnsafePointer" xml:space="preserve"> - <value>This accessor was created with a SafeBuffer; use the SafeBuffer to gain access to the pointer.</value> - </data> - <data name="NotSupported_UnseekableStream" xml:space="preserve"> - <value>Stream does not support seeking.</value> - </data> - <data name="NotSupported_UnwritableStream" xml:space="preserve"> - <value>Stream does not support writing.</value> - </data> - <data name="NotSupported_UserCOM" xml:space="preserve"> - <value>COM Interop is not supported for user-defined types.</value> - </data> - <data name="NotSupported_UserDllImport" xml:space="preserve"> - <value>DllImport cannot be used on user-defined methods.</value> - </data> - <data name="NotSupported_ValueClassCM" xml:space="preserve"> - <value>Custom marshalers for value types are not currently supported.</value> - </data> - <data name="NotSupported_ValueCollectionSet" xml:space="preserve"> - <value>Mutating a value collection derived from a dictionary is not allowed.</value> - </data> - <data name="NotSupported_VoidArray" xml:space="preserve"> - <value>Arrays of System.Void are not supported.</value> - </data> - <data name="NotSupported_WaitAllSTAThread" xml:space="preserve"> - <value>WaitAll for multiple handles on a STA thread is not supported.</value> - </data> - <data name="NotSupported_WinRT_PartialTrust" xml:space="preserve"> - <value>Windows Runtime is not supported in partial trust.</value> - </data> - <data name="NotSupported_Writing" xml:space="preserve"> - <value>Accessor does not support writing.</value> - </data> - <data name="NotSupported_WrongResourceReader_Type" xml:space="preserve"> - <value>This .resources file should not be read with this reader. The resource reader type is "{0}".</value> - </data> - <data name="NotSupported_Zero" xml:space="preserve"> - <value>The arithmetic type '{0}' cannot represent the number zero.</value> - </data> - <data name="NullReference_This" xml:space="preserve"> - <value>The pointer for this method was null.</value> - </data> - <data name="ObjectDisposed_FileClosed" xml:space="preserve"> - <value>Cannot access a closed file.</value> - </data> - <data name="ObjectDisposed_Generic" xml:space="preserve"> - <value>Cannot access a disposed object.</value> - </data> - <data name="ObjectDisposed_ObjectName_Name" xml:space="preserve"> - <value>Object name: '{0}'.</value> - </data> - <data name="ObjectDisposed_ReaderClosed" xml:space="preserve"> - <value>Cannot read from a closed TextReader.</value> - </data> - <data name="ObjectDisposed_RegKeyClosed" xml:space="preserve"> - <value>Cannot access a closed registry key.</value> - </data> - <data name="ObjectDisposed_ResourceSet" xml:space="preserve"> - <value>Cannot access a closed resource set.</value> - </data> - <data name="ObjectDisposed_StreamClosed" xml:space="preserve"> - <value>Cannot access a closed Stream.</value> - </data> - <data name="ObjectDisposed_ViewAccessorClosed" xml:space="preserve"> - <value>Cannot access a closed accessor.</value> - </data> - <data name="ObjectDisposed_WriterClosed" xml:space="preserve"> - <value>Cannot write to a closed TextWriter.</value> - </data> - <data name="OperationCanceled" xml:space="preserve"> - <value>The operation was canceled.</value> - </data> - <data name="OrderablePartitioner_GetPartitions_WrongNumberOfPartitions" xml:space="preserve"> - <value>GetPartitions returned an incorrect number of partitions.</value> - </data> - <data name="OutOfMemory_GCHandleMDA" xml:space="preserve"> - <value>The GCHandle MDA has run out of available cookies.</value> - </data> - <data name="Overflow_Byte" xml:space="preserve"> - <value>Value was either too large or too small for an unsigned byte.</value> - </data> - <data name="Overflow_Char" xml:space="preserve"> - <value>Value was either too large or too small for a character.</value> - </data> - <data name="Overflow_Currency" xml:space="preserve"> - <value>Value was either too large or too small for a Currency.</value> - </data> - <data name="Overflow_Decimal" xml:space="preserve"> - <value>Value was either too large or too small for a Decimal.</value> - </data> - <data name="Overflow_Double" xml:space="preserve"> - <value>Value was either too large or too small for a Double.</value> - </data> - <data name="Overflow_Duration" xml:space="preserve"> - <value>The duration cannot be returned for TimeSpan.MinValue because the absolute value of TimeSpan.MinValue exceeds the value of TimeSpan.MaxValue.</value> - </data> - <data name="Overflow_Int16" xml:space="preserve"> - <value>Value was either too large or too small for an Int16.</value> - </data> - <data name="Overflow_Int32" xml:space="preserve"> - <value>Value was either too large or too small for an Int32.</value> - </data> - <data name="Overflow_Int64" xml:space="preserve"> - <value>Value was either too large or too small for an Int64.</value> - </data> - <data name="Overflow_NegateTwosCompNum" xml:space="preserve"> - <value>Negating the minimum value of a twos complement number is invalid.</value> - </data> - <data name="Overflow_NegativeUnsigned" xml:space="preserve"> - <value>The string was being parsed as an unsigned number and could not have a negative sign.</value> - </data> - <data name="Overflow_SByte" xml:space="preserve"> - <value>Value was either too large or too small for a signed byte.</value> - </data> - <data name="Overflow_Single" xml:space="preserve"> - <value>Value was either too large or too small for a Single.</value> - </data> - <data name="Overflow_TimeSpanElementTooLarge" xml:space="preserve"> - <value>The TimeSpan could not be parsed because at least one of the numeric components is out of range or contains too many digits.</value> - </data> - <data name="Overflow_TimeSpanTooLong" xml:space="preserve"> - <value>TimeSpan overflowed because the duration is too long.</value> - </data> - <data name="Overflow_UInt16" xml:space="preserve"> - <value>Value was either too large or too small for a UInt16.</value> - </data> - <data name="Overflow_UInt32" xml:space="preserve"> - <value>Value was either too large or too small for a UInt32.</value> - </data> - <data name="Overflow_UInt64" xml:space="preserve"> - <value>Value was either too large or too small for a UInt64.</value> - </data> - <data name="Parallel_ForEach_NullEnumerator" xml:space="preserve"> - <value>The Partitioner source returned a null enumerator.</value> - </data> - <data name="Parallel_ForEach_OrderedPartitionerKeysNotNormalized" xml:space="preserve"> - <value>This method requires the use of an OrderedPartitioner with the KeysNormalized property set to true.</value> - </data> - <data name="Parallel_ForEach_PartitionerNotDynamic" xml:space="preserve"> - <value>The Partitioner used here must support dynamic partitioning.</value> - </data> - <data name="Parallel_ForEach_PartitionerReturnedNull" xml:space="preserve"> - <value>The Partitioner used here returned a null partitioner source.</value> - </data> - <data name="Parallel_Invoke_ActionNull" xml:space="preserve"> - <value>One of the actions was null.</value> - </data> - <data name="ParallelState_Break_InvalidOperationException_BreakAfterStop" xml:space="preserve"> - <value>Break was called after Stop was called.</value> - </data> - <data name="ParallelState_NotSupportedException_UnsupportedMethod" xml:space="preserve"> - <value>This method is not supported.</value> - </data> - <data name="ParallelState_Stop_InvalidOperationException_StopAfterBreak" xml:space="preserve"> - <value>Stop was called after Break was called.</value> - </data> - <data name="Partitioner_DynamicPartitionsNotSupported" xml:space="preserve"> - <value>Dynamic partitions are not supported by this partitioner.</value> - </data> - <data name="PartitionerStatic_CanNotCallGetEnumeratorAfterSourceHasBeenDisposed" xml:space="preserve"> - <value>Can not call GetEnumerator on partitions after the source enumerable is disposed</value> - </data> - <data name="PartitionerStatic_CurrentCalledBeforeMoveNext" xml:space="preserve"> - <value>MoveNext must be called at least once before calling Current.</value> - </data> - <data name="PlatformNotSupported_NamedSynchronizationPrimitives" xml:space="preserve"> - <value>The named version of this synchronization primitive is not supported on this platform.</value> - </data> - <data name="PlatformNotSupported_NamedSyncObjectWaitAnyWaitAll" xml:space="preserve"> - <value>Wait operations on multiple wait handles including a named synchronization primitive are not supported on this platform.</value> - </data> - <data name="PlatformNotSupported_OSXFileLocking" xml:space="preserve"> - <value>Locking/unlocking file regions is not supported on this platform. Use FileShare on the entire file instead.</value> - </data> - <data name="PlatformNotSupported_ReflectionOnly" xml:space="preserve"> - <value>ReflectionOnly loading is not supported on this platform.</value> - </data> - <data name="PlatformNotSupported_RequiresLonghorn" xml:space="preserve"> - <value>This operation is only supported on Windows Vista and above.</value> - </data> - <data name="PlatformNotSupported_RequiresNT" xml:space="preserve"> - <value>This operation is only supported on Windows 2000, Windows XP, and higher.</value> - </data> - <data name="PlatformNotSupported_RequiresW2kSP3" xml:space="preserve"> - <value>This operation is only supported on Windows 2000 SP3 or later operating systems.</value> - </data> - <data name="PlatformNotSupported_WinRT" xml:space="preserve"> - <value>Windows Runtime is not supported on this operating system.</value> - </data> - <data name="Policy_AppTrustMustGrantAppRequest" xml:space="preserve"> - <value>ApplicationTrust grant set does not contain ActivationContext's minimum request set.</value> - </data> - <data name="Policy_CannotLoadSemiTrustAssembliesDuringInit" xml:space="preserve"> - <value>All assemblies loaded as part of AppDomain initialization must be fully trusted.</value> - </data> - <data name="Policy_Default" xml:space="preserve"> - <value>Error occurred while performing a policy operation.</value> - </data> - <data name="Policy_SaveNotFileBased" xml:space="preserve"> - <value>PolicyLevel object not based on a file cannot be saved.</value> - </data> - <data name="PostconditionFailed" xml:space="preserve"> - <value>Postcondition failed.</value> - </data> - <data name="PostconditionFailed_Cnd" xml:space="preserve"> - <value>Postcondition failed: {0}</value> - </data> - <data name="PostconditionOnExceptionFailed" xml:space="preserve"> - <value>Postcondition failed after throwing an exception.</value> - </data> - <data name="PostconditionOnExceptionFailed_Cnd" xml:space="preserve"> - <value>Postcondition failed after throwing an exception: {0}</value> - </data> - <data name="PreconditionFailed" xml:space="preserve"> - <value>Precondition failed.</value> - </data> - <data name="PreconditionFailed_Cnd" xml:space="preserve"> - <value>Precondition failed: {0}</value> - </data> - <data name="PrivilegeNotHeld_Default" xml:space="preserve"> - <value>The process does not possess some privilege required for this operation.</value> - </data> - <data name="PrivilegeNotHeld_Named" xml:space="preserve"> - <value>The process does not possess the '{0}' privilege which is required for this operation.</value> - </data> - <data name="Publisher_ToString" xml:space="preserve"> - <value>Publisher</value> - </data> - <data name="Rank_MultiDimNotSupported" xml:space="preserve"> - <value>Only single dimension arrays are supported here.</value> - </data> - <data name="Rank_MustMatch" xml:space="preserve"> - <value>The specified arrays must have the same number of dimensions.</value> - </data> - <data name="ReflectionTypeLoad_LoadFailed" xml:space="preserve"> - <value>Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information.</value> - </data> - <data name="Remoting_AppDomainUnloaded" xml:space="preserve"> - <value>The target application domain has been unloaded.</value> - </data> - <data name="Remoting_AppDomainUnloaded_ThreadUnwound" xml:space="preserve"> - <value>The application domain in which the thread was running has been unloaded.</value> - </data> - <data name="Remoting_CantRemotePointerType" xml:space="preserve"> - <value>Pointer types cannot be passed in a remote call.</value> - </data> - <data name="Remoting_Delegate_TooManyTargets" xml:space="preserve"> - <value>The delegate must have only one target.</value> - </data> - <data name="Remoting_InvalidContext" xml:space="preserve"> - <value>The context is not valid.</value> - </data> - <data name="Remoting_InvalidValueTypeFieldAccess" xml:space="preserve"> - <value>An attempt was made to calculate the address of a value type field on a remote object. This was likely caused by an attempt to directly get or set the value of a field within this embedded value type. Avoid this and instead provide and use access methods for each field in the object that will be accessed remotely.</value> - </data> - <data name="Remoting_Message_BadRetValOrOutArg" xml:space="preserve"> - <value>Bad return value or out-argument inside the return message.</value> - </data> - <data name="Remoting_NonPublicOrStaticCantBeCalledRemotely" xml:space="preserve"> - <value>Permission denied: cannot call non-public or static methods remotely.</value> - </data> - <data name="Remoting_Proxy_ProxyTypeIsNotMBR" xml:space="preserve"> - <value>classToProxy argument must derive from MarshalByRef type.</value> - </data> - <data name="Remoting_TP_NonNull" xml:space="preserve"> - <value>The transparent proxy field of a real proxy must be null.</value> - </data> - <data name="Remoting_TypeCantBeRemoted" xml:space="preserve"> - <value>The given type cannot be passed in a remote call.</value> - </data> - <data name="ResourceReaderIsClosed" xml:space="preserve"> - <value>ResourceReader is closed.</value> - </data> - <data name="Resources_StreamNotValid" xml:space="preserve"> - <value>Stream is not a valid resource file.</value> - </data> - <data name="RFLCT_AmbigCust" xml:space="preserve"> - <value>Multiple custom attributes of the same type found.</value> - </data> - <data name="RFLCT_Ambiguous" xml:space="preserve"> - <value>Ambiguous match found.</value> - </data> - <data name="InvalidFilterCriteriaException_CritInt" xml:space="preserve"> - <value>An Int32 must be provided for the filter criteria.</value> - </data> - <data name="InvalidFilterCriteriaException_CritString" xml:space="preserve"> - <value>A String must be provided for the filter criteria.</value> - </data> - <data name="RFLCT_InvalidFieldFail" xml:space="preserve"> - <value>'{0}' field specified was not found.</value> - </data> - <data name="RFLCT_InvalidPropFail" xml:space="preserve"> - <value>'{0}' property specified was not found.</value> - </data> - <data name="RFLCT_Targ_ITargMismatch" xml:space="preserve"> - <value>Object does not match target type.</value> - </data> - <data name="RFLCT_Targ_StatFldReqTarg" xml:space="preserve"> - <value>Non-static field requires a target.</value> - </data> - <data name="RFLCT_Targ_StatMethReqTarg" xml:space="preserve"> - <value>Non-static method requires a target.</value> - </data> - <data name="RtType_InvalidCaller" xml:space="preserve"> - <value>Caller is not a friend.</value> - </data> - <data name="RuntimeWrappedException" xml:space="preserve"> - <value>An object that does not derive from System.Exception has been wrapped in a RuntimeWrappedException.</value> - </data> - <data name="Security_CannotReadFileData" xml:space="preserve"> - <value>The time zone ID '{0}' was found on the local computer, but the application does not have permission to read the file.</value> - </data> - <data name="Security_CannotReadRegistryData" xml:space="preserve"> - <value>The time zone ID '{0}' was found on the local computer, but the application does not have permission to read the registry information.</value> - </data> - <data name="Security_Generic" xml:space="preserve"> - <value>Request for the permission of type '{0}' failed.</value> - </data> - <data name="Security_GenericNoType" xml:space="preserve"> - <value>Request failed.</value> - </data> - <data name="Security_MustRevertOverride" xml:space="preserve"> - <value>Stack walk modifier must be reverted before another modification of the same type can be performed.</value> - - </data> - <data name="Security_NoAPTCA" xml:space="preserve"> - <value>That assembly does not allow partially trusted callers.</value> - </data> - <data name="Security_RegistryPermission" xml:space="preserve"> - <value>Requested registry access is not allowed.</value> - </data> - <data name="SemaphoreSlim_ctor_InitialCountWrong" xml:space="preserve"> - <value>The initialCount argument must be non-negative and less than or equal to the maximumCount.</value> - </data> - <data name="SemaphoreSlim_ctor_MaxCountWrong" xml:space="preserve"> - <value>The maximumCount argument must be a positive number. If a maximum is not required, use the constructor without a maxCount parameter.</value> - </data> - <data name="SemaphoreSlim_Disposed" xml:space="preserve"> - <value>The semaphore has been disposed.</value> - </data> - <data name="SemaphoreSlim_Release_CountWrong" xml:space="preserve"> - <value>The releaseCount argument must be greater than zero.</value> - </data> - <data name="SemaphoreSlim_Wait_TimeoutWrong" xml:space="preserve"> - <value>The timeout must represent a value between -1 and Int32.MaxValue, inclusive.</value> - </data> - <data name="Serialization_BadParameterInfo" xml:space="preserve"> - <value>Non existent ParameterInfo. Position bigger than member's parameters length.</value> - </data> - <data name="Serialization_CorruptField" xml:space="preserve"> - <value>The value of the field '{0}' is invalid. The serialized data is corrupt.</value> - </data> - <data name="Serialization_DateTimeTicksOutOfRange" xml:space="preserve"> - <value>Invalid serialized DateTime data. Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks.</value> - </data> - <data name="Serialization_InsufficientDeserializationState" xml:space="preserve"> - <value>Insufficient state to deserialize the object. Missing field '{0}'. More information is needed.</value> - </data> - <data name="Serialization_InsufficientState" xml:space="preserve"> - <value>Insufficient state to return the real object.</value> - </data> - <data name="Serialization_InvalidData" xml:space="preserve"> - <value>An error occurred while deserializing the object. The serialized data is corrupt.</value> - </data> - <data name="Serialization_InvalidDelegateType" xml:space="preserve"> - <value>Cannot serialize delegates over unmanaged function pointers, dynamic methods or methods outside the delegate creator's assembly.</value> - </data> - <data name="Serialization_InvalidEscapeSequence" xml:space="preserve"> - <value>The serialized data contained an invalid escape sequence '\\{0}'.</value> - </data> - <data name="Serialization_InvalidFieldState" xml:space="preserve"> - <value>Object fields may not be properly initialized.</value> - </data> - <data name="Serialization_InvalidOnDeser" xml:space="preserve"> - <value>OnDeserialization method was called while the object was not being deserialized.</value> - </data> - <data name="Serialization_InvalidPtrValue" xml:space="preserve"> - <value>An IntPtr or UIntPtr with an eight byte value cannot be deserialized on a machine with a four byte word size.</value> - </data> - <data name="Serialization_InvalidType" xml:space="preserve"> - <value>Only system-provided types can be passed to the GetUninitializedObject method. '{0}' is not a valid instance of a type.</value> - </data> - <data name="Serialization_KeyValueDifferentSizes" xml:space="preserve"> - <value>The keys and values arrays have different sizes.</value> - </data> - <data name="Serialization_MemberOutOfRange" xml:space="preserve"> - <value>The deserialized value of the member "{0}" in the class "{1}" is out of range.</value> - </data> - <data name="Serialization_MemberTypeNotRecognized" xml:space="preserve"> - <value>Unknown member type.</value> - </data> - <data name="Serialization_MissField" xml:space="preserve"> - <value>Field {0} is missing.</value> - </data> - <data name="Serialization_MissingDateTimeData" xml:space="preserve"> - <value>Invalid serialized DateTime data. Unable to find 'ticks' or 'dateData'.</value> - </data> - <data name="Serialization_MissingKeys" xml:space="preserve"> - <value>The Keys for this Hashtable are missing.</value> - </data> - <data name="Serialization_MissingValues" xml:space="preserve"> - <value>The values for this dictionary are missing.</value> - </data> - <data name="Serialization_NonSerType" xml:space="preserve"> - <value>Type '{0}' in Assembly '{1}' is not marked as serializable.</value> - </data> - <data name="Serialization_NoParameterInfo" xml:space="preserve"> - <value>Serialized member does not have a ParameterInfo.</value> - </data> - <data name="Serialization_NotFound" xml:space="preserve"> - <value>Member '{0}' was not found.</value> - </data> - <data name="Serialization_NullKey" xml:space="preserve"> - <value>One of the serialized keys is null.</value> - </data> - <data name="Serialization_NullSignature" xml:space="preserve"> - <value>The method signature cannot be null.</value> - </data> - <data name="Serialization_OptionalFieldVersionValue" xml:space="preserve"> - <value>Version value must be positive.</value> - </data> - <data name="Serialization_SameNameTwice" xml:space="preserve"> - <value>Cannot add the same member twice to a SerializationInfo object.</value> - </data> - <data name="Serialization_StringBuilderCapacity" xml:space="preserve"> - <value>The serialized Capacity property of StringBuilder must be positive, less than or equal to MaxCapacity and greater than or equal to the String length.</value> - </data> - <data name="Serialization_StringBuilderMaxCapacity" xml:space="preserve"> - <value>The serialized MaxCapacity property of StringBuilder must be positive and greater than or equal to the String length.</value> - </data> - <data name="Serialization_UnableToFindModule" xml:space="preserve"> - <value>The given module {0} cannot be found within the assembly {1}.</value> - </data> - <data name="Serialization_UnknownMember" xml:space="preserve"> - <value>Cannot get the member '{0}'.</value> - </data> - <data name="Site_ToString" xml:space="preserve"> - <value>Site</value> - </data> - <data name="SpinLock_Exit_SynchronizationLockException" xml:space="preserve"> - <value>The calling thread does not hold the lock.</value> - </data> - <data name="SpinLock_IsHeldByCurrentThread" xml:space="preserve"> - <value>Thread tracking is disabled.</value> - </data> - <data name="SpinLock_TryEnter_ArgumentOutOfRange" xml:space="preserve"> - <value>The timeout must be a value between -1 and Int32.MaxValue, inclusive.</value> - </data> - <data name="SpinLock_TryEnter_LockRecursionException" xml:space="preserve"> - <value>The calling thread already holds the lock.</value> - </data> - <data name="SpinLock_TryReliableEnter_ArgumentException" xml:space="preserve"> - <value>The tookLock argument must be set to false before calling this method.</value> - </data> - <data name="SpinWait_SpinUntil_ArgumentNull" xml:space="preserve"> - <value>The condition argument is null.</value> - </data> - <data name="SpinWait_SpinUntil_TimeoutWrong" xml:space="preserve"> - <value>The timeout must represent a value between -1 and Int32.MaxValue, inclusive.</value> - </data> - <data name="StackTrace_InFileLineNumber" xml:space="preserve"> - <value>in {0}:line {1}</value> - </data> - <data name="StrongName_Name" xml:space="preserve"> - <value>name = {0}</value> - </data> - <data name="StrongName_ToString" xml:space="preserve"> - <value>StrongName - {0}{1}{2}</value> - </data> - <data name="StrongName_Version" xml:space="preserve"> - <value>version = {0}</value> - </data> - <data name="Task_ContinueWith_ESandLR" xml:space="preserve"> - <value>The specified TaskContinuationOptions combined LongRunning and ExecuteSynchronously. Synchronous continuations should not be long running.</value> - </data> - <data name="Task_ContinueWith_NotOnAnything" xml:space="preserve"> - <value>The specified TaskContinuationOptions excluded all continuation kinds.</value> - </data> - <data name="Task_ctor_LRandSR" xml:space="preserve"> - <value>(Internal)An attempt was made to create a LongRunning SelfReplicating task.</value> - </data> - <data name="Task_Delay_InvalidDelay" xml:space="preserve"> - <value>The value needs to translate in milliseconds to -1 (signifying an infinite timeout), 0 or a positive integer less than or equal to Int32.MaxValue.</value> - </data> - <data name="Task_Delay_InvalidMillisecondsDelay" xml:space="preserve"> - <value>The value needs to be either -1 (signifying an infinite timeout), 0 or a positive integer.</value> - </data> - <data name="Task_Dispose_NotCompleted" xml:space="preserve"> - <value>A task may only be disposed if it is in a completion state (RanToCompletion, Faulted or Canceled).</value> - </data> - <data name="Task_FromAsync_LongRunning" xml:space="preserve"> - <value>It is invalid to specify TaskCreationOptions.LongRunning in calls to FromAsync.</value> - </data> - <data name="Task_FromAsync_PreferFairness" xml:space="preserve"> - <value>It is invalid to specify TaskCreationOptions.PreferFairness in calls to FromAsync.</value> - </data> - <data name="Task_FromAsync_SelfReplicating" xml:space="preserve"> - <value>It is invalid to specify TaskCreationOptions.SelfReplicating in calls to FromAsync.</value> - </data> - <data name="Task_FromAsync_TaskManagerShutDown" xml:space="preserve"> - <value>FromAsync was called with a TaskManager that had already shut down.</value> - </data> - <data name="Task_MultiTaskContinuation_EmptyTaskList" xml:space="preserve"> - <value>The tasks argument contains no tasks.</value> - </data> - <data name="Task_MultiTaskContinuation_FireOptions" xml:space="preserve"> - <value>It is invalid to exclude specific continuation kinds for continuations off of multiple tasks.</value> - </data> - <data name="Task_MultiTaskContinuation_NullTask" xml:space="preserve"> - <value>The tasks argument included a null value.</value> - </data> - <data name="Task_RunSynchronously_AlreadyStarted" xml:space="preserve"> - <value>RunSynchronously may not be called on a task that was already started.</value> - </data> - <data name="Task_RunSynchronously_Continuation" xml:space="preserve"> - <value>RunSynchronously may not be called on a continuation task.</value> - </data> - <data name="Task_RunSynchronously_Promise" xml:space="preserve"> - <value>RunSynchronously may not be called on a task not bound to a delegate, such as the task returned from an asynchronous method.</value> - </data> - <data name="Task_RunSynchronously_TaskCompleted" xml:space="preserve"> - <value>RunSynchronously may not be called on a task that has already completed.</value> - </data> - <data name="Task_Start_AlreadyStarted" xml:space="preserve"> - <value>Start may not be called on a task that was already started.</value> - </data> - <data name="Task_Start_ContinuationTask" xml:space="preserve"> - <value>Start may not be called on a continuation task.</value> - </data> - <data name="Task_Start_Promise" xml:space="preserve"> - <value>Start may not be called on a promise-style task.</value> - </data> - <data name="Task_Start_TaskCompleted" xml:space="preserve"> - <value>Start may not be called on a task that has completed.</value> - </data> - <data name="Task_ThrowIfDisposed" xml:space="preserve"> - <value>The task has been disposed.</value> - </data> - <data name="Task_WaitMulti_NullTask" xml:space="preserve"> - <value>The tasks array included at least one null element.</value> - </data> - <data name="TaskAwaiter_TaskNotCompleted" xml:space="preserve"> - <value>The awaited task has not yet completed.</value> - </data> - <data name="TaskCanceledException_ctor_DefaultMessage" xml:space="preserve"> - <value>A task was canceled.</value> - </data> - <data name="TaskCompletionSourceT_TrySetException_NoExceptions" xml:space="preserve"> - <value>The exceptions collection was empty.</value> - </data> - <data name="TaskCompletionSourceT_TrySetException_NullException" xml:space="preserve"> - <value>The exceptions collection included at least one null element.</value> - </data> - <data name="TaskExceptionHolder_UnhandledException" xml:space="preserve"> - <value>A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread.</value> - </data> - <data name="TaskExceptionHolder_UnknownExceptionType" xml:space="preserve"> - <value>(Internal)Expected an Exception or an IEnumerable<Exception></value> - </data> - <data name="TaskScheduler_ExecuteTask_TaskAlreadyExecuted" xml:space="preserve"> - <value>ExecuteTask may not be called for a task which was already executed.</value> - </data> - <data name="TaskScheduler_ExecuteTask_WrongTaskScheduler" xml:space="preserve"> - <value>ExecuteTask may not be called for a task which was previously queued to a different TaskScheduler.</value> - </data> - <data name="TaskScheduler_FromCurrentSynchronizationContext_NoCurrent" xml:space="preserve"> - <value>The current SynchronizationContext may not be used as a TaskScheduler.</value> - </data> - <data name="TaskScheduler_InconsistentStateAfterTryExecuteTaskInline" xml:space="preserve"> - <value>The TryExecuteTaskInline call to the underlying scheduler succeeded, but the task body was not invoked.</value> - </data> - <data name="TaskSchedulerException_ctor_DefaultMessage" xml:space="preserve"> - <value>An exception was thrown by a TaskScheduler.</value> - </data> - <data name="TaskT_ctor_SelfReplicating" xml:space="preserve"> - <value>It is invalid to specify TaskCreationOptions.SelfReplicating for a Task<TResult>.</value> - </data> - <data name="TaskT_DebuggerNoResult" xml:space="preserve"> - <value>{Not yet computed}</value> - </data> - <data name="TaskT_SetException_HasAnInitializer" xml:space="preserve"> - <value>A task's Exception may only be set directly if the task was created without a function.</value> - </data> - <data name="TaskT_TransitionToFinal_AlreadyCompleted" xml:space="preserve"> - <value>An attempt was made to transition a task to a final state when it had already completed.</value> - </data> - <data name="Threading_AbandonedMutexException" xml:space="preserve"> - <value>The wait completed due to an abandoned mutex.</value> - </data> - <data name="Threading_WaitHandleCannotBeOpenedException" xml:space="preserve"> - <value>No handle of the given name exists.</value> - </data> - <data name="Threading_WaitHandleCannotBeOpenedException_InvalidHandle" xml:space="preserve"> - <value>A WaitHandle with system-wide name '{0}' cannot be created. A WaitHandle of a different type might have the same name.</value> - </data> - <data name="Threading_WaitHandleTooManyPosts" xml:space="preserve"> - <value>The WaitHandle cannot be signaled because it would exceed its maximum count.</value> - </data> - <data name="Threading_SemaphoreFullException" xml:space="preserve"> - <value>Adding the specified count to the semaphore would cause it to exceed its maximum count.</value> - </data> - <data name="ThreadLocal_Disposed" xml:space="preserve"> - <value>The ThreadLocal object has been disposed.</value> - </data> - <data name="ThreadLocal_Value_RecursiveCallsToValue" xml:space="preserve"> - <value>ValueFactory attempted to access the Value property of this instance.</value> - </data> - <data name="ThreadLocal_ValuesNotAvailable" xml:space="preserve"> - <value>The ThreadLocal object is not tracking values. To use the Values property, use a ThreadLocal constructor that accepts the trackAllValues parameter and set the parameter to true.</value> - </data> - <data name="ThreadState_NoAbortRequested" xml:space="preserve"> - <value>Unable to reset abort because no abort was requested.</value> - </data> - <data name="TimeZoneNotFound_MissingData" xml:space="preserve"> - <value>The time zone ID '{0}' was not found on the local computer.</value> - </data> - <data name="TypeInitialization_Default" xml:space="preserve"> - <value>Type constructor threw an exception.</value> - </data> - <data name="TypeInitialization_Type" xml:space="preserve"> - <value>The type initializer for '{0}' threw an exception.</value> - </data> - <data name="TypeLibConverter_ImportedTypeLibProductName" xml:space="preserve"> - <value>Assembly imported from type library '{0}'.</value> - </data> - <data name="TypeLoad_ResolveNestedType" xml:space="preserve"> - <value>Could not resolve nested type '{0}' in type "{1}'.</value> - </data> - <data name="TypeLoad_ResolveType" xml:space="preserve"> - <value>Could not resolve type '{0}'.</value> - </data> - <data name="TypeLoad_ResolveTypeFromAssembly" xml:space="preserve"> - <value>Could not resolve type '{0}' in assembly '{1}'.</value> - </data> - <data name="UnauthorizedAccess_IODenied_NoPathName" xml:space="preserve"> - <value>Access to the path is denied.</value> - </data> - <data name="UnauthorizedAccess_IODenied_Path" xml:space="preserve"> - <value>Access to the path '{0}' is denied.</value> - </data> - <data name="UnauthorizedAccess_MemStreamBuffer" xml:space="preserve"> - <value>MemoryStream's internal buffer cannot be accessed.</value> - </data> - <data name="UnauthorizedAccess_RegistryKeyGeneric_Key" xml:space="preserve"> - <value>Access to the registry key '{0}' is denied.</value> - </data> - <data name="UnauthorizedAccess_RegistryNoWrite" xml:space="preserve"> - <value>Cannot write to the registry key.</value> - </data> - <data name="UnauthorizedAccess_SystemDomain" xml:space="preserve"> - <value>Cannot execute an assembly in the system domain.</value> - </data> - <data name="UnknownError_Num" xml:space="preserve"> - <value>Unknown error "{0}".</value> - </data> - <data name="Url_ToString" xml:space="preserve"> - <value>Url</value> - </data> - <data name="Verification_Exception" xml:space="preserve"> - <value>Operation could destabilize the runtime.</value> - </data> - <data name="WeakReference_NoLongerValid" xml:space="preserve"> - <value>The weak reference is no longer valid.</value> - </data> - <data name="Word_At" xml:space="preserve"> - <value>at</value> - </data> - <data name="XML_Syntax_InvalidSyntaxInFile" xml:space="preserve"> - <value>Invalid XML in file '{0}' near element '{1}'.</value> - </data> - <data name="XMLSyntax_ExpectedCloseBracket" xml:space="preserve"> - <value>Expected > character.</value> - </data> - <data name="XMLSyntax_ExpectedSlashOrString" xml:space="preserve"> - <value>Expected / character or string.</value> - </data> - <data name="XMLSyntax_InvalidSyntax" xml:space="preserve"> - <value>Invalid syntax.</value> - </data> - <data name="XMLSyntax_InvalidSyntaxSatAssemTag" xml:space="preserve"> - <value>Invalid XML in file "{0}" near element "{1}". The <satelliteassemblies> section only supports <assembly> tags.</value> - </data> - <data name="XMLSyntax_InvalidSyntaxSatAssemTagBadAttr" xml:space="preserve"> - <value>Invalid XML in file "{0}" near "{1}" and "{2}". In the <satelliteassemblies> section, the <assembly> tag must have exactly 1 attribute called 'name', whose value is a fully-qualified assembly name.</value> - </data> - <data name="XMLSyntax_InvalidSyntaxSatAssemTagNoAttr" xml:space="preserve"> - <value>Invalid XML in file "{0}". In the <satelliteassemblies> section, the <assembly> tag must have exactly 1 attribute called 'name', whose value is a fully-qualified assembly name.</value> - </data> - <data name="XMLSyntax_SyntaxError" xml:space="preserve"> - <value>Invalid syntax on line {0}.</value> - </data> - <data name="XMLSyntax_SyntaxErrorEx" xml:space="preserve"> - <value>Invalid syntax on line {0} - '{1}'.</value> - </data> - <data name="XMLSyntax_UnexpectedCloseBracket" xml:space="preserve"> - <value>Unexpected > character.</value> - </data> - <data name="XMLSyntax_UnexpectedEndOfFile" xml:space="preserve"> - <value>Unexpected end of file.</value> - </data> - <data name="Zone_ToString" xml:space="preserve"> - <value>Zone - {0}</value> - </data> -</root> diff --git a/src/mscorlib/System.Private.CoreLib.csproj b/src/mscorlib/System.Private.CoreLib.csproj index 66cbe3fcea..4d64021bad 100644 --- a/src/mscorlib/System.Private.CoreLib.csproj +++ b/src/mscorlib/System.Private.CoreLib.csproj @@ -96,7 +96,6 @@ <AssemblyVersion>4.0.0.0</AssemblyVersion> <MajorVersion>4</MajorVersion> <MinorVersion>6</MinorVersion> - <ExcludeAssemblyInfoPartialFile>true</ExcludeAssemblyInfoPartialFile> </PropertyGroup> <ItemGroup> <AssemblyInfoLines Include="[assembly: System.Resources.SatelliteContractVersion("$(AssemblyVersion)")]" /> @@ -628,6 +627,9 @@ <Compile Include="$(BclSourcesRoot)\System\Globalization\JapaneseCalendar.Win32.cs" /> <Compile Include="$(BclSourcesRoot)\System\Globalization\TextInfo.Windows.cs" /> </ItemGroup> + <ItemGroup> + <Compile Include="$(BclSourcesRoot)\SR.cs" /> + </ItemGroup> <ItemGroup Condition="'$(FeatureCoreFxGlobalization)' == 'true' and '$(TargetsUnix)' == 'true'"> <Compile Include="$(BclSourcesRoot)\System\Globalization\EncodingTable.Unix.cs" /> <Compile Include="$(BclSourcesRoot)\System\Globalization\EncodingDataItem.Unix.cs" /> @@ -980,6 +982,13 @@ <Compile Include="src\System\Runtime\RuntimeImports.cs" /> <Compile Include="src\System\ValueTuple.cs" /> </ItemGroup> + <!-- Resources --> + <ItemGroup> + <SplitTextStringResource Include="$(BclSourcesRoot)\System.Private.CoreLib.txt"> + <ResFile>System.Private.CoreLib</ResFile> + <ResGenDefines>$(DefineConstants)</ResGenDefines> + </SplitTextStringResource> + </ItemGroup> <Import Project="shared\System.Private.CoreLib.Shared.projitems" Label="Shared" /> <PropertyGroup> <CheckCDefines Condition="'$(CheckCDefines)'==''">true</CheckCDefines> @@ -1014,7 +1023,6 @@ <!-- Use a different nativeresource file to avoid conflicts with mscorlib--> <Win32Resource Condition="'$(GenerateNativeVersionInfo)'=='true'">$(IntermediateOutputPath)\System.Private.CoreLib.res</Win32Resource> </PropertyGroup> - <!-- Import resources tools --> - <Import Condition="Exists('$(ToolsDir)\resources.targets')" Project="$(ToolsDir)\resources.targets" /> + <Import Project="GenerateSplitStringResources.targets" /> <Import Project="GenerateCompilerResponseFile.targets" /> </Project> diff --git a/src/mscorlib/shared/System/IO/Error.cs b/src/mscorlib/shared/System/IO/Error.cs index 2aef895181..acf5b35cdc 100644 --- a/src/mscorlib/shared/System/IO/Error.cs +++ b/src/mscorlib/shared/System/IO/Error.cs @@ -18,7 +18,7 @@ namespace System.IO { internal static Exception GetStreamIsClosed() { - return new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed); + return new ObjectDisposedException(null, SR.ObjectDisposed_StreamIsClosed); } internal static Exception GetEndOfFile() diff --git a/src/mscorlib/shared/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs b/src/mscorlib/shared/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs index ad923dfae5..65b120e6b4 100644 --- a/src/mscorlib/shared/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs +++ b/src/mscorlib/shared/System/Runtime/CompilerServices/TupleElementNamesAttribute.cs @@ -54,4 +54,4 @@ namespace System.Runtime.CompilerServices /// </summary> public IList<string> TransformNames => _transformNames; } -} +}
\ No newline at end of file diff --git a/src/mscorlib/shared/System/StringSplitOptions.cs b/src/mscorlib/shared/System/StringSplitOptions.cs index d7020559a1..43b626a010 100644 --- a/src/mscorlib/shared/System/StringSplitOptions.cs +++ b/src/mscorlib/shared/System/StringSplitOptions.cs @@ -10,4 +10,4 @@ namespace System None = 0, RemoveEmptyEntries = 1 } -} +}
\ No newline at end of file diff --git a/src/mscorlib/shared/System/TupleExtensions.cs b/src/mscorlib/shared/System/TupleExtensions.cs index 106a88a08b..b63cb41213 100644 --- a/src/mscorlib/shared/System/TupleExtensions.cs +++ b/src/mscorlib/shared/System/TupleExtensions.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -927,4 +927,4 @@ namespace System private static Tuple<T1, T2, T3, T4, T5, T6, T7, TRest> CreateLongRef<T1, T2, T3, T4, T5, T6, T7, TRest>(T1 item1, T2 item2, T3 item3, T4 item4, T5 item5, T6 item6, T7 item7, TRest rest) where TRest : ITuple => new Tuple<T1, T2, T3, T4, T5, T6, T7, TRest>(item1, item2, item3, item4, item5, item6, item7, rest); } -} +}
\ No newline at end of file diff --git a/src/mscorlib/src/Debug.cs b/src/mscorlib/src/Debug.cs index 35cb680ffd..3398c0e31e 100644 --- a/src/mscorlib/src/Debug.cs +++ b/src/mscorlib/src/Debug.cs @@ -26,4 +26,4 @@ namespace System BCLDebug.Assert(false, message); } } -} +}
\ No newline at end of file diff --git a/src/mscorlib/src/Interop/Windows/kernel32/Interop.Globalization.cs b/src/mscorlib/src/Interop/Windows/kernel32/Interop.Globalization.cs index 2bb349d670..d187e00f0f 100644 --- a/src/mscorlib/src/Interop/Windows/kernel32/Interop.Globalization.cs +++ b/src/mscorlib/src/Interop/Windows/kernel32/Interop.Globalization.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/mscorlib/src/Microsoft/Win32/Registry.cs b/src/mscorlib/src/Microsoft/Win32/Registry.cs index d0dbb0ff7f..47a6072e96 100644 --- a/src/mscorlib/src/Microsoft/Win32/Registry.cs +++ b/src/mscorlib/src/Microsoft/Win32/Registry.cs @@ -106,7 +106,7 @@ namespace Microsoft.Win32 basekey = Registry.CurrentConfig; break; default: - throw new ArgumentException(SR.Format(SR.Arg_RegInvalidKeyName, nameof(keyName))); + throw new ArgumentException(Environment.GetResourceString("Arg_RegInvalidKeyName", nameof(keyName))); } if (i == -1 || i == keyName.Length) { diff --git a/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs b/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs index 6524c2e435..89974e4e7f 100644 --- a/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs +++ b/src/mscorlib/src/Microsoft/Win32/RegistryKey.cs @@ -545,7 +545,7 @@ namespace Microsoft.Win32 { if (options < RegistryValueOptions.None || options > RegistryValueOptions.DoNotExpandEnvironmentNames) { - throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)options), nameof(options)); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)options), nameof(options)); } bool doNotExpand = (options == RegistryValueOptions.DoNotExpandEnvironmentNames); CheckPermission(RegistryInternalCheck.CheckValueReadPermission, name, false, RegistryKeyPermissionCheck.Default); @@ -669,7 +669,7 @@ namespace Microsoft.Win32 } catch (OverflowException e) { - throw new IOException(SR.Arg_RegGetOverflowBug, e); + throw new IOException(Environment.GetResourceString("Arg_RegGetOverflowBug"), e); } } char[] blob = new char[datasize / 2]; @@ -699,7 +699,7 @@ namespace Microsoft.Win32 } catch (OverflowException e) { - throw new IOException(SR.Arg_RegGetOverflowBug, e); + throw new IOException(Environment.GetResourceString("Arg_RegGetOverflowBug"), e); } } char[] blob = new char[datasize / 2]; @@ -732,7 +732,7 @@ namespace Microsoft.Win32 } catch (OverflowException e) { - throw new IOException(SR.Arg_RegGetOverflowBug, e); + throw new IOException(Environment.GetResourceString("Arg_RegGetOverflowBug"), e); } } char[] blob = new char[datasize / 2]; @@ -754,7 +754,7 @@ namespace Microsoft.Win32 } catch (OverflowException e) { - throw new IOException(SR.Arg_RegGetOverflowBug, e); + throw new IOException(Environment.GetResourceString("Arg_RegGetOverflowBug"), e); } blob[blob.Length - 1] = (char)0; } @@ -844,11 +844,11 @@ namespace Microsoft.Win32 if (name != null && name.Length > MaxValueLength) { - throw new ArgumentException(SR.Arg_RegValStrLenBug); + throw new ArgumentException(Environment.GetResourceString("Arg_RegValStrLenBug")); } if (!Enum.IsDefined(typeof(RegistryValueKind), valueKind)) - throw new ArgumentException(SR.Arg_RegBadKeyKind, nameof(valueKind)); + throw new ArgumentException(Environment.GetResourceString("Arg_RegBadKeyKind"), nameof(valueKind)); EnsureWriteable(); @@ -1013,7 +1013,7 @@ namespace Microsoft.Win32 else if (value is String[]) return RegistryValueKind.MultiString; else - throw new ArgumentException(SR.Format(SR.Arg_RegSetBadArrType, value.GetType().Name)); + throw new ArgumentException(Environment.GetResourceString("Arg_RegSetBadArrType", value.GetType().Name)); } else return RegistryValueKind.String; @@ -1043,7 +1043,7 @@ namespace Microsoft.Win32 { case Win32Native.ERROR_ACCESS_DENIED: if (str != null) - throw new UnauthorizedAccessException(SR.Format(SR.UnauthorizedAccess_RegistryKeyGeneric_Key, str)); + throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_RegistryKeyGeneric_Key", str)); else throw new UnauthorizedAccessException(); @@ -1068,7 +1068,7 @@ namespace Microsoft.Win32 goto default; case Win32Native.ERROR_FILE_NOT_FOUND: - throw new IOException(SR.Arg_RegKeyNotFound, errorCode); + throw new IOException(Environment.GetResourceString("Arg_RegKeyNotFound"), errorCode); default: throw new IOException(Win32Native.GetMessage(errorCode), errorCode); diff --git a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs index c571f06ab8..6f618c2f64 100644 --- a/src/mscorlib/src/Microsoft/Win32/Win32Native.cs +++ b/src/mscorlib/src/Microsoft/Win32/Win32Native.cs @@ -296,7 +296,7 @@ namespace Microsoft.Win32 // if (bytes == null || bytes.Length != 44) { - throw new ArgumentException(SR.Argument_InvalidREG_TZI_FORMAT, nameof(bytes)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidREG_TZI_FORMAT"), nameof(bytes)); } Bias = BitConverter.ToInt32(bytes, 0); StandardBias = BitConverter.ToInt32(bytes, 4); @@ -499,7 +499,7 @@ namespace Microsoft.Win32 else { StringBuilderCache.Release(sb); - return SR.Format(SR.UnknownError_Num, errorCode); + return Environment.GetResourceString("UnknownError_Num", errorCode); } } diff --git a/src/mscorlib/src/SR.cs b/src/mscorlib/src/SR.cs new file mode 100644 index 0000000000..6d0be7ec73 --- /dev/null +++ b/src/mscorlib/src/SR.cs @@ -0,0 +1,1020 @@ +using System; +using System.Globalization; + +// CoreFX creates SR in the System namespace. While putting the CoreCLR SR adapter in the root +// may be unconventional, it allows us to keep the shared code identical. + +internal static class SR +{ + public static string Arg_ArrayZeroError + { + get { return Environment.GetResourceString("Arg_ArrayZeroError"); } + } + + public static string Arg_ExternalException + { + get { return Environment.GetResourceString("Arg_ExternalException"); } + } + + public static string Arg_HexStyleNotSupported + { + get { return Environment.GetResourceString("Arg_HexStyleNotSupported"); } + } + + public static string Arg_InvalidHexStyle + { + get { return Environment.GetResourceString("Arg_InvalidHexStyle"); } + } + + public static string Arg_OutOfMemoryException + { + get { return Environment.GetResourceString("Arg_OutOfMemoryException"); } + } + + public static string ArgumentNull_Array + { + get { return Environment.GetResourceString("ArgumentNull_Array"); } + } + + public static string ArgumentNull_ArrayValue + { + get { return Environment.GetResourceString("ArgumentNull_ArrayValue"); } + } + + public static string ArgumentNull_Obj + { + get { return Environment.GetResourceString("ArgumentNull_Obj"); } + } + + public static string ArgumentNull_String + { + get { return Environment.GetResourceString("ArgumentNull_String"); } + } + + public static string ArgumentOutOfRange_AddValue + { + get { return Environment.GetResourceString("ArgumentOutOfRange_AddValue"); } + } + + public static string ArgumentOutOfRange_BadHourMinuteSecond + { + get { return Environment.GetResourceString("ArgumentOutOfRange_BadHourMinuteSecond"); } + } + + public static string ArgumentOutOfRange_BadYearMonthDay + { + get { return Environment.GetResourceString("ArgumentOutOfRange_BadYearMonthDay"); } + } + + public static string ArgumentOutOfRange_Bounds_Lower_Upper + { + get { return Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper"); } + } + + public static string ArgumentOutOfRange_CalendarRange + { + get { return Environment.GetResourceString("ArgumentOutOfRange_CalendarRange"); } + } + + public static string ArgumentOutOfRange_Count + { + get { return Environment.GetResourceString("ArgumentOutOfRange_Count"); } + } + + public static string ArgumentOutOfRange_Day + { + get { return Environment.GetResourceString("ArgumentOutOfRange_Day"); } + } + + public static string ArgumentOutOfRange_Enum + { + get { return Environment.GetResourceString("ArgumentOutOfRange_Enum"); } + } + + public static string ArgumentOutOfRange_Era + { + get { return Environment.GetResourceString("ArgumentOutOfRange_Era"); } + } + + public static string ArgumentOutOfRange_Index + { + get { return Environment.GetResourceString("ArgumentOutOfRange_Index"); } + } + + public static string ArgumentOutOfRange_IndexCountBuffer + { + get { return Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer"); } + } + + public static string ArgumentOutOfRange_InvalidEraValue + { + get { return Environment.GetResourceString("ArgumentOutOfRange_InvalidEraValue"); } + } + + public static string ArgumentOutOfRange_Month + { + get { return Environment.GetResourceString("ArgumentOutOfRange_Month"); } + } + + public static string ArgumentOutOfRange_NeedNonNegNum + { + get { return Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum"); } + } + + public static string ArgumentOutOfRange_NeedPosNum + { + get { return Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum"); } + } + + public static string Arg_ArgumentOutOfRangeException + { + get { return Environment.GetResourceString("Arg_ArgumentOutOfRangeException"); } + } + + public static string ArgumentOutOfRange_OffsetLength + { + get { return Environment.GetResourceString("ArgumentOutOfRange_OffsetLength"); } + } + + public static string ArgumentOutOfRange_Range + { + get { return Environment.GetResourceString("ArgumentOutOfRange_Range"); } + } + + public static string Argument_CompareOptionOrdinal + { + get { return Environment.GetResourceString("Argument_CompareOptionOrdinal"); } + } + + public static string Argument_ConflictingDateTimeRoundtripStyles + { + get { return Environment.GetResourceString("Argument_ConflictingDateTimeRoundtripStyles"); } + } + + public static string Argument_ConflictingDateTimeStyles + { + get { return Environment.GetResourceString("Argument_ConflictingDateTimeStyles"); } + } + + public static string Argument_CultureIetfNotSupported + { + get { return Environment.GetResourceString("Argument_CultureIetfNotSupported"); } + } + + public static string Argument_CultureInvalidIdentifier + { + get { return Environment.GetResourceString("Argument_CultureInvalidIdentifier"); } + } + + public static string Argument_CultureNotSupported + { + get { return Environment.GetResourceString("Argument_CultureNotSupported"); } + } + + public static string Argument_CultureIsNeutral + { + get { return Environment.GetResourceString("Argument_CultureIsNeutral"); } + } + + public static string Argument_CustomCultureCannotBePassedByNumber + { + get { return Environment.GetResourceString("Argument_CustomCultureCannotBePassedByNumber"); } + } + + public static string Argument_EmptyDecString + { + get { return Environment.GetResourceString("Argument_EmptyDecString"); } + } + + public static string Argument_IdnBadBidi + { + get { return Environment.GetResourceString("Argument_IdnBadBidi"); } + } + + public static string Argument_IdnBadLabelSize + { + get { return Environment.GetResourceString("Argument_IdnBadLabelSize"); } + } + + public static string Argument_IdnBadNameSize + { + get { return Environment.GetResourceString("Argument_IdnBadNameSize"); } + } + + public static string Argument_IdnBadPunycode + { + get { return Environment.GetResourceString("Argument_IdnBadPunycode"); } + } + + public static string Argument_IdnBadStd3 + { + get { return Environment.GetResourceString("Argument_IdnBadStd3"); } + } + + public static string Argument_IdnIllegalName + { + get { return Environment.GetResourceString("Argument_IdnIllegalName"); } + } + + public static string Argument_InvalidArrayLength + { + get { return Environment.GetResourceString("Argument_InvalidArrayLength"); } + } + + public static string Argument_InvalidCalendar + { + get { return Environment.GetResourceString("Argument_InvalidCalendar"); } + } + + public static string Argument_InvalidCharSequence + { + get { return Environment.GetResourceString("Argument_InvalidCharSequence"); } + } + + public static string Argument_InvalidCharSequenceNoIndex + { + get { return Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"); } + } + + public static string Argument_InvalidCultureName + { + get { return Environment.GetResourceString("Argument_InvalidCultureName"); } + } + + public static string Argument_InvalidDateTimeStyles + { + get { return Environment.GetResourceString("Argument_InvalidDateTimeStyles"); } + } + + public static string Argument_InvalidDigitSubstitution + { + get { return Environment.GetResourceString("Argument_InvalidDigitSubstitution"); } + } + + public static string Argument_InvalidFlag + { + get { return Environment.GetResourceString("Argument_InvalidFlag"); } + } + + public static string Argument_InvalidGroupSize + { + get { return Environment.GetResourceString("Argument_InvalidGroupSize"); } + } + + public static string Argument_InvalidNativeDigitCount + { + get { return Environment.GetResourceString("Argument_InvalidNativeDigitCount"); } + } + + public static string Argument_InvalidNativeDigitValue + { + get { return Environment.GetResourceString("Argument_InvalidNativeDigitValue"); } + } + + public static string Argument_InvalidNeutralRegionName + { + get { return Environment.GetResourceString("Argument_InvalidNeutralRegionName"); } + } + + public static string Argument_InvalidNumberStyles + { + get { return Environment.GetResourceString("Argument_InvalidNumberStyles"); } + } + + public static string Argument_InvalidResourceCultureName + { + get { return Environment.GetResourceString("Argument_InvalidResourceCultureName"); } + } + + public static string Argument_NoEra + { + get { return Environment.GetResourceString("Argument_NoEra"); } + } + + public static string Argument_NoRegionInvariantCulture + { + get { return Environment.GetResourceString("Argument_NoRegionInvariantCulture"); } + } + + public static string Argument_OneOfCulturesNotSupported + { + get { return Environment.GetResourceString("Argument_OneOfCulturesNotSupported"); } + } + + public static string Argument_OnlyMscorlib + { + get { return Environment.GetResourceString("Argument_OnlyMscorlib"); } + } + + public static string Argument_ResultCalendarRange + { + get { return Environment.GetResourceString("Argument_ResultCalendarRange"); } + } + + public static string Format_BadFormatSpecifier + { + get { return Environment.GetResourceString("Format_BadFormatSpecifier"); } + } + + public static string InvalidOperation_DateTimeParsing + { + get { return Environment.GetResourceString("InvalidOperation_DateTimeParsing"); } + } + + public static string InvalidOperation_EnumEnded + { + get { return Environment.GetResourceString("InvalidOperation_EnumEnded"); } + } + + public static string InvalidOperation_EnumNotStarted + { + get { return Environment.GetResourceString("InvalidOperation_EnumNotStarted"); } + } + + public static string InvalidOperation_ReadOnly + { + get { return Environment.GetResourceString("InvalidOperation_ReadOnly"); } + } + + public static string Overflow_TimeSpanTooLong + { + get { return Environment.GetResourceString("Overflow_TimeSpanTooLong"); } + } + + public static string Serialization_MemberOutOfRange + { + get { return Environment.GetResourceString("Serialization_MemberOutOfRange"); } + } + + public static string Arg_InvalidHandle + { + get { return Environment.GetResourceString("Arg_InvalidHandle"); } + } + + public static string ObjectDisposed_FileClosed + { + get { return Environment.GetResourceString("ObjectDisposed_FileClosed"); } + } + + public static string Arg_HandleNotAsync + { + get { return Environment.GetResourceString("Arg_HandleNotAsync"); } + } + + public static string ArgumentNull_Path + { + get { return Environment.GetResourceString("ArgumentNull_Path"); } + } + + public static string Argument_EmptyPath + { + get { return Environment.GetResourceString("Argument_EmptyPath"); } + } + + public static string Argument_InvalidFileModeAndAccessCombo + { + get { return Environment.GetResourceString("Argument_InvalidFileMode&AccessCombo"); } + } + + public static string Argument_InvalidAppendMode + { + get { return Environment.GetResourceString("Argument_InvalidAppendMode"); } + } + + public static string ArgumentNull_Buffer + { + get { return Environment.GetResourceString("ArgumentNull_Buffer"); } + } + + public static string Argument_InvalidOffLen + { + get { return Environment.GetResourceString("Argument_InvalidOffLen"); } + } + + public static string IO_UnknownFileName + { + get { return Environment.GetResourceString("IO_UnknownFileName"); } + } + + public static string IO_FileStreamHandlePosition + { + get { return Environment.GetResourceString("IO.IO_FileStreamHandlePosition"); } + } + + public static string NotSupported_FileStreamOnNonFiles + { + get { return Environment.GetResourceString("NotSupported_FileStreamOnNonFiles"); } + } + + public static string IO_BindHandleFailed + { + get { return Environment.GetResourceString("IO.IO_BindHandleFailed"); } + } + + public static string Arg_HandleNotSync + { + get { return Environment.GetResourceString("Arg_HandleNotSync"); } + } + + public static string IO_SetLengthAppendTruncate + { + get { return Environment.GetResourceString("IO.IO_SetLengthAppendTruncate"); } + } + + public static string ArgumentOutOfRange_FileLengthTooBig + { + get { return Environment.GetResourceString("ArgumentOutOfRange_FileLengthTooBig"); } + } + + public static string Argument_InvalidSeekOrigin + { + get { return Environment.GetResourceString("Argument_InvalidSeekOrigin"); } + } + + public static string IO_SeekAppendOverwrite + { + get { return Environment.GetResourceString("IO.IO_SeekAppendOverwrite"); } + } + + public static string IO_FileTooLongOrHandleNotSync + { + get { return Environment.GetResourceString("IO_FileTooLongOrHandleNotSync"); } + } + + public static string IndexOutOfRange_IORaceCondition + { + get { return Environment.GetResourceString("IndexOutOfRange_IORaceCondition"); } + } + + public static string IO_FileNotFound + { + get { return Environment.GetResourceString("IO.FileNotFound"); } + } + + public static string IO_FileNotFound_FileName + { + get { return Environment.GetResourceString("IO.FileNotFound_FileName"); } + } + + public static string IO_PathNotFound_NoPathName + { + get { return Environment.GetResourceString("IO.PathNotFound_NoPathName"); } + } + + public static string IO_PathNotFound_Path + { + get { return Environment.GetResourceString("IO.PathNotFound_Path"); } + } + + public static string UnauthorizedAccess_IODenied_NoPathName + { + get { return Environment.GetResourceString("UnauthorizedAccess_IODenied_NoPathName"); } + } + + public static string UnauthorizedAccess_IODenied_Path + { + get { return Environment.GetResourceString("UnauthorizedAccess_IODenied_Path"); } + } + + public static string IO_AlreadyExists_Name + { + get { return Environment.GetResourceString("IO.IO_AlreadyExists_Name"); } + } + + public static string IO_PathTooLong + { + get { return Environment.GetResourceString("IO.PathTooLong"); } + } + + public static string IO_SharingViolation_NoFileName + { + get { return Environment.GetResourceString("IO.IO_SharingViolation_NoFileName"); } + } + + public static string IO_SharingViolation_File + { + get { return Environment.GetResourceString("IO.IO_SharingViolation_File"); } + } + + public static string IO_FileExists_Name + { + get { return Environment.GetResourceString("IO.IO_FileExists_Name"); } + } + + public static string NotSupported_UnwritableStream + { + get { return Environment.GetResourceString("NotSupported_UnwritableStream"); } + } + + public static string NotSupported_UnreadableStream + { + get { return Environment.GetResourceString("NotSupported_UnreadableStream"); } + } + + public static string NotSupported_UnseekableStream + { + get { return Environment.GetResourceString("NotSupported_UnseekableStream"); } + } + + public static string IO_EOF_ReadBeyondEOF + { + get { return Environment.GetResourceString("IO.EOF_ReadBeyondEOF"); } + } + + public static string Argument_InvalidHandle + { + get { return Environment.GetResourceString("Argument_InvalidHandle"); } + } + + public static string Argument_AlreadyBoundOrSyncHandle + { + get { return Environment.GetResourceString("Argument_AlreadyBoundOrSyncHandle"); } + } + + public static string Argument_PreAllocatedAlreadyAllocated + { + get { return Environment.GetResourceString("Argument_PreAllocatedAlreadyAllocated"); } + } + + public static string Argument_NativeOverlappedAlreadyFree + { + get { return Environment.GetResourceString("Argument_NativeOverlappedAlreadyFree"); } + } + + public static string Argument_NativeOverlappedWrongBoundHandle + { + get { return Environment.GetResourceString("Argument_NativeOverlappedWrongBoundHandle"); } + } + + public static string InvalidOperation_NativeOverlappedReused + { + get { return Environment.GetResourceString("InvalidOperation_NativeOverlappedReused"); } + } + + public static string ArgumentOutOfRange_Length + { + get { return Environment.GetResourceString("ArgumentOutOfRange_Length"); } + } + + public static string ArgumentOutOfRange_IndexString + { + get { return Environment.GetResourceString("ArgumentOutOfRange_IndexString"); } + } + + public static string ArgumentOutOfRange_Capacity + { + get { return Environment.GetResourceString("ArgumentOutOfRange_Capacity"); } + } + + public static string Arg_CryptographyException + { + get { return Environment.GetResourceString("Arg_CryptographyException"); } + } + + public static string ArgumentException_BufferNotFromPool + { + get { return Environment.GetResourceString("ArgumentException_BufferNotFromPool"); } + } + + public static string Argument_InvalidPathChars + { + get { return Environment.GetResourceString("Argument_InvalidPathChars"); } + } + + public static string Argument_PathFormatNotSupported + { + get { return Environment.GetResourceString("Argument_PathFormatNotSupported"); } + } + + public static string Arg_PathIllegal + { + get { return Environment.GetResourceString("Arg_PathIllegal"); } + } + + public static string Arg_PathIllegalUNC + { + get { return Environment.GetResourceString("Arg_PathIllegalUNC"); } + } + + public static string Arg_InvalidSearchPattern + { + get { return Environment.GetResourceString("Arg_InvalidSearchPattern"); } + } + + public static string InvalidOperation_Cryptography + { + get { return Environment.GetResourceString("InvalidOperation_Cryptography"); } + } + + public static string Format(string formatString, params object[] args) + { + return string.Format(CultureInfo.CurrentCulture, formatString, args); + } + + internal static string ArgumentException_ValueTupleIncorrectType + { + get { return Environment.GetResourceString("ArgumentException_ValueTupleIncorrectType"); } + } + + internal static string ArgumentException_ValueTupleLastArgumentNotATuple + { + get { return Environment.GetResourceString("ArgumentException_ValueTupleLastArgumentNotATuple"); } + } + + internal static string SpinLock_TryEnter_ArgumentOutOfRange + { + get { return Environment.GetResourceString("SpinLock_TryEnter_ArgumentOutOfRange"); } + } + + internal static string SpinLock_TryReliableEnter_ArgumentException + { + get { return Environment.GetResourceString("SpinLock_TryReliableEnter_ArgumentException"); } + } + + internal static string SpinLock_TryEnter_LockRecursionException + { + get { return Environment.GetResourceString("SpinLock_TryEnter_LockRecursionException"); } + } + + internal static string SpinLock_Exit_SynchronizationLockException + { + get { return Environment.GetResourceString("SpinLock_Exit_SynchronizationLockException"); } + } + + internal static string SpinLock_IsHeldByCurrentThread + { + get { return Environment.GetResourceString("SpinLock_IsHeldByCurrentThread"); } + } + + internal static string ObjectDisposed_StreamIsClosed + { + get { return Environment.GetResourceString("ObjectDisposed_StreamIsClosed"); } + } + + internal static string Arg_SystemException + { + get { return Environment.GetResourceString("Arg_SystemException"); } + } + + internal static string Arg_StackOverflowException + { + get { return Environment.GetResourceString("Arg_StackOverflowException"); } + } + + internal static string Arg_DataMisalignedException + { + get { return Environment.GetResourceString("Arg_DataMisalignedException"); } + } + + internal static string Arg_ExecutionEngineException + { + get { return Environment.GetResourceString("Arg_ExecutionEngineException"); } + } + + internal static string Arg_AccessException + { + get { return Environment.GetResourceString("Arg_AccessException"); } + } + + internal static string Arg_AccessViolationException + { + get { return Environment.GetResourceString("Arg_AccessViolationException"); } + } + + internal static string Arg_ApplicationException + { + get { return Environment.GetResourceString("Arg_ApplicationException"); } + } + + internal static string Arg_ArgumentException + { + get { return Environment.GetResourceString("Arg_ArgumentException"); } + } + + internal static string Arg_ParamName_Name + { + get { return Environment.GetResourceString("Arg_ParamName_Name"); } + } + + internal static string ArgumentNull_Generic + { + get { return Environment.GetResourceString("ArgumentNull_Generic"); } + } + + internal static string Arg_ArithmeticException + { + get { return Environment.GetResourceString("Arg_ArithmeticException"); } + } + + internal static string Arg_ArrayTypeMismatchException + { + get { return Environment.GetResourceString("Arg_ArrayTypeMismatchException"); } + } + + internal static string Arg_DivideByZero + { + get { return Environment.GetResourceString("Arg_DivideByZero"); } + } + + internal static string Arg_DuplicateWaitObjectException + { + get { return Environment.GetResourceString("Arg_DuplicateWaitObjectException"); } + } + + internal static string Arg_EntryPointNotFoundException + { + get { return Environment.GetResourceString("Arg_EntryPointNotFoundException"); } + } + + internal static string Arg_FieldAccessException + { + get { return Environment.GetResourceString("Arg_FieldAccessException"); } + } + + internal static string Arg_FormatException + { + get { return Environment.GetResourceString("Arg_FormatException"); } + } + + internal static string Arg_IndexOutOfRangeException + { + get { return Environment.GetResourceString("Arg_IndexOutOfRangeException"); } + } + + internal static string Arg_InsufficientExecutionStackException + { + get { return Environment.GetResourceString("Arg_InsufficientExecutionStackException"); } + } + + internal static string Arg_InvalidCastException + { + get { return Environment.GetResourceString("Arg_InvalidCastException"); } + } + + internal static string Arg_InvalidOperationException + { + get { return Environment.GetResourceString("Arg_InvalidOperationException"); } + } + + internal static string InvalidProgram_Default + { + get { return Environment.GetResourceString("InvalidProgram_Default"); } + } + + internal static string Arg_MethodAccessException + { + get { return Environment.GetResourceString("Arg_MethodAccessException"); } + } + + internal static string Arg_MulticastNotSupportedException + { + get { return Environment.GetResourceString("Arg_MulticastNotSupportedException"); } + } + + internal static string Arg_NotFiniteNumberException + { + get { return Environment.GetResourceString("Arg_NotFiniteNumberException"); } + } + + internal static string Arg_NotImplementedException + { + get { return Environment.GetResourceString("Arg_NotImplementedException"); } + } + + internal static string Arg_NotSupportedException + { + get { return Environment.GetResourceString("Arg_NotSupportedException"); } + } + + internal static string Arg_NullReferenceException + { + get { return Environment.GetResourceString("Arg_NullReferenceException"); } + } + + internal static string ObjectDisposed_Generic + { + get { return Environment.GetResourceString("ObjectDisposed_Generic"); } + } + + internal static string ObjectDisposed_ObjectName_Name + { + get { return Environment.GetResourceString("ObjectDisposed_ObjectName_Name"); } + } + + internal static string Arg_OverflowException + { + get { return Environment.GetResourceString("Arg_OverflowException"); } + } + + internal static string Arg_PlatformNotSupported + { + get { return Environment.GetResourceString("Arg_PlatformNotSupported"); } + } + + internal static string Arg_RankException + { + get { return Environment.GetResourceString("Arg_RankException"); } + } + + internal static string Arg_TimeoutException + { + get { return Environment.GetResourceString("Arg_TimeoutException"); } + } + + internal static string Arg_TypeAccessException + { + get { return Environment.GetResourceString("Arg_TypeAccessException"); } + } + + internal static string TypeInitialization_Default + { + get { return Environment.GetResourceString("TypeInitialization_Default"); } + } + + internal static string TypeInitialization_Type + { + get { return Environment.GetResourceString("TypeInitialization_Type"); } + } + + internal static string Arg_UnauthorizedAccessException + { + get { return Environment.GetResourceString("Arg_UnauthorizedAccessException"); } + } + + internal static string ArgumentOutOfRange_GenericPositive + { + get { return Environment.GetResourceString("ArgumentOutOfRange_GenericPositive"); } + } + + internal static string ArgumentOutOfRange_LengthTooLarge + { + get { return Environment.GetResourceString("ArgumentOutOfRange_LengthTooLarge"); } + } + + internal static string Arg_ArrayPlusOffTooSmall + { + get { return Environment.GetResourceString("Arg_ArrayPlusOffTooSmall"); } + } + + internal static string Arg_KeyNotFound => + Environment.GetResourceString("Arg_KeyNotFound"); + + internal static string PlatformNotSupported_OSXFileLocking => + Environment.GetResourceString("PlatformNotSupported_OSXFileLocking"); + + internal static string UnknownError_Num + { + get { return Environment.GetResourceString("UnknownError_Num"); } + } + + internal static string Lazy_ctor_ModeInvalid + { + get { return Environment.GetResourceString("Lazy_ctor_ModeInvalid"); } + } + + internal static string Lazy_Value_RecursiveCallsToValue + { + get { return Environment.GetResourceString("Lazy_Value_RecursiveCallsToValue"); } + } + + internal static string Lazy_CreateValue_NoParameterlessCtorForT + { + get { return Environment.GetResourceString("Lazy_CreateValue_NoParameterlessCtorForT"); } + } + + internal static string Lazy_ToString_ValueNotCreated + { + get { return Environment.GetResourceString("Lazy_ToString_ValueNotCreated"); } + } + + internal static string Serialization_NonSerType + { + get { return Environment.GetResourceString("Serialization_NonSerType"); } + } + + + internal static string NotSupported_SubclassOverride + { + get { return Environment.GetResourceString("NotSupported_SubclassOverride"); } + } + + internal static string InvalidCast_IConvertible => + Environment.GetResourceString("InvalidCast_IConvertible"); + + internal static string InvalidCast_DBNull => + Environment.GetResourceString("InvalidCast_DBNull"); + + internal static string InvalidCast_Empty => + Environment.GetResourceString("InvalidCast_Empty"); + + internal static string InvalidCast_FromTo => + Environment.GetResourceString("InvalidCast_FromTo"); + + internal static string Arg_UnknownTypeCode => + Environment.GetResourceString("Arg_UnknownTypeCode"); + + internal static string InvalidCast_CannotCastNullToValueType => + Environment.GetResourceString("InvalidCast_CannotCastNullToValueType"); + + internal static string Overflow_Char => + Environment.GetResourceString("Overflow_Char"); + + internal static string Overflow_Byte => + Environment.GetResourceString("Overflow_Byte"); + + internal static string Overflow_SByte => + Environment.GetResourceString("Overflow_SByte"); + + internal static string Overflow_Int16 => + Environment.GetResourceString("Overflow_Int16"); + + internal static string Overflow_UInt16 => + Environment.GetResourceString("Overflow_UInt16"); + + internal static string Overflow_Int32 => + Environment.GetResourceString("Overflow_Int32"); + + internal static string Overflow_UInt32 => + Environment.GetResourceString("Overflow_UInt32"); + + internal static string Overflow_Int64 => + Environment.GetResourceString("Overflow_Int64"); + + internal static string Overflow_UInt64 => + Environment.GetResourceString("Overflow_UInt64"); + + internal static string Arg_InvalidBase => + Environment.GetResourceString("Arg_InvalidBase"); + + internal static string ArgumentOutOfRange_OffsetOut => + Environment.GetResourceString("ArgumentOutOfRange_OffsetOut"); + + internal static string Format_BadBase64Char => + Environment.GetResourceString("Format_BadBase64Char"); + + internal static string Format_BadBase64CharArrayLength => + Environment.GetResourceString("Format_BadBase64CharArrayLength"); + + internal static string Format_NeedSingleChar => + Environment.GetResourceString("Format_BadBase64CharArrayLength"); + + internal static string Arg_EnumIllegalVal => + Environment.GetResourceString("Arg_EnumIllegalVal"); + + internal static string InvalidOperation_NoPublicAddMethod => + Environment.GetResourceString("InvalidOperation_NoPublicAddMethod"); + + internal static string InvalidOperation_NoPublicRemoveMethod => + Environment.GetResourceString("InvalidOperation_NoPublicRemoveMethod"); + + internal static string InvalidOperation_NotSupportedOnWinRTEvent => + Environment.GetResourceString("InvalidOperation_NotSupportedOnWinRTEvent"); + + internal static string NotSupported_AbstractNonCLS => + Environment.GetResourceString("NotSupported_AbstractNonCLS"); + + internal static string Serialization_InsufficientState => + Environment.GetResourceString("Serialization_InsufficientState"); + + internal static string Serialization_BadParameterInfo => + Environment.GetResourceString("Serialization_BadParameterInfo"); + + internal static string Serialization_NoParameterInfo => + Environment.GetResourceString("Serialization_NoParameterInfo"); + + internal static string InvalidFilterCriteriaException_CritString => + Environment.GetResourceString("InvalidFilterCriteriaException_CritString"); + + internal static string NotSupported_NoTypeInfo => + Environment.GetResourceString("NotSupported_NoTypeInfo"); + + internal static string PlatformNotSupported_ReflectionOnly => + Environment.GetResourceString("PlatformNotSupported_ReflectionOnly"); + + internal static string Arg_EnumAndObjectMustBeSameType => + Environment.GetResourceString("Arg_EnumAndObjectMustBeSameType"); + + internal static string Arg_EnumUnderlyingTypeAndObjectMustBeSameType => + Environment.GetResourceString("Arg_EnumUnderlyingTypeAndObjectMustBeSameType"); + + internal static string Arg_MustBeEnum => + Environment.GetResourceString("Arg_MustBeEnum"); + + internal static string Arg_MustBeEnumBaseTypeOrEnum => + Environment.GetResourceString("Arg_MustBeEnumBaseTypeOrEnum"); + + internal static string Arg_NotGenericParameter => + Environment.GetResourceString("Arg_NotGenericParameter"); + + internal static string Argument_InvalidEnum => + Environment.GetResourceString("Argument_InvalidEnum"); + + internal static string InvalidFilterCriteriaException_CritInt => + Environment.GetResourceString("InvalidFilterCriteriaException_CritInt"); + + internal static string InvalidOperation_UnknownEnumType => + Environment.GetResourceString("InvalidOperation_UnknownEnumType"); + + internal static string Arg_SecurityException => + Environment.GetResourceString("Arg_SecurityException"); +} diff --git a/src/mscorlib/src/System.Private.CoreLib.txt b/src/mscorlib/src/System.Private.CoreLib.txt new file mode 100644 index 0000000000..0197305a75 --- /dev/null +++ b/src/mscorlib/src/System.Private.CoreLib.txt @@ -0,0 +1,1970 @@ +; Licensed to the .NET Foundation under one or more agreements. +; The .NET Foundation licenses this file to you under the MIT license. +; See the LICENSE file in the project root for more information. + +; These are the managed resources for mscorlib.dll. +; See those first three bytes in the file? This is in UTF-8. Leave the +; Unicode byte order mark (U+FEFF) written in UTF-8 at the start of this file. + +; For resource info, see the ResourceManager documentation and the ResGen tool, +; which is a managed app using ResourceWriter. +; ResGen now supports limited preprocessing of txt files, you can use +; #if SYMBOL and #if !SYMBOL to control what sets of resources are included in +; the resulting resources. + +; The naming scheme is: [Namespace.] ExceptionName _ Reason +; We'll suppress "System." where possible. +; Examples: +; Argument_Null +; Reflection.TargetInvokation_someReason + +; Usage Notes: +; * Keep exceptions in alphabetical order by package +; * A single space may exist on either side of the equal sign. +; * Follow the naming conventions. +; * Any lines starting with a '#' or ';' are ignored +; * Equal signs aren't legal characters for keys, but may occur in values. +; * Correctly punctuate all sentences. Most resources should end in a period. +; Remember, your mother will probably read some of these messages. +; * You may use " (quote), \n and \t. Use \\ for a single '\' character. +; * String inserts work. i.e., BadNumber_File = Wrong number in file "{0}". + +; Real words, used by code like Environment.StackTrace +#if INCLUDE_RUNTIME +Word_At = at +StackTrace_InFileLineNumber = in {0}:line {1} +UnknownError_Num = Unknown error "{0}". +AllocatedFrom = Allocated from: + +; Note this one is special, used as a divider between stack traces! +Exception_EndOfInnerExceptionStack = --- End of inner exception stack trace --- +Exception_WasThrown = Exception of type '{0}' was thrown. + +; The following are used in the implementation of ExceptionDispatchInfo +Exception_EndStackTraceFromPreviousThrow = --- End of stack trace from previous location where exception was thrown --- + +Arg_ParamName_Name = Parameter name: {0} +ArgumentOutOfRange_ActualValue = Actual value was {0}. + +NoDebugResources = [{0}]\r\nArguments: {1}\r\nDebugging resource strings are unavailable. Often the key and arguments provide sufficient information to diagnose the problem. See http://go.microsoft.com/fwlink/?linkid=106663&Version={2}&File={3}&Key={4} +#endif // INCLUDE_RUNTIME + +#if INCLUDE_DEBUG + +; For code contracts +AssumptionFailed = Assumption failed. +AssumptionFailed_Cnd = Assumption failed: {0} +AssertionFailed = Assertion failed. +AssertionFailed_Cnd = Assertion failed: {0} +PreconditionFailed = Precondition failed. +PreconditionFailed_Cnd = Precondition failed: {0} +PostconditionFailed = Postcondition failed. +PostconditionFailed_Cnd = Postcondition failed: {0} +PostconditionOnExceptionFailed = Postcondition failed after throwing an exception. +PostconditionOnExceptionFailed_Cnd = Postcondition failed after throwing an exception: {0} +InvariantFailed = Invariant failed. +InvariantFailed_Cnd = Invariant failed: {0} +MustUseCCRewrite = An assembly (probably "{1}") must be rewritten using the code contracts binary rewriter (CCRewrite) because it is calling Contract.{0} and the CONTRACTS_FULL symbol is defined. Remove any explicit definitions of the CONTRACTS_FULL symbol from your project and rebuild. CCRewrite can be downloaded from http://go.microsoft.com/fwlink/?LinkID=169180. \r\nAfter the rewriter is installed, it can be enabled in Visual Studio from the project's Properties page on the Code Contracts pane. Ensure that "Perform Runtime Contract Checking" is enabled, which will define CONTRACTS_FULL. + +; AccessException +Acc_CreateGeneric = Cannot create a type for which Type.ContainsGenericParameters is true. +Acc_CreateAbst = Cannot create an abstract class. +Acc_CreateInterface = Cannot create an instance of an interface. +Acc_NotClassInit = Type initializer was not callable. +Acc_CreateGenericEx = Cannot create an instance of {0} because Type.ContainsGenericParameters is true. +Acc_CreateArgIterator = Cannot dynamically create an instance of ArgIterator. +Acc_CreateAbstEx = Cannot create an instance of {0} because it is an abstract class. +Acc_CreateInterfaceEx = Cannot create an instance of {0} because it is an interface. +Acc_CreateVoid = Cannot dynamically create an instance of System.Void. +Acc_ReadOnly = Cannot set a constant field. +Acc_RvaStatic = SkipVerification permission is needed to modify an image-based (RVA) static field. +Access_Void = Cannot create an instance of void. + +; ArgumentException +Arg_TypedReference_Null = The TypedReference must be initialized. +Argument_AddingDuplicate__ = Item has already been added. Key in dictionary: '{0}' Key being added: '{1}' +Argument_AddingDuplicate = An item with the same key has already been added. +Argument_AddingDuplicateWithKey = An item with the same key has already been added. Key: {0} +Argument_MethodDeclaringTypeGenericLcg = Method '{0}' has a generic declaring type '{1}'. Explicitly provide the declaring type to GetTokenFor. +Argument_MethodDeclaringTypeGeneric = Cannot resolve method {0} because the declaring type of the method handle {1} is generic. Explicitly provide the declaring type to GetMethodFromHandle. +Argument_FieldDeclaringTypeGeneric = Cannot resolve field {0} because the declaring type of the field handle {1} is generic. Explicitly provide the declaring type to GetFieldFromHandle. +Argument_ApplicationTrustShouldHaveIdentity = An ApplicationTrust must have an application identity before it can be persisted. +Argument_ConversionOverflow = Conversion buffer overflow. +Argument_CodepageNotSupported = {0} is not a supported code page. +Argument_CultureNotSupported = Culture is not supported. +Argument_CultureInvalidIdentifier = {0} is an invalid culture identifier. +Argument_OneOfCulturesNotSupported = Culture name {0} or {1} is not supported. +Argument_CultureIetfNotSupported = Culture IETF Name {0} is not a recognized IETF name. +Argument_CultureIsNeutral = Culture ID {0} (0x{0:X4}) is a neutral culture; a region cannot be created from it. +Argument_InvalidNeutralRegionName = The region name {0} should not correspond to neutral culture; a specific culture name is required. +Argument_InvalidGenericInstArray = Generic arguments must be provided for each generic parameter and each generic argument must be a RuntimeType. +Argument_GenericArgsCount = The number of generic arguments provided doesn't equal the arity of the generic type definition. +Argument_CultureInvalidFormat = Culture '{0}' is a neutral culture. It cannot be used in formatting and parsing and therefore cannot be set as the thread's current culture. +Argument_CompareOptionOrdinal = CompareOption.Ordinal cannot be used with other options. +Argument_CustomCultureCannotBePassedByNumber = Customized cultures cannot be passed by LCID, only by name. +Argument_EncodingConversionOverflowChars = The output char buffer is too small to contain the decoded characters, encoding '{0}' fallback '{1}'. +Argument_EncodingConversionOverflowBytes = The output byte buffer is too small to contain the encoded data, encoding '{0}' fallback '{1}'. +Argument_EncoderFallbackNotEmpty = Must complete Convert() operation or call Encoder.Reset() before calling GetBytes() or GetByteCount(). Encoder '{0}' fallback '{1}'. +Argument_EmptyFileName = Empty file name is not legal. +Argument_EmptyPath = Empty path name is not legal. +Argument_EmptyName = Empty name is not legal. +Argument_ImplementIComparable = At least one object must implement IComparable. +Argument_InvalidType = The type of arguments passed into generic comparer methods is invalid. +Argument_InvalidTypeForCA=Cannot build type parameter for custom attribute with a type that does not support the AssemblyQualifiedName property. The type instance supplied was of type '{0}'. +Argument_IllegalEnvVarName = Environment variable name cannot contain equal character. +Argument_IllegalAppId = Application identity does not have same number of components as manifest paths. +Argument_IllegalAppBase = The application base specified is not valid. +Argument_UnableToParseManifest = Unexpected error while parsing the specified manifest. +Argument_IllegalAppIdMismatch = Application identity does not match identities in manifests. +Argument_InvalidAppId = Invalid identity: no deployment or application identity specified. +Argument_InvalidGenericArg = The generic type parameter was not valid +Argument_InvalidArrayLength = Length of the array must be {0}. +Argument_InvalidArrayType = Target array type is not compatible with the type of items in the collection. +Argument_InvalidAppendMode = Append access can be requested only in write-only mode. +Argument_InvalidEnumValue = The value '{0}' is not valid for this usage of the type {1}. +Argument_EnumIsNotIntOrShort = The underlying type of enum argument must be Int32 or Int16. +Argument_InvalidEnum = The Enum type should contain one and only one instance field. +Argument_InvalidKeyStore = '{0}' is not a valid KeyStore name. +Argument_InvalidFileMode&AccessCombo = Combining FileMode: {0} with FileAccess: {1} is invalid. +Argument_InvalidFileMode&RightsCombo = Combining FileMode: {0} with FileSystemRights: {1} is invalid. +Argument_InvalidFileModeTruncate&RightsCombo = Combining FileMode: {0} with FileSystemRights: {1} is invalid. FileMode.Truncate is valid only when used with FileSystemRights.Write. +Argument_InvalidFlag = Value of flags is invalid. +Argument_InvalidAnyFlag = No flags can be set. +Argument_InvalidHandle = The handle is invalid. +Argument_InvalidRegistryKeyPermissionCheck = The specified RegistryKeyPermissionCheck value is invalid. +Argument_InvalidRegistryOptionsCheck = The specified RegistryOptions value is invalid. +Argument_InvalidRegistryViewCheck = The specified RegistryView value is invalid. +Argument_InvalidSubPath = The directory specified, '{0}', is not a subdirectory of '{1}'. +Argument_NoRegionInvariantCulture = There is no region associated with the Invariant Culture (Culture ID: 0x7F). +Argument_ResultCalendarRange = The result is out of the supported range for this calendar. The result should be between {0} (Gregorian date) and {1} (Gregorian date), inclusive. +Argument_ResultIslamicCalendarRange = The date is out of the supported range for the Islamic calendar. The date should be greater than July 18th, 622 AD (Gregorian date). +Argument_NeverValidGenericArgument = The type '{0}' may not be used as a type argument. +Argument_NotEnoughGenArguments = The type or method has {1} generic parameter(s), but {0} generic argument(s) were provided. A generic argument must be provided for each generic parameter. +Argument_NullFullTrustAssembly = A null StrongName was found in the full trust assembly list. +Argument_GenConstraintViolation = GenericArguments[{0}], '{1}', on '{2}' violates the constraint of type '{3}'. +Argument_InvalidToken = Token {0:x} is not valid in the scope of module {1}. +Argument_InvalidTypeToken = Token {0:x} is not a valid Type token. +Argument_ResolveType = Token {0:x} is not a valid Type token in the scope of module {1}. +Argument_ResolveMethod = Token {0:x} is not a valid MethodBase token in the scope of module {1}. +Argument_ResolveField = Token {0:x} is not a valid FieldInfo token in the scope of module {1}. +Argument_ResolveMember = Token {0:x} is not a valid MemberInfo token in the scope of module {1}. +Argument_ResolveString = Token {0:x} is not a valid string token in the scope of module {1}. +Argument_ResolveModuleType = Token {0} resolves to the special module type representing this module. +Argument_ResolveMethodHandle = Type handle '{0}' and method handle with declaring type '{1}' are incompatible. Get RuntimeMethodHandle and declaring RuntimeTypeHandle off the same MethodBase. +Argument_ResolveFieldHandle = Type handle '{0}' and field handle with declaring type '{1}' are incompatible. Get RuntimeFieldHandle and declaring RuntimeTypeHandle off the same FieldInfo. +Argument_ResourceScopeWrongDirection = Resource type in the ResourceScope enum is going from a more restrictive resource type to a more general one. From: "{0}" To: "{1}" +Argument_BadResourceScopeTypeBits = Unknown value for the ResourceScope: {0} Too many resource type bits may be set. +Argument_BadResourceScopeVisibilityBits = Unknown value for the ResourceScope: {0} Too many resource visibility bits may be set. +Argument_WaitHandleNameTooLong = The name can be no more than {0} characters in length. +Argument_EnumTypeDoesNotMatch = The argument type, '{0}', is not the same as the enum type '{1}'. +InvalidOperation_MethodBuilderBaked = The signature of the MethodBuilder can no longer be modified because an operation on the MethodBuilder caused the methodDef token to be created. For example, a call to SetCustomAttribute requires the methodDef token to emit the CustomAttribute token. +InvalidOperation_GenericParametersAlreadySet = The generic parameters are already defined on this MethodBuilder. +Arg_AccessException = Cannot access member. +Arg_AppDomainUnloadedException = Attempted to access an unloaded AppDomain. +Arg_ApplicationException = Error in the application. +Arg_ArgumentOutOfRangeException = Specified argument was out of the range of valid values. +Arg_ArithmeticException = Overflow or underflow in the arithmetic operation. +Arg_ArrayLengthsDiffer = Array lengths must be the same. +Arg_ArrayPlusOffTooSmall = Destination array is not long enough to copy all the items in the collection. Check array index and length. +Arg_ArrayTypeMismatchException = Attempted to access an element as a type incompatible with the array. +Arg_BadDecimal = Read an invalid decimal value from the buffer. +Arg_BadImageFormatException = Format of the executable (.exe) or library (.dll) is invalid. +Argument_BadImageFormatExceptionResolve = A BadImageFormatException has been thrown while parsing the signature. This is likely due to lack of a generic context. Ensure genericTypeArguments and genericMethodArguments are provided and contain enough context. +Arg_BufferTooSmall = Not enough space available in the buffer. +Arg_CATypeResolutionFailed = Failed to resolve type from string "{0}" which was embedded in custom attribute blob. +Arg_CannotHaveNegativeValue = String cannot contain a minus sign if the base is not 10. +Arg_CannotUnloadAppDomainException = Attempt to unload the AppDomain failed. +Arg_CannotMixComparisonInfrastructure = The usage of IKeyComparer and IHashCodeProvider/IComparer interfaces cannot be mixed; use one or the other. +Arg_ContextMarshalException = Attempted to marshal an object across a context boundary. +Arg_DataMisalignedException = A datatype misalignment was detected in a load or store instruction. +Arg_DevicesNotSupported = FileStream will not open Win32 devices such as disk partitions and tape drives. Avoid use of "\\\\.\\" in the path. +Arg_DuplicateWaitObjectException = Duplicate objects in argument. +Arg_EntryPointNotFoundException = Entry point was not found. +Arg_DllNotFoundException = Dll was not found. +Arg_ExecutionEngineException = Internal error in the runtime. +Arg_FieldAccessException = Attempted to access a field that is not accessible by the caller. +Arg_FileIsDirectory_Name = The target file "{0}" is a directory, not a file. +Arg_FormatException = One of the identified items was in an invalid format. +Arg_IndexOutOfRangeException = Index was outside the bounds of the array. +Arg_InsufficientExecutionStackException = Insufficient stack to continue executing the program safely. This can happen from having too many functions on the call stack or function on the stack using too much stack space. +Arg_InvalidCastException = Specified cast is not valid. +Arg_InvalidOperationException = Operation is not valid due to the current state of the object. +Arg_CorruptedCustomCultureFile = The file of the custom culture {0} is corrupt. Try to unregister this culture. +Arg_InvokeMember = InvokeMember can be used only for COM objects. +Arg_InvalidNeutralResourcesLanguage_Asm_Culture = The NeutralResourcesLanguageAttribute on the assembly "{0}" specifies an invalid culture name: "{1}". +Arg_InvalidNeutralResourcesLanguage_FallbackLoc = The NeutralResourcesLanguageAttribute specifies an invalid or unrecognized ultimate resource fallback location: "{0}". +Arg_InvalidSatelliteContract_Asm_Ver = Satellite contract version attribute on the assembly '{0}' specifies an invalid version: {1}. +Arg_MethodAccessException = Attempt to access the method failed. +Arg_MethodAccessException_WithMethodName = Attempt to access the method "{0}" on type "{1}" failed. +Arg_MethodAccessException_WithCaller = Attempt by security transparent method '{0}' to access security critical method '{1}' failed. +Arg_MissingFieldException = Attempted to access a non-existing field. +Arg_MissingMemberException = Attempted to access a missing member. +Arg_MissingMethodException = Attempted to access a missing method. +Arg_MulticastNotSupportedException = Attempted to add multiple callbacks to a delegate that does not support multicast. +Arg_NotFiniteNumberException = Number encountered was not a finite quantity. +Arg_NotSupportedException = Specified method is not supported. +Arg_UnboundGenParam = Late bound operations cannot be performed on types or methods for which ContainsGenericParameters is true. +Arg_UnboundGenField = Late bound operations cannot be performed on fields with types for which Type.ContainsGenericParameters is true. +Arg_NotGenericParameter = Method may only be called on a Type for which Type.IsGenericParameter is true. +Arg_GenericParameter = Method must be called on a Type for which Type.IsGenericParameter is false. +Arg_NotGenericTypeDefinition = {0} is not a GenericTypeDefinition. MakeGenericType may only be called on a type for which Type.IsGenericTypeDefinition is true. +Arg_NotGenericMethodDefinition = {0} is not a GenericMethodDefinition. MakeGenericMethod may only be called on a method for which MethodBase.IsGenericMethodDefinition is true. +Arg_BadLiteralFormat = Encountered an invalid type for a default value. +Arg_MissingActivationArguments = The AppDomainSetup must specify the activation arguments for this call. +Argument_BadParameterTypeForCAB = Cannot emit a CustomAttribute with argument of type {0}. +Argument_InvalidMemberForNamedArgument = The member must be either a field or a property. +Argument_InvalidTypeName = The name of the type is invalid. + +; Note - don't change the NullReferenceException default message. This was +; negotiated carefully with the VB team to avoid saying "null" or "nothing". +Arg_NullReferenceException = Object reference not set to an instance of an object. + +Arg_AccessViolationException = Attempted to read or write protected memory. This is often an indication that other memory is corrupt. +Arg_OverflowException = Arithmetic operation resulted in an overflow. +Arg_PathGlobalRoot = Paths that begin with \\\\?\\GlobalRoot are internal to the kernel and should not be opened by managed applications. +Arg_PathIllegal = The path is not of a legal form. +Arg_PathIllegalUNC = The UNC path should be of the form \\\\server\\share. +Arg_RankException = Attempted to operate on an array with the incorrect number of dimensions. +Arg_RankMultiDimNotSupported = Only single dimensional arrays are supported for the requested action. +Arg_NonZeroLowerBound = The lower bound of target array must be zero. +Arg_RegSubKeyValueAbsent = No value exists with that name. +Arg_ResourceFileUnsupportedVersion = The ResourceReader class does not know how to read this version of .resources files. Expected version: {0} This file: {1} +Arg_ResourceNameNotExist = The specified resource name "{0}" does not exist in the resource file. +Arg_SecurityException = Security error. +Arg_SerializationException = Serialization error. +Arg_StackOverflowException = Operation caused a stack overflow. +Arg_SurrogatesNotAllowedAsSingleChar = Unicode surrogate characters must be written out as pairs together in the same call, not individually. Consider passing in a character array instead. +Arg_SynchronizationLockException = Object synchronization method was called from an unsynchronized block of code. +Arg_RWLockRestoreException = ReaderWriterLock.RestoreLock was called without releasing all locks acquired since the call to ReleaseLock. +Arg_SystemException = System error. +Arg_TimeoutException = The operation has timed out. +Arg_UnauthorizedAccessException = Attempted to perform an unauthorized operation. +Arg_ArgumentException = Value does not fall within the expected range. +Arg_DirectoryNotFoundException = Attempted to access a path that is not on the disk. +Arg_DriveNotFoundException = Attempted to access a drive that is not available. +Arg_EndOfStreamException = Attempted to read past the end of the stream. +Arg_HexStyleNotSupported = The number style AllowHexSpecifier is not supported on floating point data types. +Arg_IOException = I/O error occurred. +Arg_InvalidHexStyle = With the AllowHexSpecifier bit set in the enum bit field, the only other valid bits that can be combined into the enum value must be a subset of those in HexNumber. +Arg_KeyNotFound = The given key was not present in the dictionary. +Argument_InvalidNumberStyles = An undefined NumberStyles value is being used. +Argument_InvalidDateTimeStyles = An undefined DateTimeStyles value is being used. +Argument_InvalidTimeSpanStyles = An undefined TimeSpanStyles value is being used. +Argument_DateTimeOffsetInvalidDateTimeStyles = The DateTimeStyles value 'NoCurrentDateDefault' is not allowed when parsing DateTimeOffset. +Argument_NativeResourceAlreadyDefined = Native resource has already been defined. +Argument_BadObjRef = Invalid ObjRef provided to '{0}'. +Argument_InvalidCultureName = Culture name '{0}' is not supported. +Argument_NameTooLong = The name '{0}' is too long to be a Culture or Region name, which is limited to {1} characters. +Argument_NameContainsInvalidCharacters = The name '{0}' contains characters that are not valid for a Culture or Region. +Argument_InvalidRegionName = Region name '{0}' is not supported. +Argument_CannotCreateTypedReference = Cannot use function evaluation to create a TypedReference object. +Arg_ArrayZeroError = Array must not be of length zero. +Arg_BogusIComparer = Unable to sort because the IComparer.Compare() method returns inconsistent results. Either a value does not compare equal to itself, or one value repeatedly compared to another value yields different results. IComparer: '{0}'. +Arg_CreatInstAccess = Cannot specify both CreateInstance and another access type. +Arg_CryptographyException = Error occurred during a cryptographic operation. +Arg_DateTimeRange = Combination of arguments to the DateTime constructor is out of the legal range. +Arg_DecBitCtor = Decimal byte array constructor requires an array of length four containing valid decimal bytes. +Arg_DlgtTargMeth = Cannot bind to the target method because its signature or security transparency is not compatible with that of the delegate type. +Arg_DlgtTypeMis = Delegates must be of the same type. +Arg_DlgtNullInst = Delegate to an instance method cannot have null 'this'. +Arg_DllInitFailure = One machine may not have remote administration enabled, or both machines may not be running the remote registry service. +Arg_EmptyArray = Array may not be empty. +Arg_EmptyOrNullArray = Array may not be empty or null. +Arg_EmptyCollection = Collection must not be empty. +Arg_EmptyOrNullString = String may not be empty or null. +Argument_ItemNotExist = The specified item does not exist in this KeyedCollection. +Argument_EncodingNotSupported = '{0}' is not a supported encoding name. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. +Argument_FallbackBufferNotEmpty = Cannot change fallback when buffer is not empty. Previous Convert() call left data in the fallback buffer. +Argument_InvalidCodePageConversionIndex = Unable to translate Unicode character \\u{0:X4} at index {1} to specified code page. +Argument_InvalidCodePageBytesIndex = Unable to translate bytes {0} at index {1} from specified code page to Unicode. +Argument_RecursiveFallback = Recursive fallback not allowed for character \\u{0:X4}. +Argument_RecursiveFallbackBytes = Recursive fallback not allowed for bytes {0}. +Arg_EnumAndObjectMustBeSameType = Object must be the same type as the enum. The type passed in was '{0}'; the enum type was '{1}'. +Arg_EnumIllegalVal = Illegal enum value: {0}. +Arg_EnumNotSingleFlag = Must set exactly one flag. +Arg_EnumAtLeastOneFlag = Must set at least one flag. +Arg_EnumUnderlyingTypeAndObjectMustBeSameType = Enum underlying type and the object must be same type or object must be a String. Type passed in was '{0}'; the enum underlying type was '{1}'. +Arg_EnumFormatUnderlyingTypeAndObjectMustBeSameType = Enum underlying type and the object must be same type or object. Type passed in was '{0}'; the enum underlying type was '{1}'. +Arg_EnumMustHaveUnderlyingValueField = All enums must have an underlying value__ field. +Arg_COMAccess = Must specify property Set or Get or method call for a COM Object. +Arg_COMPropSetPut = Only one of the following binding flags can be set: BindingFlags.SetProperty, BindingFlags.PutDispProperty, BindingFlags.PutRefDispProperty. +Arg_FldSetGet = Cannot specify both Get and Set on a field. +Arg_PropSetGet = Cannot specify both Get and Set on a property. +Arg_CannotBeNaN = TimeSpan does not accept floating point Not-a-Number values. +Arg_FldGetPropSet = Cannot specify both GetField and SetProperty. +Arg_FldSetPropGet = Cannot specify both SetField and GetProperty. +Arg_FldSetInvoke = Cannot specify Set on a Field and Invoke on a method. +Arg_FldGetArgErr = No arguments can be provided to Get a field value. +Arg_FldSetArgErr = Only the field value can be specified to set a field value. +Arg_GetMethNotFnd = Property Get method was not found. +Arg_GuidArrayCtor = Byte array for GUID must be exactly {0} bytes long. +Arg_HandleNotAsync = Handle does not support asynchronous operations. The parameters to the FileStream constructor may need to be changed to indicate that the handle was opened synchronously (that is, it was not opened for overlapped I/O). +Arg_HandleNotSync = Handle does not support synchronous operations. The parameters to the FileStream constructor may need to be changed to indicate that the handle was opened asynchronously (that is, it was opened explicitly for overlapped I/O). +Arg_HTCapacityOverflow = Hashtable's capacity overflowed and went negative. Check load factor, capacity and the current size of the table. +Arg_IndexMustBeInt = All indexes must be of type Int32. +Arg_InvalidConsoleColor = The ConsoleColor enum value was not defined on that enum. Please use a defined color from the enum. +Arg_InvalidFileAttrs = Invalid File or Directory attributes value. +Arg_InvalidHandle = Invalid handle. +Arg_InvalidTypeInSignature = The signature Type array contains some invalid type (i.e. null, void) +Arg_InvalidTypeInRetType = The return Type contains some invalid type (i.e. null, ByRef) +Arg_EHClauseNotFilter = This ExceptionHandlingClause is not a filter. +Arg_EHClauseNotClause = This ExceptionHandlingClause is not a clause. +Arg_ReflectionOnlyCA = It is illegal to reflect on the custom attributes of a Type loaded via ReflectionOnlyGetType (see Assembly.ReflectionOnly) -- use CustomAttributeData instead. +Arg_ReflectionOnlyInvoke = It is illegal to invoke a method on a Type loaded via ReflectionOnlyGetType. +Arg_ReflectionOnlyField = It is illegal to get or set the value on a field on a Type loaded via ReflectionOnlyGetType. +Arg_MemberInfoNullModule = The Module object containing the member cannot be null. +Arg_ParameterInfoNullMember = The MemberInfo object defining the parameter cannot be null. +Arg_ParameterInfoNullModule = The Module object containing the parameter cannot be null. +Arg_AssemblyNullModule = The manifest module of the assembly cannot be null. +Arg_LongerThanSrcArray = Source array was not long enough. Check the source index, length, and the array's lower bounds. +Arg_LongerThanDestArray = Destination array was not long enough. Check the destination index, length, and the array's lower bounds. +Arg_LowerBoundsMustMatch = The arrays' lower bounds must be identical. +Arg_MustBeBoolean = Object must be of type Boolean. +Arg_MustBeByte = Object must be of type Byte. +Arg_MustBeChar = Object must be of type Char. +Arg_MustBeDateTime = Object must be of type DateTime. +Arg_MustBeDateTimeOffset = Object must be of type DateTimeOffset. +Arg_MustBeDecimal = Object must be of type Decimal. +Arg_MustBeDelegate = Type must derive from Delegate. +Arg_MustBeDouble = Object must be of type Double. +Arg_MustBeDriveLetterOrRootDir = Object must be a root directory ("C:\\") or a drive letter ("C"). +Arg_MustBeEnum = Type provided must be an Enum. +Arg_MustBeEnumBaseTypeOrEnum = The value passed in must be an enum base or an underlying type for an enum, such as an Int32. +Arg_MustBeGuid = Object must be of type GUID. +Arg_MustBeIdentityReferenceType = Type must be an IdentityReference, such as NTAccount or SecurityIdentifier. +Arg_MustBeInterface = Type passed must be an interface. +Arg_MustBeInt16 = Object must be of type Int16. +Arg_MustBeInt32 = Object must be of type Int32. +Arg_MustBeInt64 = Object must be of type Int64. +Arg_MustBePrimArray = Object must be an array of primitives. +Arg_MustBePointer = Type must be a Pointer. +Arg_MustBeStatic = Method must be a static method. +Arg_MustBeString = Object must be of type String. +Arg_MustBeStringPtrNotAtom = The pointer passed in as a String must not be in the bottom 64K of the process's address space. +Arg_MustBeSByte = Object must be of type SByte. +Arg_MustBeSingle = Object must be of type Single. +Arg_MustBeTimeSpan = Object must be of type TimeSpan. +Arg_MustBeType = Type must be a type provided by the runtime. +Arg_MustBeUInt16 = Object must be of type UInt16. +Arg_MustBeUInt32 = Object must be of type UInt32. +Arg_MustBeUInt64 = Object must be of type UInt64. +Arg_MustBeVersion = Object must be of type Version. +Arg_MustBeTrue = Argument must be true. +Arg_MustAllBeRuntimeType = At least one type argument is not a runtime type. +Arg_NamedParamNull = Named parameter value must not be null. +Arg_NamedParamTooBig = Named parameter array cannot be bigger than argument array. +Arg_Need1DArray = Array was not a one-dimensional array. +Arg_Need2DArray = Array was not a two-dimensional array. +Arg_Need3DArray = Array was not a three-dimensional array. +Arg_NeedAtLeast1Rank = Must provide at least one rank. +Arg_NoDefCTor = No parameterless constructor defined for this object. +Arg_BitArrayTypeUnsupported = Only supported array types for CopyTo on BitArrays are Boolean[], Int32[] and Byte[]. +Arg_DivideByZero = Attempted to divide by zero. +Arg_NoAccessSpec = Must specify binding flags describing the invoke operation required (BindingFlags.InvokeMethod CreateInstance GetField SetField GetProperty SetProperty). +Arg_NoStaticVirtual = Method cannot be both static and virtual. +Arg_NotFoundIFace = Interface not found. +Arg_ObjObjEx = Object of type '{0}' cannot be converted to type '{1}'. +Arg_ObjObj = Object type cannot be converted to target type. +Arg_FieldDeclTarget = Field '{0}' defined on type '{1}' is not a field on the target object which is of type '{2}'. +Arg_OleAutDateInvalid = Not a legal OleAut date. +Arg_OleAutDateScale = OleAut date did not convert to a DateTime correctly. +Arg_PlatformNotSupported = Operation is not supported on this platform. +Arg_PlatformSecureString = SecureString is only supported on Windows 2000 SP3 and higher platforms. +Arg_ParmCnt = Parameter count mismatch. +Arg_ParmArraySize = Must specify one or more parameters. +Arg_Path2IsRooted = Second path fragment must not be a drive or UNC name. +Arg_PathIsVolume = Path must not be a drive. +Arg_PrimWiden = Cannot widen from source type to target type either because the source type is a not a primitive type or the conversion cannot be accomplished. +Arg_NullIndex = Arrays indexes must be set to an object instance. +Arg_VarMissNull = Missing parameter does not have a default value. +Arg_PropSetInvoke = Cannot specify Set on a property and Invoke on a method. +Arg_PropNotFound = Could not find the specified property. +Arg_RankIndices = Indices length does not match the array rank. +Arg_RanksAndBounds = Number of lengths and lowerBounds must match. +Arg_RegSubKeyAbsent = Cannot delete a subkey tree because the subkey does not exist. +Arg_RemoveArgNotFound = Cannot remove the specified item because it was not found in the specified Collection. +Arg_RegKeyDelHive = Cannot delete a registry hive's subtree. +Arg_RegKeyNoRemoteConnect = No remote connection to '{0}' while trying to read the registry. +Arg_RegKeyOutOfRange = Registry HKEY was out of the legal range. +Arg_RegKeyNotFound = The specified registry key does not exist. +Arg_RegKeyStrLenBug = Registry key names should not be greater than 255 characters. +Arg_RegValStrLenBug = Registry value names should not be greater than 16,383 characters. +Arg_RegBadKeyKind = The specified RegistryValueKind is an invalid value. +Arg_RegGetOverflowBug = RegistryKey.GetValue does not allow a String that has a length greater than Int32.MaxValue. +Arg_RegSetMismatchedKind = The type of the value object did not match the specified RegistryValueKind or the object could not be properly converted. +Arg_RegSetBadArrType = RegistryKey.SetValue does not support arrays of type '{0}'. Only Byte[] and String[] are supported. +Arg_RegSetStrArrNull = RegistryKey.SetValue does not allow a String[] that contains a null String reference. +Arg_RegInvalidKeyName = Registry key name must start with a valid base key name. +Arg_ResMgrNotResSet = Type parameter must refer to a subclass of ResourceSet. +Arg_SetMethNotFnd = Property set method not found. +Arg_TypeRefPrimitve = TypedReferences cannot be redefined as primitives. +Arg_UnknownTypeCode = Unknown TypeCode value. +Arg_VersionString = Version string portion was too short or too long. +Arg_NoITypeInfo = Specified TypeInfo was invalid because it did not support the ITypeInfo interface. +Arg_NoITypeLib = Specified TypeLib was invalid because it did not support the ITypeLib interface. +Arg_NoImporterCallback = Specified type library importer callback was invalid because it did not support the ITypeLibImporterNotifySink interface. +Arg_ImporterLoadFailure = The type library importer encountered an error during type verification. Try importing without class members. +Arg_InvalidBase = Invalid Base. +Arg_EnumValueNotFound = Requested value '{0}' was not found. +Arg_EnumLitValueNotFound = Literal value was not found. +Arg_MustContainEnumInfo = Must specify valid information for parsing in the string. +Arg_InvalidSearchPattern = Search pattern cannot contain ".." to move up directories and can be contained only internally in file/directory names, as in "a..b". +Arg_NegativeArgCount = Argument count must not be negative. +Arg_InvalidAccessEntry = Specified access entry is invalid because it is unrestricted. The global flags should be specified instead. +Arg_InvalidFileName = Specified file name was invalid. +Arg_InvalidFileExtension = Specified file extension was not a valid extension. +Arg_COMException = Error HRESULT E_FAIL has been returned from a call to a COM component. +Arg_ExternalException = External component has thrown an exception. +Arg_InvalidComObjectException = Attempt has been made to use a COM object that does not have a backing class factory. +Arg_InvalidOleVariantTypeException = Specified OLE variant was invalid. +Arg_MarshalDirectiveException = Marshaling directives are invalid. +Arg_MarshalAsAnyRestriction = AsAny cannot be used on return types, ByRef parameters, ArrayWithOffset, or parameters passed from unmanaged to managed. +Arg_NDirectBadObject = No PInvoke conversion exists for value passed to Object-typed parameter. +Arg_SafeArrayTypeMismatchException = Specified array was not of the expected type. +Arg_VTableCallsNotSupportedException = Attempted to make an early bound call on a COM dispatch-only interface. +Arg_SafeArrayRankMismatchException = Specified array was not of the expected rank. +Arg_AmbiguousMatchException = Ambiguous match found. +Arg_CustomAttributeFormatException = Binary format of the specified custom attribute was invalid. +Arg_InvalidFilterCriteriaException = Specified filter criteria was invalid. +Arg_TypeLoadNullStr = A null or zero length string does not represent a valid Type. +Arg_TargetInvocationException = Exception has been thrown by the target of an invocation. +Arg_TargetParameterCountException = Number of parameters specified does not match the expected number. +Arg_TypeAccessException = Attempt to access the type failed. +Arg_TypeLoadException = Failure has occurred while loading a type. +Arg_TypeUnloadedException = Type had been unloaded. +Arg_ThreadStateException = Thread was in an invalid state for the operation being executed. +Arg_ThreadStartException = Thread failed to start. +Arg_WrongAsyncResult = IAsyncResult object did not come from the corresponding async method on this type. +Arg_WrongType = The value "{0}" is not of type "{1}" and cannot be used in this generic collection. +Argument_InvalidArgumentForComparison = Type of argument is not compatible with the generic comparer. +Argument_ALSInvalidCapacity = Specified capacity must not be less than the current capacity. +Argument_ALSInvalidSlot = Specified slot number was invalid. +Argument_IdnIllegalName = Decoded string is not a valid IDN name. +Argument_IdnBadBidi = Left to right characters may not be mixed with right to left characters in IDN labels. +Argument_IdnBadLabelSize = IDN labels must be between 1 and 63 characters long. +Argument_IdnBadNameSize = IDN names must be between 1 and {0} characters long. +Argument_IdnBadPunycode = Invalid IDN encoded string. +Argument_IdnBadStd3 = Label contains character '{0}' not allowed with UseStd3AsciiRules +Arg_InvalidANSIString = The ANSI string passed in could not be converted from the default ANSI code page to Unicode. +Arg_InvalidUTF8String = The UTF8 string passed in could not be converted to Unicode. +Argument_InvalidCharSequence = Invalid Unicode code point found at index {0}. +Argument_InvalidCharSequenceNoIndex = String contains invalid Unicode code points. +Argument_InvalidCalendar = Not a valid calendar for the given culture. +Argument_InvalidNormalizationForm = Invalid or unsupported normalization form. +Argument_InvalidPathChars = Illegal characters in path. +Argument_InvalidOffLen = Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection. +Argument_InvalidSeekOrigin = Invalid seek origin. +Argument_SeekOverflow = The specified seek offset '{0}' would result in a negative Stream position. +Argument_InvalidUnity = Invalid Unity type. +Argument_LongEnvVarName = Environment variable name cannot contain 1024 or more characters. +Argument_LongEnvVarValue = Environment variable name or value is too long. +Argument_StringFirstCharIsZero = The first char in the string is the null character. +Argument_OnlyMscorlib = Only mscorlib's assembly is valid. +Argument_PathEmpty = Path cannot be the empty string or all whitespace. +Argument_PathFormatNotSupported = The given path's format is not supported. +Argument_PathUriFormatNotSupported = URI formats are not supported. +Argument_TypeNameTooLong = Type name was too long. The fully qualified type name must be less than 1,024 characters. +Argument_StreamNotReadable = Stream was not readable. +Argument_StreamNotWritable = Stream was not writable. +Argument_InvalidNumberOfMembers = MemberData contains an invalid number of members. +Argument_InvalidValue = Value was invalid. +Argument_InvalidKey = Key was invalid. +Argument_MinMaxValue = '{0}' cannot be greater than {1}. +Argument_InvalidGroupSize = Every element in the value array should be between one and nine, except for the last element, which can be zero. +Argument_MustHaveAttributeBaseClass = Type passed in must be derived from System.Attribute or System.Attribute itself. +Argument_NoUninitializedStrings = Uninitialized Strings cannot be created. +Argument_UnequalMembers = Supplied MemberInfo does not match the expected type. +Argument_BadFormatSpecifier = Format specifier was invalid. +Argument_InvalidHighSurrogate = Found a high surrogate char without a following low surrogate at index: {0}. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters. +Argument_InvalidLowSurrogate = Found a low surrogate char without a preceding high surrogate at index: {0}. The input may not be in this encoding, or may not contain valid Unicode (UTF-16) characters. +Argument_UnmatchingSymScope = Non-matching symbol scope. +Argument_NotInExceptionBlock = Not currently in an exception block. +Argument_BadExceptionCodeGen = Incorrect code generation for exception block. +Argument_NotExceptionType = Does not extend Exception. +Argument_DuplicateResourceName = Duplicate resource name within an assembly. +Argument_BadPersistableModuleInTransientAssembly = Cannot have a persistable module in a transient assembly. +Argument_InvalidPermissionState = Invalid permission state. +Argument_UnrestrictedIdentityPermission = Identity permissions cannot be unrestricted. +Argument_WrongType = Operation on type '{0}' attempted with target of incorrect type. +Argument_IllegalZone = Illegal security permission zone specified. +Argument_HasToBeArrayClass = Must be an array type. +Argument_InvalidDirectory = Invalid directory, '{0}'. +Argument_DataLengthDifferent = Parameters 'members' and 'data' must have the same length. +Argument_SigIsFinalized = Completed signature cannot be modified. +Argument_ArraysInvalid = Array or pointer types are not valid. +Argument_GenericsInvalid = Generic types are not valid. +Argument_LargeInteger = Integer or token was too large to be encoded. +Argument_BadSigFormat = Incorrect signature format. +Argument_UnmatchedMethodForLocal = Local passed in does not belong to this ILGenerator. +Argument_DuplicateName = Tried to add NamedPermissionSet with non-unique name. +Argument_InvalidXMLElement = Invalid XML. Missing required tag <{0}> for type '{1}'. +Argument_InvalidXMLMissingAttr = Invalid XML. Missing required attribute '{0}'. +Argument_CannotGetTypeTokenForByRef = Cannot get TypeToken for a ByRef type. +Argument_NotASimpleNativeType = The UnmanagedType passed to DefineUnmanagedMarshal is not a simple type. None of the following values may be used: UnmanagedType.ByValTStr, UnmanagedType.SafeArray, UnmanagedType.ByValArray, UnmanagedType.LPArray, UnmanagedType.CustomMarshaler. +Argument_NotACustomMarshaler = Not a custom marshal. +Argument_NoUnmanagedElementCount = Unmanaged marshal does not have ElementCount. +Argument_NoNestedMarshal = Only LPArray or SafeArray has nested unmanaged marshal. +Argument_InvalidXML = Invalid Xml. +Argument_NoUnderlyingCCW = The object has no underlying COM data associated with it. +Argument_BadFieldType = Bad field type in defining field. +Argument_InvalidXMLBadVersion = Invalid Xml - can only parse elements of version one. +Argument_NotAPermissionElement = 'elem' was not a permission element. +Argument_NPMSInvalidName = Name can be neither null nor empty. +Argument_InvalidElementTag = Invalid element tag '{0}'. +Argument_InvalidElementText = Invalid element text '{0}'. +Argument_InvalidElementName = Invalid element name '{0}'. +Argument_InvalidElementValue = Invalid element value '{0}'. +Argument_AttributeNamesMustBeUnique = Attribute names must be unique. +Argument_InvalidHexFormat = Improperly formatted hex string. +Argument_InvalidSite = Invalid site. +Argument_InterfaceMap = 'this' type cannot be an interface itself. +Argument_ArrayGetInterfaceMap = Interface maps for generic interfaces on arrays cannot be retrieved. +Argument_InvalidName = Invalid name. +Argument_InvalidDirectoryOnUrl = Invalid directory on URL. +Argument_InvalidUrl = Invalid URL. +Argument_InvalidKindOfTypeForCA = This type cannot be represented as a custom attribute. +Argument_MustSupplyContainer = When supplying a FieldInfo for fixing up a nested type, a valid ID for that containing object must also be supplied. +Argument_MustSupplyParent = When supplying the ID of a containing object, the FieldInfo that identifies the current field within that object must also be supplied. +Argument_NoClass = Element does not specify a class. +Argument_WrongElementType = '{0}' element required. +Argument_UnableToGeneratePermissionSet = Unable to generate permission set; input XML may be malformed. +Argument_NoEra = No Era was supplied. +Argument_AssemblyAlreadyFullTrust = Assembly was already fully trusted. +Argument_AssemblyNotFullTrust = Assembly was not fully trusted. +Argument_AssemblyWinMD = Assembly must not be a Windows Runtime assembly. +Argument_MemberAndArray = Cannot supply both a MemberInfo and an Array to indicate the parent of a value type. +Argument_ObjNotComObject = The object's type must be __ComObject or derived from __ComObject. +Argument_ObjIsWinRTObject = The object's type must not be a Windows Runtime type. +Argument_TypeNotComObject = The type must be __ComObject or be derived from __ComObject. +Argument_TypeIsWinRTType = The type must not be a Windows Runtime type. +Argument_CantCallSecObjFunc = Cannot evaluate a security function. +Argument_StructMustNotBeValueClass = The structure must not be a value class. +Argument_NoSpecificCulture = Please select a specific culture, such as zh-CN, zh-HK, zh-TW, zh-MO, zh-SG. +Argument_InvalidResourceCultureName = The given culture name '{0}' cannot be used to locate a resource file. Resource filenames must consist of only letters, numbers, hyphens or underscores. +Argument_InvalidParamInfo = Invalid type for ParameterInfo member in Attribute class. +Argument_EmptyDecString = Decimal separator cannot be the empty string. +Argument_OffsetOfFieldNotFound = Field passed in is not a marshaled member of the type '{0}'. +Argument_EmptyStrongName = StrongName cannot have an empty string for the assembly name. +Argument_NotSerializable = Argument passed in is not serializable. +Argument_EmptyApplicationName = ApplicationId cannot have an empty string for the name. +Argument_NoDomainManager = The domain manager specified by the host could not be instantiated. +Argument_NoMain = Main entry point not defined. +Argument_InvalidDateTimeKind = Invalid DateTimeKind value. +Argument_ConflictingDateTimeStyles = The DateTimeStyles values AssumeLocal and AssumeUniversal cannot be used together. +Argument_ConflictingDateTimeRoundtripStyles = The DateTimeStyles value RoundtripKind cannot be used with the values AssumeLocal, AssumeUniversal or AdjustToUniversal. +Argument_InvalidDigitSubstitution = The DigitSubstitution property must be of a valid member of the DigitShapes enumeration. Valid entries include Context, NativeNational or None. +Argument_InvalidNativeDigitCount = The NativeDigits array must contain exactly ten members. +Argument_InvalidNativeDigitValue = Each member of the NativeDigits array must be a single text element (one or more UTF16 code points) with a Unicode Nd (Number, Decimal Digit) property indicating it is a digit. +ArgumentException_InvalidAceBinaryForm = The binary form of an ACE object is invalid. +ArgumentException_InvalidAclBinaryForm = The binary form of an ACL object is invalid. +ArgumentException_InvalidSDSddlForm = The SDDL form of a security descriptor object is invalid. +Argument_InvalidSafeHandle = The SafeHandle is invalid. +Argument_CannotPrepareAbstract = Abstract methods cannot be prepared. +Argument_ArrayTooLarge = The input array length must not exceed Int32.MaxValue / {0}. Otherwise BitArray.Length would exceed Int32.MaxValue. +Argument_RelativeUrlMembershipCondition = UrlMembershipCondition requires an absolute URL. +Argument_EmptyWaithandleArray = Waithandle array may not be empty. +Argument_InvalidSafeBufferOffLen = Offset and length were greater than the size of the SafeBuffer. +Argument_NotEnoughBytesToRead = There are not enough bytes remaining in the accessor to read at this position. +Argument_NotEnoughBytesToWrite = There are not enough bytes remaining in the accessor to write at this position. +Argument_OffsetAndLengthOutOfBounds = Offset and length were out of bounds for the array or count is greater than the number of elements from index to the end of the source collection. +Argument_OffsetAndCapacityOutOfBounds = Offset and capacity were greater than the size of the view. +Argument_UnmanagedMemAccessorWrapAround = The UnmanagedMemoryAccessor capacity and offset would wrap around the high end of the address space. +Argument_UnrecognizedLoaderOptimization = Unrecognized LOADER_OPTIMIZATION property value. Supported values may include "SingleDomain", "MultiDomain", "MultiDomainHost", and "NotSpecified". +ArgumentException_NotAllCustomSortingFuncsDefined = Implementations of all the NLS functions must be provided. +ArgumentException_MinSortingVersion = The runtime does not support a version of "{0}" less than {1}. +Argument_PreAllocatedAlreadyAllocated = 'preAllocated' is already in use. +Argument_NativeOverlappedWrongBoundHandle = 'overlapped' was not allocated by this ThreadPoolBoundHandle instance. +Argument_NativeOverlappedAlreadyFree = 'overlapped' has already been freed. +Argument_AlreadyBoundOrSyncHandle = 'handle' has already been bound to the thread pool, or was not opened for asynchronous I/O. +Argument_InvalidTypeWithPointersNotSupported = Cannot use type '{0}'. Only value types without pointers or references are supported. +Argument_DestinationTooShort = Destination is too short. + +; +; ===================================================== +; Reflection Emit resource strings +Arugment_EmitMixedContext1 = Type '{0}' was loaded in the ReflectionOnly context but the AssemblyBuilder was not created as AssemblyBuilderAccess.ReflectionOnly. +Arugment_EmitMixedContext2 = Type '{0}' was not loaded in the ReflectionOnly context but the AssemblyBuilder was created as AssemblyBuilderAccess.ReflectionOnly. +Argument_BadSizeForData = Data size must be > 0 and < 0x3f0000 +Argument_InvalidLabel = Invalid Label. +Argument_RedefinedLabel = Label multiply defined. +Argument_UnclosedExceptionBlock = The IL Generator cannot be used while there are unclosed exceptions. +Argument_MissingDefaultConstructor = was missing default constructor. +Argument_TooManyFinallyClause = Exception blocks may have at most one finally clause. +Argument_NotInTheSameModuleBuilder = The argument passed in was not from the same ModuleBuilder. +Argument_BadCurrentLocalVariable = Bad current local variable for setting symbol information. +Argument_DuplicateModuleName = Duplicate dynamic module name within an assembly. +Argument_DuplicateTypeName = Duplicate type name within an assembly. +Argument_InvalidAssemblyName = Assembly names may not begin with whitespace or contain the characters '/', or '\\' or ':'. +Argument_InvalidGenericInstantiation = The given generic instantiation was invalid. +Argument_DuplicatedFileName = Duplicate file names. +Argument_GlobalFunctionHasToBeStatic = Global members must be static. +Argument_BadPInvokeOnInterface = PInvoke methods cannot exist on interfaces. +Argument_BadPInvokeMethod = PInvoke methods must be static and native and cannot be abstract. +Argument_MethodRedefined = Method has been already defined. +Argument_BadTypeAttrAbstractNFinal = Bad type attributes. A type cannot be both abstract and final. +Argument_BadTypeAttrNestedVisibilityOnNonNestedType = Bad type attributes. Nested visibility flag set on a non-nested type. +Argument_BadTypeAttrNonNestedVisibilityNestedType = Bad type attributes. Non-nested visibility flag set on a nested type. +Argument_BadTypeAttrInvalidLayout = Bad type attributes. Invalid layout attribute specified. +Argument_BadTypeAttrReservedBitsSet = Bad type attributes. Reserved bits set on the type. +Argument_BadFieldSig = Field signatures do not have return types. +Argument_ShouldOnlySetVisibilityFlags = Should only set visibility flags when creating EnumBuilder. +Argument_BadNestedTypeFlags = Visibility of interfaces must be one of the following: NestedAssembly, NestedFamANDAssem, NestedFamily, NestedFamORAssem, NestedPrivate or NestedPublic. +Argument_ShouldNotSpecifyExceptionType = Should not specify exception type for catch clause for filter block. +Argument_BadLabel = Bad label in ILGenerator. +Argument_BadLabelContent = Bad label content in ILGenerator. +Argument_EmitWriteLineType = EmitWriteLine does not support this field or local type. +Argument_ConstantNull = Null is not a valid constant value for this type. +Argument_ConstantDoesntMatch = Constant does not match the defined type. +Argument_ConstantNotSupported = {0} is not a supported constant type. +Argument_BadConstructor = Cannot have private or static constructor. +Argument_BadConstructorCallConv = Constructor must have standard calling convention. +Argument_BadPropertyForConstructorBuilder = Property must be on the same type of the given ConstructorInfo. +Argument_NotAWritableProperty = Not a writable property. +Argument_BadFieldForConstructorBuilder = Field must be on the same type of the given ConstructorInfo. +Argument_BadAttributeOnInterfaceMethod = Interface method must be abstract and virtual. +ArgumentException_BadMethodImplBody = MethodOverride's body must be from this type. +Argument_BadParameterCountsForConstructor = Parameter count does not match passed in argument value count. +Argument_BadParameterTypeForConstructor = Passed in argument value at index {0} does not match the parameter type. +Argument_BadTypeInCustomAttribute = An invalid type was used as a custom attribute constructor argument, field or property. +Argument_DateTimeBadBinaryData = The binary data must result in a DateTime with ticks between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. +Argument_VerStringTooLong = The unmanaged Version information is too large to persist. +Argument_UnknownUnmanagedCallConv = Unknown unmanaged calling convention for function signature. +Argument_BadConstantValue = Bad default value. +Argument_IllegalName = Illegal name. +Argument_cvtres_NotFound = Cannot find cvtres.exe +Argument_BadCAForUnmngRSC = Bad '{0}' while generating unmanaged resource information. +Argument_MustBeInterfaceMethod = The MemberInfo must be an interface method. +Argument_CORDBBadVarArgCallConv = Cannot evaluate a VarArgs function. +Argument_CORDBBadMethod = Cannot find the method on the object instance. +Argument_InvalidOpCodeOnDynamicMethod = Ldtoken, Ldftn and Ldvirtftn OpCodes cannot target DynamicMethods. +Argument_InvalidTypeForDynamicMethod = Invalid type owner for DynamicMethod. +Argument_NeedGenericMethodDefinition = Method must represent a generic method definition on a generic type definition. +Argument_MethodNeedGenericDeclaringType = The specified method cannot be dynamic or global and must be declared on a generic type definition. +Argument_ConstructorNeedGenericDeclaringType = The specified constructor must be declared on a generic type definition. +Argument_FieldNeedGenericDeclaringType = The specified field must be declared on a generic type definition. +Argument_InvalidMethodDeclaringType = The specified method must be declared on the generic type definition of the specified type. +Argument_InvalidConstructorDeclaringType = The specified constructor must be declared on the generic type definition of the specified type. +Argument_InvalidFieldDeclaringType = The specified field must be declared on the generic type definition of the specified type. +Argument_NeedNonGenericType = The specified Type must not be a generic type definition. +Argument_MustBeTypeBuilder = 'type' must contain a TypeBuilder as a generic argument. +Argument_CannotSetParentToInterface = Cannot set parent to an interface. +Argument_MismatchedArrays = Two arrays, {0} and {1}, must be of the same size. +Argument_NeedNonGenericObject = The specified object must not be an instance of a generic type. +Argument_NeedStructWithNoRefs = The specified Type must be a struct containing no references. +Argument_NotMethodCallOpcode = The specified opcode cannot be passed to EmitCall. + +; ===================================================== +; +Argument_ModuleAlreadyLoaded = The specified module has already been loaded. +Argument_MustHaveLayoutOrBeBlittable = The specified structure must be blittable or have layout information. +Argument_NotSimpleFileName = The filename must not include a path specification. +Argument_TypeMustBeVisibleFromCom = The specified type must be visible from COM. +Argument_TypeMustBeComCreatable = The type must be creatable from COM. +Argument_TypeMustNotBeComImport = The type must not be imported from COM. +Argument_PolicyFileDoesNotExist = The requested policy file does not exist. +Argument_NonNullObjAndCtx = Either obj or ctx must be null. +Argument_NoModuleFileExtension = Module file name '{0}' must have file extension. +Argument_TypeDoesNotContainMethod = Type does not contain the given method. +Argument_StringZeroLength = String cannot be of zero length. +Argument_MustBeString = String is too long or has invalid contents. +Argument_AbsolutePathRequired = Absolute path information is required. +Argument_ManifestFileDoesNotExist = The specified manifest file does not exist. +Argument_MustBeRuntimeType = Type must be a runtime Type object. +Argument_TypeNotValid = The Type object is not valid. +Argument_MustBeRuntimeMethodInfo = MethodInfo must be a runtime MethodInfo object. +Argument_MustBeRuntimeFieldInfo = FieldInfo must be a runtime FieldInfo object. +Argument_InvalidFieldInfo = The FieldInfo object is not valid. +Argument_InvalidConstructorInfo = The ConstructorInfo object is not valid. +Argument_MustBeRuntimeAssembly = Assembly must be a runtime Assembly object. +Argument_MustBeRuntimeModule = Module must be a runtime Module object. +Argument_MustBeRuntimeParameterInfo = ParameterInfo must be a runtime ParameterInfo object. +Argument_InvalidParameterInfo = The ParameterInfo object is not valid. +Argument_MustBeRuntimeReflectionObject = The object must be a runtime Reflection object. +Argument_InvalidMarshalByRefObject = The MarshalByRefObject is not valid. +Argument_TypedReferenceInvalidField = Field in TypedReferences cannot be static or init only. +Argument_HandleLeak = Cannot pass a GCHandle across AppDomains. +Argument_ArgumentZero = Argument cannot be zero. +Argument_ImproperType = Improper types in collection. +Argument_NotAMembershipCondition = The type does not implement IMembershipCondition +Argument_NotAPermissionType = The type does not implement IPermission +Argument_NotACodeGroupType = The type does not inherit from CodeGroup +Argument_NotATP = Type must be a TransparentProxy +Argument_AlreadyACCW = The object already has a CCW associated with it. +Argument_OffsetLocalMismatch = The UTC Offset of the local dateTime parameter does not match the offset argument. +Argument_OffsetUtcMismatch = The UTC Offset for Utc DateTime instances must be 0. +Argument_UTCOutOfRange = The UTC time represented when the offset is applied must be between year 0 and 10,000. +Argument_OffsetOutOfRange = Offset must be within plus or minus 14 hours. +Argument_OffsetPrecision = Offset must be specified in whole minutes. +Argument_FlagNotSupported = One or more flags are not supported. +Argument_MustBeFalse = Argument must be initialized to false +Argument_ToExclusiveLessThanFromExclusive = fromInclusive must be less than or equal to toExclusive. +Argument_FrameworkNameTooShort=FrameworkName cannot have less than two components or more than three components. +Argument_FrameworkNameInvalid=FrameworkName is invalid. +Argument_FrameworkNameMissingVersion=FrameworkName version component is missing. +#if FEATURE_COMINTEROP +Argument_TypeNotActivatableViaWindowsRuntime = Type '{0}' does not have an activation factory because it is not activatable by Windows Runtime. +Argument_WinRTSystemRuntimeType = Cannot marshal type '{0}' to Windows Runtime. Only 'System.RuntimeType' is supported. +Argument_Unexpected_TypeSource = Unexpected TypeKind when marshaling Windows.Foundation.TypeName. +#endif // FEATURE_COMINTEROP + +; ArgumentNullException +ArgumentNull_Array = Array cannot be null. +ArgumentNull_ArrayValue = Found a null value within an array. +ArgumentNull_ArrayElement = At least one element in the specified array was null. +ArgumentNull_Assembly = Assembly cannot be null. +ArgumentNull_AssemblyName = AssemblyName cannot be null. +ArgumentNull_AssemblyNameName = AssemblyName.Name cannot be null or an empty string. +ArgumentNull_Buffer = Buffer cannot be null. +ArgumentNull_Collection = Collection cannot be null. +ArgumentNull_CultureInfo = CultureInfo cannot be null. +ArgumentNull_Dictionary = Dictionary cannot be null. +ArgumentNull_FileName = File name cannot be null. +ArgumentNull_Key = Key cannot be null. +ArgumentNull_Graph = Object Graph cannot be null. +ArgumentNull_Path = Path cannot be null. +ArgumentNull_Stream = Stream cannot be null. +ArgumentNull_String = String reference not set to an instance of a String. +ArgumentNull_Type = Type cannot be null. +ArgumentNull_Obj = Object cannot be null. +ArgumentNull_GUID = GUID cannot be null. +ArgumentNull_NullMember = Member at position {0} was null. +ArgumentNull_Generic = Value cannot be null. +ArgumentNull_WithParamName = Parameter '{0}' cannot be null. +ArgumentNull_Child = Cannot have a null child. +ArgumentNull_SafeHandle = SafeHandle cannot be null. +ArgumentNull_CriticalHandle = CriticalHandle cannot be null. +ArgumentNull_TypedRefType = Type in TypedReference cannot be null. +ArgumentNull_ApplicationTrust = The application trust cannot be null. +ArgumentNull_TypeRequiredByResourceScope = The type parameter cannot be null when scoping the resource's visibility to Private or Assembly. +ArgumentNull_Waithandles = The waitHandles parameter cannot be null. + +; ArgumentOutOfRangeException +ArgumentOutOfRange_AddressSpace = The number of bytes cannot exceed the virtual address space on a 32 bit machine. +ArgumentOutOfRange_ArrayLB = Number was less than the array's lower bound in the first dimension. +ArgumentOutOfRange_ArrayLBAndLength = Higher indices will exceed Int32.MaxValue because of large lower bound and/or length. +ArgumentOutOfRange_ArrayLength = The length of the array must be between {0} and {1}, inclusive. +ArgumentOutOfRange_ArrayLengthMultiple = The length of the array must be a multiple of {0}. +ArgumentOutOfRange_ArrayListInsert = Insertion index was out of range. Must be non-negative and less than or equal to size. +ArgumentOutOfRange_ArrayTooSmall = Destination array is not long enough to copy all the required data. Check array length and offset. +ArgumentOutOfRange_BeepFrequency = Console.Beep's frequency must be between {0} and {1}. +ArgumentOutOfRange_BiggerThanCollection = Larger than collection size. +ArgumentOutOfRange_Bounds_Lower_Upper = Argument must be between {0} and {1}. +ArgumentOutOfRange_Count = Count must be positive and count must refer to a location within the string/array/collection. +ArgumentOutOfRange_CalendarRange = Specified time is not supported in this calendar. It should be between {0} (Gregorian date) and {1} (Gregorian date), inclusive. +ArgumentOutOfRange_ConsoleBufferBoundaries = The value must be greater than or equal to zero and less than the console's buffer size in that dimension. +ArgumentOutOfRange_ConsoleBufferLessThanWindowSize = The console buffer size must not be less than the current size and position of the console window, nor greater than or equal to Int16.MaxValue. +ArgumentOutOfRange_ConsoleWindowBufferSize = The new console window size would force the console buffer size to be too large. +ArgumentOutOfRange_ConsoleTitleTooLong = The console title is too long. +ArgumentOutOfRange_ConsoleWindowPos = The window position must be set such that the current window size fits within the console's buffer, and the numbers must not be negative. +ArgumentOutOfRange_ConsoleWindowSize_Size = The value must be less than the console's current maximum window size of {0} in that dimension. Note that this value depends on screen resolution and the console font. +ArgumentOutOfRange_ConsoleKey = Console key values must be between 0 and 255. +ArgumentOutOfRange_CursorSize = The cursor size is invalid. It must be a percentage between 1 and 100. +ArgumentOutOfRange_BadYearMonthDay = Year, Month, and Day parameters describe an un-representable DateTime. +ArgumentOutOfRange_BadHourMinuteSecond = Hour, Minute, and Second parameters describe an un-representable DateTime. +ArgumentOutOfRange_DateArithmetic = The added or subtracted value results in an un-representable DateTime. +ArgumentOutOfRange_DateTimeBadMonths = Months value must be between +/-120000. +ArgumentOutOfRange_DateTimeBadYears = Years value must be between +/-10000. +ArgumentOutOfRange_DateTimeBadTicks = Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. +ArgumentOutOfRange_Day = Day must be between 1 and {0} for month {1}. +ArgumentOutOfRange_DecimalRound = Decimal can only round to between 0 and 28 digits of precision. +ArgumentOutOfRange_DecimalScale = Decimal's scale value must be between 0 and 28, inclusive. +ArgumentOutOfRange_Era = Time value was out of era range. +ArgumentOutOfRange_Enum = Enum value was out of legal range. +ArgumentOutOfRange_FileLengthTooBig = Specified file length was too large for the file system. +ArgumentOutOfRange_FileTimeInvalid = Not a valid Win32 FileTime. +ArgumentOutOfRange_GetByteCountOverflow = Too many characters. The resulting number of bytes is larger than what can be returned as an int. +ArgumentOutOfRange_GetCharCountOverflow = Too many bytes. The resulting number of chars is larger than what can be returned as an int. +ArgumentOutOfRange_HashtableLoadFactor = Load factor needs to be between 0.1 and 1.0. +ArgumentOutOfRange_HugeArrayNotSupported = Arrays larger than 2GB are not supported. +ArgumentOutOfRange_InvalidHighSurrogate = A valid high surrogate character is between 0xd800 and 0xdbff, inclusive. +ArgumentOutOfRange_InvalidLowSurrogate = A valid low surrogate character is between 0xdc00 and 0xdfff, inclusive. +ArgumentOutOfRange_InvalidEraValue = Era value was not valid. +ArgumentOutOfRange_InvalidUserDefinedAceType = User-defined ACEs must not have a well-known ACE type. +ArgumentOutOfRange_InvalidUTF32 = A valid UTF32 value is between 0x000000 and 0x10ffff, inclusive, and should not include surrogate codepoint values (0x00d800 ~ 0x00dfff). +ArgumentOutOfRange_Index = Index was out of range. Must be non-negative and less than the size of the collection. +ArgumentOutOfRange_IndexString = Index was out of range. Must be non-negative and less than the length of the string. +ArgumentOutOfRange_StreamLength = Stream length must be non-negative and less than 2^31 - 1 - origin. +ArgumentOutOfRange_LessEqualToIntegerMaxVal = Argument must be less than or equal to 2^31 - 1 milliseconds. +ArgumentOutOfRange_Month = Month must be between one and twelve. +ArgumentOutOfRange_MustBeNonNegInt32 = Value must be non-negative and less than or equal to Int32.MaxValue. +ArgumentOutOfRange_NeedNonNegNum = Non-negative number required. +ArgumentOutOfRange_NeedNonNegOrNegative1 = Number must be either non-negative and less than or equal to Int32.MaxValue or -1. +ArgumentOutOfRange_NeedPosNum = Positive number required. +ArgumentOutOfRange_NegativeCapacity = Capacity must be positive. +ArgumentOutOfRange_NegativeCount = Count cannot be less than zero. +ArgumentOutOfRange_NegativeLength = Length cannot be less than zero. +ArgumentOutOfRange_NegFileSize = Length must be non-negative. +ArgumentOutOfRange_ObjectID = objectID cannot be less than or equal to zero. +ArgumentOutOfRange_SmallCapacity = capacity was less than the current size. +ArgumentOutOfRange_QueueGrowFactor = Queue grow factor must be between {0} and {1}. +ArgumentOutOfRange_RoundingDigits = Rounding digits must be between 0 and 15, inclusive. +ArgumentOutOfRange_StartIndex = StartIndex cannot be less than zero. +ArgumentOutOfRange_MustBePositive = '{0}' must be greater than zero. +ArgumentOutOfRange_MustBeNonNegNum = '{0}' must be non-negative. +ArgumentOutOfRange_LengthGreaterThanCapacity = The length cannot be greater than the capacity. +ArgumentOutOfRange_ListInsert = Index must be within the bounds of the List. +ArgumentOutOfRange_StartIndexLessThanLength = startIndex must be less than length of string. +ArgumentOutOfRange_StartIndexLargerThanLength = startIndex cannot be larger than length of string. +ArgumentOutOfRange_EndIndexStartIndex = endIndex cannot be greater than startIndex. +ArgumentOutOfRange_IndexCount = Index and count must refer to a location within the string. +ArgumentOutOfRange_IndexCountBuffer = Index and count must refer to a location within the buffer. +ArgumentOutOfRange_IndexLength = Index and length must refer to a location within the string. +ArgumentOutOfRange_InvalidThreshold = The specified threshold for creating dictionary is out of range. +ArgumentOutOfRange_Capacity = Capacity exceeds maximum capacity. +ArgumentOutOfRange_Length = The specified length exceeds maximum capacity of SecureString. +ArgumentOutOfRange_LengthTooLarge = The specified length exceeds the maximum value of {0}. +ArgumentOutOfRange_SmallMaxCapacity = MaxCapacity must be one or greater. +ArgumentOutOfRange_GenericPositive = Value must be positive. +ArgumentOutOfRange_Range = Valid values are between {0} and {1}, inclusive. +ArgumentOutOfRange_AddValue = Value to add was out of range. +ArgumentOutOfRange_OffsetLength = Offset and length must refer to a position in the string. +ArgumentOutOfRange_OffsetOut = Either offset did not refer to a position in the string, or there is an insufficient length of destination character array. +ArgumentOutOfRange_PartialWCHAR = Pointer startIndex and length do not refer to a valid string. +ArgumentOutOfRange_ParamSequence = The specified parameter index is not in range. +ArgumentOutOfRange_Version = Version's parameters must be greater than or equal to zero. +ArgumentOutOfRange_TimeoutTooLarge = Time-out interval must be less than 2^32-2. +ArgumentOutOfRange_UIntPtrMax-1 = The length of the buffer must be less than the maximum UIntPtr value for your platform. +ArgumentOutOfRange_UnmanagedMemStreamLength = UnmanagedMemoryStream length must be non-negative and less than 2^63 - 1 - baseAddress. +ArgumentOutOfRange_UnmanagedMemStreamWrapAround = The UnmanagedMemoryStream capacity would wrap around the high end of the address space. +ArgumentOutOfRange_PeriodTooLarge = Period must be less than 2^32-2. +ArgumentOutOfRange_Year = Year must be between 1 and 9999. +ArgumentOutOfRange_BinaryReaderFillBuffer = The number of bytes requested does not fit into BinaryReader's internal buffer. +ArgumentOutOfRange_PositionLessThanCapacityRequired = The position may not be greater or equal to the capacity of the accessor. + +; ArithmeticException +Arithmetic_NaN = Function does not accept floating point Not-a-Number values. + +; ArrayTypeMismatchException +ArrayTypeMismatch_CantAssignType = Source array type cannot be assigned to destination array type. +ArrayTypeMismatch_ConstrainedCopy = Array.ConstrainedCopy will only work on array types that are provably compatible, without any form of boxing, unboxing, widening, or casting of each array element. Change the array types (i.e., copy a Derived[] to a Base[]), or use a mitigation strategy in the CER for Array.Copy's less powerful reliability contract, such as cloning the array or throwing away the potentially corrupt destination array. + +; BadImageFormatException +BadImageFormat_ResType&SerBlobMismatch = The type serialized in the .resources file was not the same type that the .resources file said it contained. Expected '{0}' but read '{1}'. +BadImageFormat_ResourcesIndexTooLong = Corrupt .resources file. String for name index '{0}' extends past the end of the file. +BadImageFormat_ResourcesNameTooLong = Corrupt .resources file. Resource name extends past the end of the file. +BadImageFormat_ResourcesNameInvalidOffset = Corrupt .resources file. Invalid offset '{0}' into name section. +BadImageFormat_ResourcesHeaderCorrupted = Corrupt .resources file. Unable to read resources from this file because of invalid header information. Try regenerating the .resources file. +BadImageFormat_ResourceNameCorrupted = Corrupt .resources file. A resource name extends past the end of the stream. +BadImageFormat_ResourceNameCorrupted_NameIndex = Corrupt .resources file. The resource name for name index {0} extends past the end of the stream. +BadImageFormat_ResourceDataLengthInvalid = Corrupt .resources file. The specified data length '{0}' is not a valid position in the stream. +BadImageFormat_TypeMismatch = Corrupt .resources file. The specified type doesn't match the available data in the stream. +BadImageFormat_InvalidType = Corrupt .resources file. The specified type doesn't exist. +BadImageFormat_ResourcesIndexInvalid = Corrupt .resources file. The resource index '{0}' is outside the valid range. +BadImageFormat_StreamPositionInvalid = Corrupt .resources file. The specified position '{0}' is not a valid position in the stream. +BadImageFormat_ResourcesDataInvalidOffset = Corrupt .resources file. Invalid offset '{0}' into data section. +BadImageFormat_NegativeStringLength = Corrupt .resources file. String length must be non-negative. +BadImageFormat_ParameterSignatureMismatch = The parameters and the signature of the method don't match. +BadImageFormat_BadILFormat = Bad IL format. + +; Cryptography +; These strings still appear in bcl.small but should go away eventually +Cryptography_CSSM_Error = Error 0x{0} from the operating system security framework: '{1}'. +Cryptography_CSSM_Error_Unknown = Error 0x{0} from the operating system security framework. +Cryptography_InvalidDSASignatureSize = Length of the DSA signature was not 40 bytes. +Cryptography_InvalidHandle = {0} is an invalid handle. +Cryptography_InvalidOID = Object identifier (OID) is unknown. +Cryptography_OAEPDecoding = Error occurred while decoding OAEP padding. +Cryptography_PasswordDerivedBytes_InvalidIV = The Initialization vector should have the same length as the algorithm block size in bytes. +Cryptography_SSE_InvalidDataSize = Length of the data to encrypt is invalid. +Cryptography_X509_ExportFailed = The certificate export operation failed. +Cryptography_X509_InvalidContentType = Invalid content type. +Cryptography_CryptoStream_FlushFinalBlockTwice = FlushFinalBlock() method was called twice on a CryptoStream. It can only be called once. +Cryptography_HashKeySet = Hash key cannot be changed after the first write to the stream. +Cryptography_HashNotYetFinalized = Hash must be finalized before the hash value is retrieved. +Cryptography_InsufficientBuffer = Input buffer contains insufficient data. +Cryptography_InvalidBlockSize = Specified block size is not valid for this algorithm. +Cryptography_InvalidCipherMode = Specified cipher mode is not valid for this algorithm. +Cryptography_InvalidIVSize = Specified initialization vector (IV) does not match the block size for this algorithm. +Cryptography_InvalidKeySize = Specified key is not a valid size for this algorithm. +Cryptography_PasswordDerivedBytes_FewBytesSalt = Salt is not at least eight bytes. +Cryptography_PKCS7_InvalidPadding = Padding is invalid and cannot be removed. +Cryptography_UnknownHashAlgorithm='{0}' is not a known hash algorithm. + +; EventSource +EventSource_ToString = EventSource({0}, {1}) +EventSource_EventSourceGuidInUse = An instance of EventSource with Guid {0} already exists. +EventSource_KeywordNeedPowerOfTwo = Value {0} for keyword {1} needs to be a power of 2. +EventSource_UndefinedKeyword = Use of undefined keyword value {0} for event {1}. +EventSource_UnsupportedEventTypeInManifest = Unsupported type {0} in event source. +EventSource_ListenerNotFound = Listener not found. +EventSource_ListenerCreatedInsideCallback = Creating an EventListener inside a EventListener callback. +EventSource_AttributeOnNonVoid = Event attribute placed on method {0} which does not return 'void'. +EventSource_NeedPositiveId = Event IDs must be positive integers. +EventSource_ReservedOpcode = Opcode values less than 11 are reserved for system use. +EventSource_ReservedKeywords = Keywords values larger than 0x0000100000000000 are reserved for system use +EventSource_PayloadTooBig=The payload for a single event is too large. +EventSource_NoFreeBuffers=No Free Buffers available from the operating system (e.g. event rate too fast). +EventSource_NullInput=Null passed as a event argument. +EventSource_TooManyArgs=Too many arguments. +EventSource_SessionIdError=Bit position in AllKeywords ({0}) must equal the command argument named "EtwSessionKeyword" ({1}). +EventSource_EnumKindMismatch = The type of {0} is not expected in {1}. +EventSource_MismatchIdToWriteEvent = Event {0} is givien event ID {1} but {2} was passed to WriteEvent. +EventSource_EventIdReused = Event {0} has ID {1} which is already in use. +EventSource_EventNameReused = Event name {0} used more than once. If you wish to overload a method, the overloaded method should have a NonEvent attribute. +EventSource_UndefinedChannel = Use of undefined channel value {0} for event {1}. +EventSource_UndefinedOpcode = Use of undefined opcode value {0} for event {1}. +ArgumentOutOfRange_MaxArgExceeded = The total number of parameters must not exceed {0}. +ArgumentOutOfRange_MaxStringsExceeded = The number of String parameters must not exceed {0}. +ArgumentOutOfRange_NeedValidId = The ID parameter must be in the range {0} through {1}. +EventSource_NeedGuid = The Guid of an EventSource must be non zero. +EventSource_NeedName = The name of an EventSource must not be null. +EventSource_EtwAlreadyRegistered = The provider has already been registered with the operating system. +EventSource_ListenerWriteFailure = An error occurred when writing to a listener. +EventSource_TypeMustDeriveFromEventSource = Event source types must derive from EventSource. +EventSource_TypeMustBeSealedOrAbstract = Event source types must be sealed or abstract. +EventSource_TaskOpcodePairReused = Event {0} (with ID {1}) has the same task/opcode pair as event {2} (with ID {3}). +EventSource_EventMustHaveTaskIfNonDefaultOpcode = Event {0} (with ID {1}) has a non-default opcode but not a task. +EventSource_EventNameDoesNotEqualTaskPlusOpcode = Event {0} (with ID {1}) has a name that is not the concatenation of its task name and opcode. +EventSource_PeriodIllegalInProviderName = Period character ('.') is illegal in an ETW provider name ({0}). +EventSource_IllegalOpcodeValue = Opcode {0} has a value of {1} which is outside the legal range (11-238). +EventSource_OpcodeCollision = Opcodes {0} and {1} are defined with the same value ({2}). +EventSource_IllegalTaskValue = Task {0} has a value of {1} which is outside the legal range (1-65535). +EventSource_TaskCollision = Tasks {0} and {1} are defined with the same value ({2}). +EventSource_IllegalKeywordsValue = Keyword {0} has a value of {1} which is outside the legal range (0-0x0000080000000000). +EventSource_KeywordCollision = Keywords {0} and {1} are defined with the same value ({2}). +EventSource_EventChannelOutOfRange = Channel {0} has a value of {1} which is outside the legal range (16-254). +EventSource_ChannelTypeDoesNotMatchEventChannelValue = Channel {0} does not match event channel value {1}. +EventSource_MaxChannelExceeded = Attempt to define more than the maximum limit of 8 channels for a provider. +EventSource_DuplicateStringKey = Multiple definitions for string "{0}". +EventSource_EventWithAdminChannelMustHaveMessage = Event {0} specifies an Admin channel {1}. It must specify a Message property. +EventSource_UnsupportedMessageProperty = Event {0} specifies an illegal or unsupported formatting message ("{1}"). +EventSource_AbstractMustNotDeclareKTOC = Abstract event source must not declare {0} nested type. +EventSource_AbstractMustNotDeclareEventMethods = Abstract event source must not declare event methods ({0} with ID {1}). +EventSource_EventMustNotBeExplicitImplementation = Event method {0} (with ID {1}) is an explicit interface method implementation. Re-write method as implicit implementation. +EventSource_EventParametersMismatch = Event {0} was called with {1} argument(s), but it is defined with {2} parameter(s). +EventSource_InvalidCommand = Invalid command value. +EventSource_InvalidEventFormat = Can't specify both etw event format flags. +EventSource_AddScalarOutOfRange = Getting out of bounds during scalar addition. +EventSource_PinArrayOutOfRange = Pins are out of range. +EventSource_DataDescriptorsOutOfRange = Data descriptors are out of range. +EventSource_NotSupportedArrayOfNil = Arrays of Nil are not supported. +EventSource_NotSupportedArrayOfBinary = Arrays of Binary are not supported. +EventSource_NotSupportedArrayOfNullTerminatedString = Arrays of null-terminated string are not supported. +EventSource_TooManyFields = Too many fields in structure. +EventSource_RecursiveTypeDefinition = Recursive type definition is not supported. +EventSource_NotSupportedEnumType = Enum type {0} underlying type {1} is not supported for serialization. +EventSource_NonCompliantTypeError = The API supports only anonymous types or types decorated with the EventDataAttribute. Non-compliant type: {0} dataType. +EventSource_NotSupportedNestedArraysEnums = Nested arrays/enumerables are not supported. +EventSource_IncorrentlyAuthoredTypeInfo = Incorrectly-authored TypeInfo - a type should be serialized as one field or as one group +EventSource_NotSupportedCustomSerializedData = Enumerables of custom-serialized data are not supported +EventSource_StopsFollowStarts = An event with stop suffix must follow a corresponding event with a start suffix. +EventSource_NoRelatedActivityId = EventSource expects the first parameter of the Event method to be of type Guid and to be named "relatedActivityId" when calling WriteEventWithRelatedActivityId. +EventSource_VarArgsParameterMismatch = The parameters to the Event method do not match the parameters to the WriteEvent method. This may cause the event to be displayed incorrectly. + +; ExecutionEngineException +ExecutionEngine_InvalidAttribute = Attribute cannot have multiple definitions. +ExecutionEngine_MissingSecurityDescriptor = Unable to retrieve security descriptor for this frame. + +;;ExecutionContext +ExecutionContext_UndoFailed = Undo operation on a component context threw an exception +ExecutionContext_ExceptionInAsyncLocalNotification = An exception was not handled in an AsyncLocal<T> notification callback. + + +; FieldAccessException +FieldAccess_InitOnly = InitOnly (aka ReadOnly) fields can only be initialized in the type/instance constructor. + +; FormatException +Format_AttributeUsage = Duplicate AttributeUsageAttribute found on attribute type {0}. +Format_Bad7BitInt32 = Too many bytes in what should have been a 7 bit encoded Int32. +Format_BadBase = Invalid digits for the specified base. +Format_BadBase64Char = The input is not a valid Base-64 string as it contains a non-base 64 character, more than two padding characters, or an illegal character among the padding characters. +Format_BadBase64CharArrayLength = Invalid length for a Base-64 char array or string. +Format_BadBoolean = String was not recognized as a valid Boolean. +Format_BadDateTime = String was not recognized as a valid DateTime. +Format_BadDateTimeCalendar = The DateTime represented by the string is not supported in calendar {0}. +Format_BadDayOfWeek = String was not recognized as a valid DateTime because the day of week was incorrect. +Format_DateOutOfRange = The DateTime represented by the string is out of range. +Format_BadDatePattern = Could not determine the order of year, month, and date from '{0}'. +Format_BadFormatSpecifier = Format specifier was invalid. +Format_BadTimeSpan = String was not recognized as a valid TimeSpan. +Format_BadQuote = Cannot find a matching quote character for the character '{0}'. +Format_EmptyInputString = Input string was either empty or contained only whitespace. +Format_ExtraJunkAtEnd = Additional non-parsable characters are at the end of the string. +Format_GuidBrace = Expected {0xdddddddd, etc}. +Format_GuidComma = Could not find a comma, or the length between the previous token and the comma was zero (i.e., '0x,'etc.). +Format_GuidBraceAfterLastNumber = Could not find a brace, or the length between the previous token and the brace was zero (i.e., '0x,'etc.). +Format_GuidDashes = Dashes are in the wrong position for GUID parsing. +Format_GuidEndBrace = Could not find the ending brace. +Format_GuidHexPrefix = Expected hex 0x in '{0}'. +Format_GuidInvLen = Guid should contain 32 digits with 4 dashes (xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx). +Format_GuidInvalidChar = Guid string should only contain hexadecimal characters. +Format_GuidUnrecognized = Unrecognized Guid format. +Format_InvalidEnumFormatSpecification = Format String can be only "G", "g", "X", "x", "F", "f", "D" or "d". +Format_InvalidGuidFormatSpecification = Format String can be only "D", "d", "N", "n", "P", "p", "B", "b", "X" or "x". +Format_InvalidString = Input string was not in a correct format. +Format_IndexOutOfRange = Index (zero based) must be greater than or equal to zero and less than the size of the argument list. +Format_UnknowDateTimeWord = The string was not recognized as a valid DateTime. There is an unknown word starting at index {0}. +Format_NeedSingleChar = String must be exactly one character long. +Format_NoParsibleDigits = Could not find any recognizable digits. +Format_RepeatDateTimePattern = DateTime pattern '{0}' appears more than once with different values. +Format_StringZeroLength = String cannot have zero length. +Format_TwoTimeZoneSpecifiers = The String being parsed cannot contain two TimeZone specifiers. +Format_UTCOutOfRange= The UTC representation of the date falls outside the year range 1-9999. +Format_OffsetOutOfRange=The time zone offset must be within plus or minus 14 hours. +Format_MissingIncompleteDate=There must be at least a partial date with a year present in the input. + +; IndexOutOfRangeException +IndexOutOfRange_ArrayRankIndex = Array does not have that many dimensions. +IndexOutOfRange_IORaceCondition = Probable I/O race condition detected while copying memory. The I/O package is not thread safe by default. In multithreaded applications, a stream must be accessed in a thread-safe way, such as a thread-safe wrapper returned by TextReader's or TextWriter's Synchronized methods. This also applies to classes like StreamWriter and StreamReader. +IndexOutOfRange_UMSPosition = Unmanaged memory stream position was beyond the capacity of the stream. + +; InsufficientMemoryException +InsufficientMemory_MemFailPoint = Insufficient available memory to meet the expected demands of an operation at this time. Please try again later. +InsufficientMemory_MemFailPoint_TooBig = Insufficient memory to meet the expected demands of an operation, and this system is likely to never satisfy this request. If this is a 32 bit system, consider booting in 3 GB mode. +InsufficientMemory_MemFailPoint_VAFrag = Insufficient available memory to meet the expected demands of an operation at this time, possibly due to virtual address space fragmentation. Please try again later. + + +; InvalidCastException +InvalidCast_DBNull = Object cannot be cast to DBNull. +InvalidCast_DownCastArrayElement = At least one element in the source array could not be cast down to the destination array type. +InvalidCast_Empty = Object cannot be cast to Empty. +InvalidCast_FromDBNull = Object cannot be cast from DBNull to other types. +InvalidCast_FromTo = Invalid cast from '{0}' to '{1}'. +InvalidCast_IConvertible = Object must implement IConvertible. +InvalidCast_OATypeMismatch = OleAut reported a type mismatch. +InvalidCast_StoreArrayElement = Object cannot be stored in an array of this type. +InvalidCast_CannotCoerceByRefVariant = Object cannot be coerced to the original type of the ByRef VARIANT it was obtained from. +InvalidCast_CannotCastNullToValueType = Null object cannot be converted to a value type. +#if FEATURE_COMINTEROP +InvalidCast_WinRTIPropertyValueElement = Object in an IPropertyValue is of type '{0}', which cannot be converted to a '{1}'. +InvalidCast_WinRTIPropertyValueCoersion = Object in an IPropertyValue is of type '{0}' with value '{1}', which cannot be converted to a '{2}'. +InvalidCast_WinRTIPropertyValueArrayCoersion = Object in an IPropertyValue is of type '{0}' which cannot be convereted to a '{1}' due to array element '{2}': {3}. +#endif // FEATURE_COMINTEROP + +; InvalidOperationException +InvalidOperation_ActivationArgsAppTrustMismatch = The activation arguments and application trust for the AppDomain must correspond to the same application identity. +InvalidOperation_AddContextFrozen = Attempted to add properties to a frozen context. +InvalidOperation_AppDomainSandboxAPINeedsExplicitAppBase = This API requires the ApplicationBase to be specified explicitly in the AppDomainSetup parameter. +InvalidOperation_CantCancelCtrlBreak = Applications may not prevent control-break from terminating their process. +InvalidOperation_CalledTwice = The method cannot be called twice on the same instance. +InvalidOperation_CollectionCorrupted = A prior operation on this collection was interrupted by an exception. Collection's state is no longer trusted. +InvalidOperation_CriticalTransparentAreMutuallyExclusive = SecurityTransparent and SecurityCritical attributes cannot be applied to the assembly scope at the same time. +InvalidOperation_ExceptionStateCrossAppDomain = Thread.ExceptionState cannot access an ExceptionState from a different AppDomain. +InvalidOperation_DebuggerLaunchFailed = Debugger unable to launch. +InvalidOperation_ApartmentStateSwitchFailed = Failed to set the specified COM apartment state. +InvalidOperation_EmptyQueue = Queue empty. +InvalidOperation_EmptyStack = Stack empty. +InvalidOperation_CannotRemoveFromStackOrQueue = Removal is an invalid operation for Stack or Queue. +InvalidOperation_EnumEnded = Enumeration already finished. +InvalidOperation_EnumFailedVersion = Collection was modified; enumeration operation may not execute. +InvalidOperation_EnumNotStarted = Enumeration has not started. Call MoveNext. +InvalidOperation_EnumOpCantHappen = Enumeration has either not started or has already finished. +InvalidOperation_ModifyRONumFmtInfo = Unable to modify a read-only NumberFormatInfo object. +InvalidOperation_MustBeSameThread = This operation must take place on the same thread on which the object was created. +InvalidOperation_MustRevertPrivilege = Must revert the privilege prior to attempting this operation. +InvalidOperation_ReadOnly = Instance is read-only. +InvalidOperation_RegRemoveSubKey = Registry key has subkeys and recursive removes are not supported by this method. +InvalidOperation_IComparerFailed = Failed to compare two elements in the array. +InvalidOperation_InternalState = Invalid internal state. +InvalidOperation_DuplicatePropertyName = Another property by this name already exists. +InvalidOperation_NotCurrentDomain = You can only define a dynamic assembly on the current AppDomain. +InvalidOperation_ContextAlreadyFrozen = Context is already frozen. +InvalidOperation_WriteOnce = This property has already been set and cannot be modified. +InvalidOperation_MethodBaked = Type definition of the method is complete. +InvalidOperation_MethodHasBody = Method already has a body. +InvalidOperation_ModificationOfNonCanonicalAcl = This access control list is not in canonical form and therefore cannot be modified. +InvalidOperation_Method = This method is not supported by the current object. +InvalidOperation_NativeOverlappedReused = NativeOverlapped cannot be reused for multiple operations. +InvalidOperation_NotADebugModule = Not a debug ModuleBuilder. +InvalidOperation_NoMultiModuleAssembly = You cannot have more than one dynamic module in each dynamic assembly in this version of the runtime. +InvalidOperation_OpenLocalVariableScope = Local variable scope was not properly closed. +InvalidOperation_SetVolumeLabelFailed = Volume labels can only be set for writable local volumes. +InvalidOperation_SetData = An additional permission should not be supplied for setting loader information. +InvalidOperation_SetData_OnlyOnce = SetData can only be used to set the value of a given name once. +InvalidOperation_SetData_OnlyLocationURI = SetData cannot be used to set the value for '{0}'. +InvalidOperation_TypeHasBeenCreated = Unable to change after type has been created. +InvalidOperation_TypeNotCreated = Type has not been created. +InvalidOperation_NoUnderlyingTypeOnEnum = Underlying type information on enumeration is not specified. +InvalidOperation_ResMgrBadResSet_Type = '{0}': ResourceSet derived classes must provide a constructor that takes a String file name and a constructor that takes a Stream. +InvalidOperation_AssemblyHasBeenSaved = Assembly '{0}' has been saved. +InvalidOperation_ModuleHasBeenSaved = Module '{0}' has been saved. +InvalidOperation_CannotAlterAssembly = Unable to alter assembly information. +InvalidOperation_BadTransientModuleReference = Unable to make a reference to a transient module from a non-transient module. +InvalidOperation_BadILGeneratorUsage = ILGenerator usage is invalid. +InvalidOperation_BadInstructionOrIndexOutOfBound = MSIL instruction is invalid or index is out of bounds. +InvalidOperation_ShouldNotHaveMethodBody = Method body should not exist. +InvalidOperation_EntryMethodNotDefinedInAssembly = Entry method is not defined in the same assembly. +InvalidOperation_CantSaveTransientAssembly = Cannot save a transient assembly. +InvalidOperation_BadResourceContainer = Unable to add resource to transient module or transient assembly. +InvalidOperation_CantInstantiateAbstractClass = Instances of abstract classes cannot be created. +InvalidOperation_CantInstantiateFunctionPointer = Instances of function pointers cannot be created. +InvalidOperation_BadTypeAttributesNotAbstract = Type must be declared abstract if any of its methods are abstract. +InvalidOperation_BadInterfaceNotAbstract = Interface must be declared abstract. +InvalidOperation_ConstructorNotAllowedOnInterface = Interface cannot have constructors. +InvalidOperation_BadMethodBody = Method '{0}' cannot have a method body. +InvalidOperation_MetaDataError = Metadata operation failed. +InvalidOperation_BadEmptyMethodBody = Method '{0}' does not have a method body. +InvalidOperation_EndInvokeCalledMultiple = EndInvoke can only be called once for each asynchronous operation. +InvalidOperation_EndReadCalledMultiple = EndRead can only be called once for each asynchronous operation. +InvalidOperation_EndWriteCalledMultiple = EndWrite can only be called once for each asynchronous operation. +InvalidOperation_AsmLoadedForReflectionOnly = Assembly has been loaded as ReflectionOnly. This API requires an assembly capable of execution. +InvalidOperation_NoAsmName = Assembly does not have an assembly name. In order to be registered for use by COM, an assembly must have a valid assembly name. +InvalidOperation_NoAsmCodeBase = Assembly does not have a code base. +InvalidOperation_HandleIsNotInitialized = Handle is not initialized. +InvalidOperation_HandleIsNotPinned = Handle is not pinned. +InvalidOperation_SlotHasBeenFreed = LocalDataStoreSlot storage has been freed. +InvalidOperation_GlobalsHaveBeenCreated = Type definition of the global function has been completed. +InvalidOperation_NotAVarArgCallingConvention = Calling convention must be VarArgs. +InvalidOperation_CannotImportGlobalFromDifferentModule = Unable to import a global method or field from a different module. +InvalidOperation_NonStaticComRegFunction = COM register function must be static. +InvalidOperation_NonStaticComUnRegFunction = COM unregister function must be static. +InvalidOperation_InvalidComRegFunctionSig = COM register function must have a System.Type parameter and a void return type. +InvalidOperation_InvalidComUnRegFunctionSig = COM unregister function must have a System.Type parameter and a void return type. +InvalidOperation_MultipleComRegFunctions = Type '{0}' has more than one COM registration function. +InvalidOperation_MultipleComUnRegFunctions = Type '{0}' has more than one COM unregistration function. +InvalidOperation_MustCallInitialize = You must call Initialize on this object instance before using it. +InvalidOperation_MustLockForReadOrWrite = Object must be locked for read or write. +InvalidOperation_MustLockForWrite = Object must be locked for read. +InvalidOperation_NoValue = Nullable object must have a value. +InvalidOperation_ResourceNotStream_Name = Resource '{0}' was not a Stream - call GetObject instead. +InvalidOperation_ResourceNotString_Name = Resource '{0}' was not a String - call GetObject instead. +InvalidOperation_ResourceNotString_Type = Resource was of type '{0}' instead of String - call GetObject instead. +InvalidOperation_ResourceWriterSaved = The resource writer has already been closed and cannot be edited. +InvalidOperation_UnderlyingArrayListChanged = This range in the underlying list is invalid. A possible cause is that elements were removed. +InvalidOperation_AnonymousCannotImpersonate = An anonymous identity cannot perform an impersonation. +InvalidOperation_DefaultConstructorILGen = Unable to access ILGenerator on a constructor created with DefineDefaultConstructor. +InvalidOperation_DefaultConstructorDefineBody = The method body of the default constructor cannot be changed. +InvalidOperation_ComputerName = Computer name could not be obtained. +InvalidOperation_MismatchedAsyncResult = The IAsyncResult object provided does not match this delegate. +InvalidOperation_PIAMustBeStrongNamed = Primary interop assemblies must be strongly named. +InvalidOperation_HashInsertFailed = Hashtable insert failed. Load factor too high. The most common cause is multiple threads writing to the Hashtable simultaneously. +InvalidOperation_UnknownEnumType = Unknown enum type. +InvalidOperation_GetVersion = OSVersion's call to GetVersionEx failed. +InvalidOperation_DateTimeParsing = Internal Error in DateTime and Calendar operations. +InvalidOperation_UserDomainName = UserDomainName native call failed. +InvalidOperation_WaitOnTransparentProxy = Cannot wait on a transparent proxy. +InvalidOperation_NoPublicAddMethod = Cannot add the event handler since no public add method exists for the event. +InvalidOperation_NoPublicRemoveMethod = Cannot remove the event handler since no public remove method exists for the event. +InvalidOperation_NotSupportedOnWinRTEvent = Adding or removing event handlers dynamically is not supported on WinRT events. +InvalidOperation_ConsoleKeyAvailableOnFile = Cannot see if a key has been pressed when either application does not have a console or when console input has been redirected from a file. Try Console.In.Peek. +InvalidOperation_ConsoleReadKeyOnFile = Cannot read keys when either application does not have a console or when console input has been redirected from a file. Try Console.Read. +InvalidOperation_ThreadWrongThreadStart = The thread was created with a ThreadStart delegate that does not accept a parameter. +InvalidOperation_ThreadAPIsNotSupported = Use CompressedStack.(Capture/Run) or ExecutionContext.(Capture/Run) APIs instead. +InvalidOperation_NotNewCaptureContext = Cannot apply a context that has been marshaled across AppDomains, that was not acquired through a Capture operation or that has already been the argument to a Set call. +InvalidOperation_NullContext = Cannot call Set on a null context +InvalidOperation_CannotCopyUsedContext = Only newly captured contexts can be copied +InvalidOperation_CannotUseSwitcherOtherThread = Undo operation must be performed on the thread where the corresponding context was Set. +InvalidOperation_SwitcherCtxMismatch = The Undo operation encountered a context that is different from what was applied in the corresponding Set operation. The possible cause is that a context was Set on the thread and not reverted(undone). +InvalidOperation_CannotOverrideSetWithoutRevert = Must override both HostExecutionContextManager.SetHostExecutionContext and HostExecutionContextManager.Revert. +InvalidOperation_CannotUseAFCOtherThread = AsyncFlowControl object must be used on the thread where it was created. +InvalidOperation_CannotRestoreUnsupressedFlow = Cannot restore context flow when it is not suppressed. +InvalidOperation_CannotSupressFlowMultipleTimes = Context flow is already suppressed. +InvalidOperation_CannotUseAFCMultiple = AsyncFlowControl object can be used only once to call Undo(). +InvalidOperation_AsyncFlowCtrlCtxMismatch = AsyncFlowControl objects can be used to restore flow only on a Context that had its flow suppressed. +InvalidOperation_TimeoutsNotSupported = Timeouts are not supported on this stream. +InvalidOperation_Overlapped_Pack = Cannot pack a packed Overlapped again. +InvalidOperation_OnlyValidForDS = Adding ACEs with Object Flags and Object GUIDs is only valid for directory-object ACLs. +InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple = Either the IAsyncResult object did not come from the corresponding async method on this type, or EndRead was called multiple times with the same IAsyncResult. +InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple = Either the IAsyncResult object did not come from the corresponding async method on this type, or EndWrite was called multiple times with the same IAsyncResult. +InvalidOperation_WrongAsyncResultOrEndCalledMultiple = Either the IAsyncResult object did not come from the corresponding async method on this type, or the End method was called multiple times with the same IAsyncResult. +InvalidOperation_NoSecurityDescriptor = The object does not contain a security descriptor. +InvalidOperation_NotAllowedInReflectionOnly = The requested operation is invalid in the ReflectionOnly context. +InvalidOperation_NotAllowedInDynamicMethod = The requested operation is invalid for DynamicMethod. +InvalidOperation_PropertyInfoNotAvailable = This API does not support PropertyInfo tokens. +InvalidOperation_EventInfoNotAvailable = This API does not support EventInfo tokens. +InvalidOperation_UnexpectedWin32Error = Unexpected error when calling an operating system function. The returned error code is 0x{0:x}. +InvalidOperation_AssertTransparentCode = Cannot perform CAS Asserts in Security Transparent methods +InvalidOperation_NullModuleHandle = The requested operation is invalid when called on a null ModuleHandle. +InvalidOperation_NotWithConcurrentGC = This API is not available when the concurrent GC is enabled. +InvalidOperation_WithoutARM = This API is not available when AppDomain Resource Monitoring is not turned on. +InvalidOperation_NotGenericType = This operation is only valid on generic types. +InvalidOperation_TypeCannotBeBoxed = The given type cannot be boxed. +InvalidOperation_HostModifiedSecurityState = The security state of an AppDomain was modified by an AppDomainManager configured with the NoSecurityChanges flag. +InvalidOperation_StrongNameKeyPairRequired = A strong name key pair is required to emit a strong-named dynamic assembly. +#if FEATURE_COMINTEROP +InvalidOperation_EventTokenTableRequiresDelegate = Type '{0}' is not a delegate type. EventTokenTable may only be used with delegate types. +#endif // FEATURE_COMINTEROP +InvalidOperation_NullArray = The underlying array is null. +;system.security.claims +InvalidOperation_ClaimCannotBeRemoved = The Claim '{0}' was not able to be removed. It is either not part of this Identity or it is a claim that is owned by the Principal that contains this Identity. For example, the Principal will own the claim when creating a GenericPrincipal with roles. The roles will be exposed through the Identity that is passed in the constructor, but not actually owned by the Identity. Similar logic exists for a RolePrincipal. +InvalidOperationException_ActorGraphCircular = Actor cannot be set so that circular directed graph will exist chaining the subjects together. +InvalidOperation_AsyncIOInProgress = The stream is currently in use by a previous operation on the stream. +InvalidOperation_APIInvalidForCurrentContext = The API '{0}' cannot be used on the current platform. See http://go.microsoft.com/fwlink/?LinkId=248273 for more information. + +; InvalidProgramException +InvalidProgram_Default = Common Language Runtime detected an invalid program. + +; Verification Exception +Verification_Exception = Operation could destabilize the runtime. + +; IL stub marshaler exceptions +Marshaler_StringTooLong = Marshaler restriction: Excessively long string. + +; Missing (General) +MissingConstructor_Name = Constructor on type '{0}' not found. +MissingField = Field not found. +MissingField_Name = Field '{0}' not found. +MissingMember = Member not found. +MissingMember_Name = Member '{0}' not found. +MissingMethod_Name = Method '{0}' not found. +MissingModule = Module '{0}' not found. +MissingType = Type '{0}' not found. + +; MissingManifestResourceException +Arg_MissingManifestResourceException = Unable to find manifest resource. +MissingManifestResource_LooselyLinked = Could not find a manifest resource entry called "{0}" in assembly "{1}". Please check spelling, capitalization, and build rules to ensure "{0}" is being linked into the assembly. +MissingManifestResource_NoNeutralAsm = Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "{0}" was correctly embedded or linked into assembly "{1}" at compile time, or that all the satellite assemblies required are loadable and fully signed. +MissingManifestResource_NoNeutralDisk = Could not find any resources appropriate for the specified culture (or the neutral culture) on disk. +MissingManifestResource_MultipleBlobs = A case-insensitive lookup for resource file "{0}" in assembly "{1}" found multiple entries. Remove the duplicates or specify the exact case. +MissingManifestResource_ResWFileNotLoaded = Unable to load resources for resource file "{0}" in package "{1}". +MissingManifestResource_NoPRIresources = Unable to open Package Resource Index. + +; MissingMember +MissingMemberTypeRef = FieldInfo does not match the target Type. +MissingMemberNestErr = TypedReference can only be made on nested value Types. + +; MissingSatelliteAssemblyException +MissingSatelliteAssembly_Default = Resource lookup fell back to the ultimate fallback resources in a satellite assembly, but that satellite either was not found or could not be loaded. Please consider reinstalling or repairing the application. +MissingSatelliteAssembly_Culture_Name = The satellite assembly named "{1}" for fallback culture "{0}" either could not be found or could not be loaded. This is generally a setup problem. Please consider reinstalling or repairing the application. + +; MulticastNotSupportedException +Multicast_Combine = Delegates that are not of type MulticastDelegate may not be combined. + +; NotImplementedException +Arg_NotImplementedException = The method or operation is not implemented. +NotImplemented_ResourcesLongerThan2^63 = Resource files longer than 2^63 bytes are not currently implemented. + +; NotSupportedException +NotSupported_NYI = This feature is not currently implemented. +NotSupported_AbstractNonCLS = This non-CLS method is not implemented. +NotSupported_ChangeType = ChangeType operation is not supported. +NotSupported_ByRefLike = Cannot create boxed ByRef-like values. +NotSupported_ByRefLike[] = Cannot create arrays of ByRef-like values. +NotSupported_OpenType = Cannot create arrays of open type. +NotSupported_DBNullSerial = Only one DBNull instance may exist, and calls to DBNull deserialization methods are not allowed. +NotSupported_DelegateSerHolderSerial = DelegateSerializationHolder objects are designed to represent a delegate during serialization and are not serializable themselves. +NotSupported_DelegateCreationFromPT = Application code cannot use Activator.CreateInstance to create types that derive from System.Delegate. Delegate.CreateDelegate can be used instead. +NotSupported_EncryptionNeedsNTFS = File encryption support only works on NTFS partitions. +NotSupported_FileStreamOnNonFiles = FileStream was asked to open a device that was not a file. For support for devices like 'com1:' or 'lpt1:', call CreateFile, then use the FileStream constructors that take an OS handle as an IntPtr. +NotSupported_FixedSizeCollection = Collection was of a fixed size. +NotSupported_KeyCollectionSet = Mutating a key collection derived from a dictionary is not allowed. +NotSupported_ValueCollectionSet = Mutating a value collection derived from a dictionary is not allowed. +NotSupported_MemStreamNotExpandable = Memory stream is not expandable. +NotSupported_ObsoleteResourcesFile = Found an obsolete .resources file in assembly '{0}'. Rebuild that .resources file then rebuild that assembly. +NotSupported_OleAutBadVarType = The given Variant type is not supported by this OleAut function. +NotSupported_PopulateData = This Surrogate does not support PopulateData(). +NotSupported_ReadOnlyCollection = Collection is read-only. +NotSupported_RangeCollection = The specified operation is not supported on Ranges. +NotSupported_SortedListNestedWrite = This operation is not supported on SortedList nested types because they require modifying the original SortedList. +NotSupported_SubclassOverride = Derived classes must provide an implementation. +NotSupported_TypeCannotDeserialized = Direct deserialization of type '{0}' is not supported. +NotSupported_UnreadableStream = Stream does not support reading. +NotSupported_UnseekableStream = Stream does not support seeking. +NotSupported_UnwritableStream = Stream does not support writing. +NotSupported_CannotWriteToBufferedStreamIfReadBufferCannotBeFlushed = Cannot write to a BufferedStream while the read buffer is not empty if the underlying stream is not seekable. Ensure that the stream underlying this BufferedStream can seek or avoid interleaving read and write operations on this BufferedStream. +NotSupported_Method = Method is not supported. +NotSupported_Constructor = Object cannot be created through this constructor. +NotSupported_DynamicModule = The invoked member is not supported in a dynamic module. +NotSupported_TypeNotYetCreated = The invoked member is not supported before the type is created. +NotSupported_SymbolMethod = Not supported in an array method of a type definition that is not complete. +NotSupported_NotDynamicModule = The MethodRental.SwapMethodBody method can only be called to swap the method body of a method in a dynamic module. +NotSupported_DynamicAssembly = The invoked member is not supported in a dynamic assembly. +NotSupported_NotAllTypesAreBaked = Type '{0}' was not completed. +NotSupported_CannotSaveModuleIndividually = Unable to save a ModuleBuilder if it was created underneath an AssemblyBuilder. Call Save on the AssemblyBuilder instead. +NotSupported_MaxWaitHandles = The number of WaitHandles must be less than or equal to 64. +NotSupported_IllegalOneByteBranch = Illegal one-byte branch at position: {0}. Requested branch was: {1}. +NotSupported_OutputStreamUsingTypeBuilder = Output streams do not support TypeBuilders. +NotSupported_ValueClassCM = Custom marshalers for value types are not currently supported. +NotSupported_Void[] = Arrays of System.Void are not supported. +NotSupported_NoParentDefaultConstructor = Parent does not have a default constructor. The default constructor must be explicitly defined. +NotSupported_NonReflectedType = Not supported in a non-reflected type. +NotSupported_GlobalFunctionNotBaked = The type definition of the global function is not completed. +NotSupported_SecurityPermissionUnion = Union is not implemented. +NotSupported_UnitySerHolder = The UnitySerializationHolder object is designed to transmit information about other types and is not serializable itself. +NotSupported_UnknownTypeCode = TypeCode '{0}' was not valid. +NotSupported_WaitAllSTAThread = WaitAll for multiple handles on a STA thread is not supported. +NotSupported_SignalAndWaitSTAThread = SignalAndWait on a STA thread is not supported. +NotSupported_CreateInstanceWithTypeBuilder = CreateInstance cannot be used with an object of type TypeBuilder. +NotSupported_NonUrlAttrOnMBR = UrlAttribute is the only attribute supported for MarshalByRefObject. +NotSupported_ActivAttrOnNonMBR = Activation Attributes are not supported for types not deriving from MarshalByRefObject. +NotSupported_ActivAttr = Activation Attributes are not supported. +NotSupported_ActivForCom = Activation Attributes not supported for COM Objects. +NotSupported_NoCodepageData = No data is available for encoding {0}. For information on defining a custom encoding, see the documentation for the Encoding.RegisterProvider method. +NotSupported_CodePage50229 = The ISO-2022-CN Encoding (Code page 50229) is not supported. +NotSupported_DynamicAssemblyNoRunAccess = Cannot execute code on a dynamic assembly without run access. +NotSupported_IDispInvokeDefaultMemberWithNamedArgs = Invoking default method with named arguments is not supported. +NotSupported_Type = Type is not supported. +NotSupported_GetMethod = The 'get' method is not supported on this property. +NotSupported_SetMethod = The 'set' method is not supported on this property. +NotSupported_DeclarativeUnion = Declarative unionizing of these permissions is not supported. +NotSupported_StringComparison = The string comparison type passed in is currently not supported. +NotSupported_WrongResourceReader_Type = This .resources file should not be read with this reader. The resource reader type is "{0}". +NotSupported_MustBeModuleBuilder = Module argument must be a ModuleBuilder. +NotSupported_CallToVarArg = Vararg calling convention not supported. +NotSupported_TooManyArgs = Stack size too deep. Possibly too many arguments. +NotSupported_DeclSecVarArg = Assert, Deny, and PermitOnly are not supported on methods with a Vararg calling convention. +NotSupported_AmbiguousIdentity = The operation is ambiguous because the permission represents multiple identities. +NotSupported_DynamicMethodFlags = Wrong MethodAttributes or CallingConventions for DynamicMethod. Only public, static, standard supported +NotSupported_GlobalMethodSerialization = Serialization of global methods (including implicit serialization via the use of asynchronous delegates) is not supported. +NotSupported_InComparableType = A type must implement IComparable<T> or IComparable to support comparison. +NotSupported_ManagedActivation = Cannot create uninitialized instances of types requiring managed activation. +NotSupported_ByRefReturn = ByRef return value not supported in reflection invocation. +NotSupported_DelegateMarshalToWrongDomain = Delegates cannot be marshaled from native code into a domain other than their home domain. +NotSupported_ResourceObjectSerialization = Cannot read resources that depend on serialization. +NotSupported_One = The arithmetic type '{0}' cannot represent the number one. +NotSupported_Zero = The arithmetic type '{0}' cannot represent the number zero. +NotSupported_MaxValue = The arithmetic type '{0}' does not have a maximum value. +NotSupported_MinValue = The arithmetic type '{0}' does not have a minimum value. +NotSupported_PositiveInfinity = The arithmetic type '{0}' cannot represent positive infinity. +NotSupported_NegativeInfinity = The arithmetic type '{0}' cannot represent negative infinity. +NotSupported_UmsSafeBuffer = This operation is not supported for an UnmanagedMemoryStream created from a SafeBuffer. +NotSupported_Reading = Accessor does not support reading. +NotSupported_Writing = Accessor does not support writing. +NotSupported_UnsafePointer = This accessor was created with a SafeBuffer; use the SafeBuffer to gain access to the pointer. +NotSupported_CollectibleCOM = COM Interop is not supported for collectible types. +NotSupported_CollectibleAssemblyResolve = Resolving to a collectible assembly is not supported. +NotSupported_CollectibleBoundNonCollectible = A non-collectible assembly may not reference a collectible assembly. +NotSupported_CollectibleDelegateMarshal = Delegate marshaling for types within collectible assemblies is not supported. +NotSupported_NonStaticMethod = Non-static methods with NativeCallableAttribute are not supported. +NotSupported_NativeCallableTarget = Methods with NativeCallableAttribute cannot be used as delegate target. +NotSupported_GenericMethod = Generic methods with NativeCallableAttribute are not supported. +NotSupported_NonBlittableTypes = Non-blittable parameter types are not supported for NativeCallable methods. + +NotSupported_UserDllImport = DllImport cannot be used on user-defined methods. +NotSupported_UserCOM = COM Interop is not supported for user-defined types. + +#if FEATURE_APPX +NotSupported_AppX = {0} is not supported in AppX. +LoadOfFxAssemblyNotSupported_AppX = {0} of .NET Framework assemblies is not supported in AppX. +#endif +#if FEATURE_COMINTEROP +NotSupported_WinRT_PartialTrust = Windows Runtime is not supported in partial trust. +#endif // FEATURE_COMINTEROP +; ReflectionTypeLoadException +ReflectionTypeLoad_LoadFailed = Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information. +#if FEATURE_COMINTEROP +NotSupported_PIAInAppxProcess = A Primary Interop Assembly is not supported in AppX. +#endif +NotSupported_AssemblyLoadCodeBase = Assembly.Load with a Codebase is not supported. +NotSupported_AssemblyLoadFromHash = Assembly.LoadFrom with hashValue is not supported. +NotSupported_CannotCallEqualsOnSpan = Equals() on Span and ReadOnlySpan is not supported. Use operator== instead. +NotSupported_CannotCallGetHashCodeOnSpan = GetHashCode() on Span and ReadOnlySpan is not supported. +NotSupported_ReflectionOnlyLoad = Assembly.ReflectionOnlyLoad is not supported. +NotSupported_ReflectionOnlyGetType = Type.ReflectionOnlyGetType is not supported. + +; TypeLoadException +TypeLoad_ResolveType = Could not resolve type '{0}'. +TypeLoad_ResolveTypeFromAssembly = Could not resolve type '{0}' in assembly '{1}'. +TypeLoad_ResolveNestedType = Could not resolve nested type '{0}' in type "{1}'. +FileNotFound_ResolveAssembly = Could not resolve assembly '{0}'. + +; NullReferenceException +NullReference_This = The pointer for this method was null. + +; ObjectDisposedException +ObjectDisposed_Generic = Cannot access a disposed object. +ObjectDisposed_FileClosed = Cannot access a closed file. +ObjectDisposed_ObjectName_Name = Object name: '{0}'. +ObjectDisposed_ReaderClosed = Cannot read from a closed TextReader. +ObjectDisposed_ResourceSet = Cannot access a closed resource set. +ObjectDisposed_RegKeyClosed = Cannot access a closed registry key. +ObjectDisposed_StreamClosed = Cannot access a closed Stream. +ObjectDisposed_WriterClosed = Cannot write to a closed TextWriter. +ObjectDisposed_ViewAccessorClosed = Cannot access a closed accessor. + +; OperationCanceledException +OperationCanceled = The operation was canceled. + +; OutOfMemoryException +OutOfMemory_GCHandleMDA = The GCHandle MDA has run out of available cookies. + +; OverflowException +Overflow_Byte = Value was either too large or too small for an unsigned byte. +Overflow_Char = Value was either too large or too small for a character. +Overflow_Currency = Value was either too large or too small for a Currency. +Overflow_Decimal = Value was either too large or too small for a Decimal. +Overflow_Int16 = Value was either too large or too small for an Int16. +Overflow_Int32 = Value was either too large or too small for an Int32. +Overflow_Int64 = Value was either too large or too small for an Int64. +Overflow_NegateTwosCompNum = Negating the minimum value of a twos complement number is invalid. +Overflow_NegativeUnsigned = The string was being parsed as an unsigned number and could not have a negative sign. +Overflow_SByte = Value was either too large or too small for a signed byte. +Overflow_Single = Value was either too large or too small for a Single. +Overflow_Double = Value was either too large or too small for a Double. +Overflow_TimeSpanTooLong = TimeSpan overflowed because the duration is too long. +Overflow_TimeSpanElementTooLarge = The TimeSpan could not be parsed because at least one of the numeric components is out of range or contains too many digits. +Overflow_Duration = The duration cannot be returned for TimeSpan.MinValue because the absolute value of TimeSpan.MinValue exceeds the value of TimeSpan.MaxValue. +Overflow_UInt16 = Value was either too large or too small for a UInt16. +Overflow_UInt32 = Value was either too large or too small for a UInt32. +Overflow_UInt64 = Value was either too large or too small for a UInt64. + +; PlatformNotsupportedException +PlatformNotSupported_RequiresLonghorn = This operation is only supported on Windows Vista and above. +PlatformNotSupported_RequiresNT = This operation is only supported on Windows 2000, Windows XP, and higher. +PlatformNotSupported_RequiresW2kSP3 = This operation is only supported on Windows 2000 SP3 or later operating systems. +#if FEATURE_COMINTEROP +PlatformNotSupported_WinRT = Windows Runtime is not supported on this operating system. +#endif // FEATURE_COMINTEROP + +; PolicyException +; This still appears in bcl.small but should go away eventually +Policy_Default = Error occurred while performing a policy operation. +Policy_CannotLoadSemiTrustAssembliesDuringInit = All assemblies loaded as part of AppDomain initialization must be fully trusted. +Policy_SaveNotFileBased = PolicyLevel object not based on a file cannot be saved. +Policy_AppTrustMustGrantAppRequest = ApplicationTrust grant set does not contain ActivationContext's minimum request set. + +Error_SecurityPolicyFileParse = Error occurred while parsing the '{0}' policy level. The default policy level was used instead. +Error_SecurityPolicyFileParseEx = Error '{1}' occurred while parsing the '{0}' policy level. The default policy level was used instead. + +; RankException +Rank_MultiDimNotSupported = Only single dimension arrays are supported here. +Rank_MustMatch = The specified arrays must have the same number of dimensions. + +; TypeInitializationException +TypeInitialization_Default = Type constructor threw an exception. +TypeInitialization_Type = The type initializer for '{0}' threw an exception. + +; TypeLoadException + + +; +; Reflection exceptions +; +RtType.InvalidCaller = Caller is not a friend. + +;CustomAttributeFormatException +RFLCT.InvalidPropFail = '{0}' property specified was not found. +RFLCT.InvalidFieldFail = '{0}' field specified was not found. + +;InvalidFilterCriteriaException +InvalidFilterCriteriaException_CritString = A String must be provided for the filter criteria. +InvalidFilterCriteriaException_CritInt = An Int32 must be provided for the filter criteria. + +; TargetException +RFLCT.Targ_ITargMismatch = Object does not match target type. +RFLCT.Targ_StatMethReqTarg = Non-static method requires a target. +RFLCT.Targ_StatFldReqTarg = Non-static field requires a target. + +;AmbiguousMatchException +RFLCT.Ambiguous = Ambiguous match found. +RFLCT.AmbigCust = Multiple custom attributes of the same type found. + +; +; Remoting exceptions +; +Remoting_AppDomainUnloaded_ThreadUnwound = The application domain in which the thread was running has been unloaded. +Remoting_AppDomainUnloaded = The target application domain has been unloaded. +Remoting_CantRemotePointerType = Pointer types cannot be passed in a remote call. +Remoting_TypeCantBeRemoted = The given type cannot be passed in a remote call. +Remoting_Delegate_TooManyTargets = The delegate must have only one target. +Remoting_InvalidContext = The context is not valid. +Remoting_InvalidValueTypeFieldAccess = An attempt was made to calculate the address of a value type field on a remote object. This was likely caused by an attempt to directly get or set the value of a field within this embedded value type. Avoid this and instead provide and use access methods for each field in the object that will be accessed remotely. +Remoting_Message_BadRetValOrOutArg = Bad return value or out-argument inside the return message. +Remoting_NonPublicOrStaticCantBeCalledRemotely = Permission denied: cannot call non-public or static methods remotely. +Remoting_Proxy_ProxyTypeIsNotMBR = classToProxy argument must derive from MarshalByRef type. +Remoting_TP_NonNull = The transparent proxy field of a real proxy must be null. + +; Resources exceptions +; +Resources_StreamNotValid = Stream is not a valid resource file. +ResourceReaderIsClosed = ResourceReader is closed. + +; RuntimeWrappedException +RuntimeWrappedException = An object that does not derive from System.Exception has been wrapped in a RuntimeWrappedException. + +; UnauthorizedAccessException +UnauthorizedAccess_MemStreamBuffer = MemoryStream's internal buffer cannot be accessed. +UnauthorizedAccess_IODenied_Path = Access to the path '{0}' is denied. +UnauthorizedAccess_IODenied_NoPathName = Access to the path is denied. +UnauthorizedAccess_RegistryKeyGeneric_Key = Access to the registry key '{0}' is denied. +UnauthorizedAccess_RegistryNoWrite = Cannot write to the registry key. +UnauthorizedAccess_SystemDomain = Cannot execute an assembly in the system domain. + +; +; Security exceptions +; + +;SecurityException +; These still appear in bcl.small but should go away eventually +Security_Generic = Request for the permission of type '{0}' failed. +Security_GenericNoType = Request failed. +Security_NoAPTCA = That assembly does not allow partially trusted callers. +Security_RegistryPermission = Requested registry access is not allowed. +Security_MustRevertOverride = Stack walk modifier must be reverted before another modification of the same type can be performed. + +; +; HostProtection exceptions +; + +HostProtection_HostProtection = Attempted to perform an operation that was forbidden by the CLR host. +HostProtection_ProtectedResources = The protected resources (only available with full trust) were: +HostProtection_DemandedResources = The demanded resources were: + +; +; IO exceptions +; + +; EOFException +IO.EOF_ReadBeyondEOF = Unable to read beyond the end of the stream. + +; FileNotFoundException +IO.FileNotFound = Unable to find the specified file. +IO.FileNotFound_FileName = Could not find file '{0}'. +IO.FileName_Name = File name: '{0}' +IO.FileLoad = Could not load the specified file. + +; IOException +IO.IO_AlreadyExists_Name = Cannot create "{0}" because a file or directory with the same name already exists. +IO.IO_BindHandleFailed = BindHandle for ThreadPool failed on this handle. +IO.IO_FileExists_Name = The file '{0}' already exists. +IO.IO_FileStreamHandlePosition = The OS handle's position is not what FileStream expected. Do not use a handle simultaneously in one FileStream and in Win32 code or another FileStream. This may cause data loss. +IO.IO_FileTooLong2GB = The file is too long. This operation is currently limited to supporting files less than 2 gigabytes in size. +IO.IO_FileTooLongOrHandleNotSync = IO operation will not work. Most likely the file will become too long or the handle was not opened to support synchronous IO operations. +IO.IO_FixedCapacity = Unable to expand length of this stream beyond its capacity. +IO.IO_InvalidStringLen_Len = BinaryReader encountered an invalid string length of {0} characters. +IO.IO_NoConsole = There is no console. +IO.IO_NoPermissionToDirectoryName = <Path discovery permission to the specified directory was denied.> +IO.IO_SeekBeforeBegin = An attempt was made to move the position before the beginning of the stream. +IO.IO_SeekAppendOverwrite = Unable seek backward to overwrite data that previously existed in a file opened in Append mode. +IO.IO_SetLengthAppendTruncate = Unable to truncate data that previously existed in a file opened in Append mode. +IO.IO_SharingViolation_File = The process cannot access the file '{0}' because it is being used by another process. +IO.IO_SharingViolation_NoFileName = The process cannot access the file because it is being used by another process. +IO.IO_StreamTooLong = Stream was too long. +IO.IO_CannotCreateDirectory = The specified directory '{0}' cannot be created. +IO.IO_SourceDestMustBeDifferent = Source and destination path must be different. +IO.IO_SourceDestMustHaveSameRoot = Source and destination path must have identical roots. Move will not work across volumes. + +; DirectoryNotFoundException +IO.DriveNotFound_Drive = Could not find the drive '{0}'. The drive might not be ready or might not be mapped. +IO.PathNotFound_Path = Could not find a part of the path '{0}'. +IO.PathNotFound_NoPathName = Could not find a part of the path. + +; PathTooLongException +IO.PathTooLong = The specified file name or path is too long, or a component of the specified path is too long. + +; SecurityException +FileSecurityState_OperationNotPermitted = File operation not permitted. Access to path '{0}' is denied. + +; PrivilegeNotHeldException +PrivilegeNotHeld_Default = The process does not possess some privilege required for this operation. +PrivilegeNotHeld_Named = The process does not possess the '{0}' privilege which is required for this operation. + +; General strings used in the IO package +IO_UnknownFileName = [Unknown] +IO_StreamWriterBufferedDataLost = A StreamWriter was not closed and all buffered data within that StreamWriter was not flushed to the underlying stream. (This was detected when the StreamWriter was finalized with data in its buffer.) A portion of the data was lost. Consider one of calling Close(), Flush(), setting the StreamWriter's AutoFlush property to true, or allocating the StreamWriter with a "using" statement. Stream type: {0}\r\nFile name: {1}\r\nAllocated from:\r\n {2} +IO_StreamWriterBufferedDataLostCaptureAllocatedFromCallstackNotEnabled = callstack information is not captured by default for performance reasons. Please enable captureAllocatedCallStack config switch for streamWriterBufferedDataLost MDA (refer to MSDN MDA documentation for how to do this). + +; +; Serialization Exceptions +; +; SerializationException +Serialization_InvalidData=An error occurred while deserializing the object. The serialized data is corrupt. +Serialization_InvalidPtrValue = An IntPtr or UIntPtr with an eight byte value cannot be deserialized on a machine with a four byte word size. +Serialization_MemberTypeNotRecognized = Unknown member type. +Serialization_InsufficientState = Insufficient state to return the real object. +Serialization_InvalidFieldState = Object fields may not be properly initialized. +Serialization_MissField = Field {0} is missing. +Serialization_NullSignature = The method signature cannot be null. +Serialization_UnknownMember = Cannot get the member '{0}'. +Serialization_InsufficientDeserializationState = Insufficient state to deserialize the object. Missing field '{0}'. More information is needed. +Serialization_UnableToFindModule = The given module {0} cannot be found within the assembly {1}. +Serialization_InvalidOnDeser = OnDeserialization method was called while the object was not being deserialized. +Serialization_MissingKeys = The Keys for this Hashtable are missing. +Serialization_MissingValues = The values for this dictionary are missing. +Serialization_NullKey = One of the serialized keys is null. +Serialization_KeyValueDifferentSizes = The keys and values arrays have different sizes. +Serialization_SameNameTwice = Cannot add the same member twice to a SerializationInfo object. +Serialization_BadParameterInfo = Non existent ParameterInfo. Position bigger than member's parameters length. +Serialization_NoParameterInfo = Serialized member does not have a ParameterInfo. +Serialization_NotFound = Member '{0}' was not found. +Serialization_StringBuilderMaxCapacity = The serialized MaxCapacity property of StringBuilder must be positive and greater than or equal to the String length. +Serialization_StringBuilderCapacity = The serialized Capacity property of StringBuilder must be positive, less than or equal to MaxCapacity and greater than or equal to the String length. +Serialization_InvalidDelegateType = Cannot serialize delegates over unmanaged function pointers, dynamic methods or methods outside the delegate creator's assembly. +Serialization_OptionalFieldVersionValue = Version value must be positive. +Serialization_MissingDateTimeData = Invalid serialized DateTime data. Unable to find 'ticks' or 'dateData'. +Serialization_DateTimeTicksOutOfRange = Invalid serialized DateTime data. Ticks must be between DateTime.MinValue.Ticks and DateTime.MaxValue.Ticks. +; The following serialization exception messages appear in native resources too (mscorrc.rc) +Serialization_MemberOutOfRange = The deserialized value of the member "{0}" in the class "{1}" is out of range. + + +; +; StringBuilder Exceptions +; +Arg_LongerThanSrcString = Source string was not long enough. Check sourceIndex and count. + + +; +; System.Threading +; + +; +; Thread Exceptions +; +ThreadState_NoAbortRequested = Unable to reset abort because no abort was requested. +Threading.WaitHandleTooManyPosts = The WaitHandle cannot be signaled because it would exceed its maximum count. +; +; WaitHandleCannotBeOpenedException +; +Threading.WaitHandleCannotBeOpenedException = No handle of the given name exists. +Threading.WaitHandleCannotBeOpenedException_InvalidHandle = A WaitHandle with system-wide name '{0}' cannot be created. A WaitHandle of a different type might have the same name. + +; +; AbandonedMutexException +; +Threading.AbandonedMutexException = The wait completed due to an abandoned mutex. + +; AggregateException +AggregateException_ctor_DefaultMessage=One or more errors occurred. +AggregateException_ctor_InnerExceptionNull=An element of innerExceptions was null. +AggregateException_DeserializationFailure=The serialization stream contains no inner exceptions. +AggregateException_ToString={0}{1}---> (Inner Exception #{2}) {3}{4}{5} + +; Cancellation +CancellationToken_CreateLinkedToken_TokensIsEmpty=No tokens were supplied. +CancellationTokenSource_Disposed=The CancellationTokenSource has been disposed. +CancellationToken_SourceDisposed=The CancellationTokenSource associated with this CancellationToken has been disposed. + +; Exceptions shared by all concurrent collection +ConcurrentCollection_SyncRoot_NotSupported=The SyncRoot property may not be used for the synchronization of concurrent collections. + +; Exceptions shared by ConcurrentStack and ConcurrentQueue +ConcurrentStackQueue_OnDeserialization_NoData=The serialization stream contains no elements. + +; ConcurrentStack<T> +ConcurrentStack_PushPopRange_StartOutOfRange=The startIndex argument must be greater than or equal to zero. +ConcurrentStack_PushPopRange_CountOutOfRange=The count argument must be greater than or equal to zero. +ConcurrentStack_PushPopRange_InvalidCount=The sum of the startIndex and count arguments must be less than or equal to the collection's Count. + +; ConcurrentDictionary<TKey, TValue> +ConcurrentDictionary_ItemKeyIsNull=TKey is a reference type and item.Key is null. +ConcurrentDictionary_SourceContainsDuplicateKeys=The source argument contains duplicate keys. +ConcurrentDictionary_IndexIsNegative=The index argument is less than zero. +ConcurrentDictionary_ConcurrencyLevelMustBePositive=The concurrencyLevel argument must be positive. +ConcurrentDictionary_CapacityMustNotBeNegative=The capacity argument must be greater than or equal to zero. +ConcurrentDictionary_ArrayNotLargeEnough=The index is equal to or greater than the length of the array, or the number of elements in the dictionary is greater than the available space from index to the end of the destination array. +ConcurrentDictionary_ArrayIncorrectType=The array is multidimensional, or the type parameter for the set cannot be cast automatically to the type of the destination array. +ConcurrentDictionary_KeyAlreadyExisted=The key already existed in the dictionary. +ConcurrentDictionary_TypeOfKeyIncorrect=The key was of an incorrect type for this dictionary. +ConcurrentDictionary_TypeOfValueIncorrect=The value was of an incorrect type for this dictionary. + +; Partitioner +Partitioner_DynamicPartitionsNotSupported=Dynamic partitions are not supported by this partitioner. + +; OrderablePartitioner +OrderablePartitioner_GetPartitions_WrongNumberOfPartitions=GetPartitions returned an incorrect number of partitions. + +; PartitionerStatic +PartitionerStatic_CurrentCalledBeforeMoveNext=MoveNext must be called at least once before calling Current. +PartitionerStatic_CanNotCallGetEnumeratorAfterSourceHasBeenDisposed=Can not call GetEnumerator on partitions after the source enumerable is disposed + +; CDSCollectionETWBCLProvider events +event_ConcurrentStack_FastPushFailed=Push to ConcurrentStack spun {0} time(s). +event_ConcurrentStack_FastPopFailed=Pop from ConcurrentStack spun {0} time(s). +event_ConcurrentDictionary_AcquiringAllLocks=ConcurrentDictionary acquiring all locks on {0} bucket(s). +event_ConcurrentBag_TryTakeSteals=ConcurrentBag stealing in TryTake. +event_ConcurrentBag_TryPeekSteals=ConcurrentBag stealing in TryPeek. + +; CountdownEvent +CountdownEvent_Decrement_BelowZero=Invalid attempt made to decrement the event's count below zero. +CountdownEvent_Increment_AlreadyZero=The event is already signaled and cannot be incremented. +CountdownEvent_Increment_AlreadyMax=The increment operation would cause the CurrentCount to overflow. + +; Parallel +Parallel_Invoke_ActionNull=One of the actions was null. +Parallel_ForEach_OrderedPartitionerKeysNotNormalized=This method requires the use of an OrderedPartitioner with the KeysNormalized property set to true. +Parallel_ForEach_PartitionerNotDynamic=The Partitioner used here must support dynamic partitioning. +Parallel_ForEach_PartitionerReturnedNull=The Partitioner used here returned a null partitioner source. +Parallel_ForEach_NullEnumerator=The Partitioner source returned a null enumerator. + +; Semaphore +Argument_SemaphoreInitialMaximum=The initial count for the semaphore must be greater than or equal to zero and less than the maximum count. + +; SemaphoreFullException +Threading_SemaphoreFullException=Adding the specified count to the semaphore would cause it to exceed its maximum count. + +; Lazy +Lazy_ctor_ValueSelectorNull=The valueSelector argument is null. +Lazy_ctor_InfoNull=The info argument is null. +Lazy_ctor_deserialization_ValueInvalid=The Value cannot be null. +Lazy_ctor_ModeInvalid=The mode argument specifies an invalid value. +Lazy_CreateValue_NoParameterlessCtorForT=The lazily-initialized type does not have a public, parameterless constructor. +Lazy_StaticInit_InvalidOperation=ValueFactory returned null. +Lazy_Value_RecursiveCallsToValue=ValueFactory attempted to access the Value property of this instance. +Lazy_ToString_ValueNotCreated=Value is not created. + + +;ThreadLocal +ThreadLocal_Value_RecursiveCallsToValue=ValueFactory attempted to access the Value property of this instance. +ThreadLocal_Disposed=The ThreadLocal object has been disposed. +ThreadLocal_ValuesNotAvailable=The ThreadLocal object is not tracking values. To use the Values property, use a ThreadLocal constructor that accepts the trackAllValues parameter and set the parameter to true. + +; SemaphoreSlim +SemaphoreSlim_ctor_InitialCountWrong=The initialCount argument must be non-negative and less than or equal to the maximumCount. +SemaphoreSlim_ctor_MaxCountWrong=The maximumCount argument must be a positive number. If a maximum is not required, use the constructor without a maxCount parameter. +SemaphoreSlim_Wait_TimeoutWrong=The timeout must represent a value between -1 and Int32.MaxValue, inclusive. +SemaphoreSlim_Release_CountWrong=The releaseCount argument must be greater than zero. +SemaphoreSlim_Disposed=The semaphore has been disposed. + +; ManualResetEventSlim +ManualResetEventSlim_ctor_SpinCountOutOfRange=The spinCount argument must be in the range 0 to {0}, inclusive. +ManualResetEventSlim_ctor_TooManyWaiters=There are too many threads currently waiting on the event. A maximum of {0} waiting threads are supported. +ManualResetEventSlim_Disposed=The event has been disposed. + +; SpinLock +SpinLock_TryEnter_ArgumentOutOfRange=The timeout must be a value between -1 and Int32.MaxValue, inclusive. +SpinLock_TryEnter_LockRecursionException=The calling thread already holds the lock. +SpinLock_TryReliableEnter_ArgumentException=The tookLock argument must be set to false before calling this method. +SpinLock_Exit_SynchronizationLockException=The calling thread does not hold the lock. +SpinLock_IsHeldByCurrentThread=Thread tracking is disabled. + +; SpinWait +SpinWait_SpinUntil_TimeoutWrong=The timeout must represent a value between -1 and Int32.MaxValue, inclusive. +SpinWait_SpinUntil_ArgumentNull=The condition argument is null. + +; CdsSyncEtwBCLProvider events +event_SpinLock_FastPathFailed=SpinLock beginning to spin. +event_SpinWait_NextSpinWillYield=Next spin will yield. +event_Barrier_PhaseFinished=Barrier finishing phase {1}. + +#if PLATFORM_UNIX +; Unix threading +PlatformNotSupported_NamedSynchronizationPrimitives=The named version of this synchronization primitive is not supported on this platform. +PlatformNotSupported_NamedSyncObjectWaitAnyWaitAll=Wait operations on multiple wait handles including a named synchronization primitive are not supported on this platform. +; OSX File locking +PlatformNotSupported_OSXFileLocking=Locking/unlocking file regions is not supported on this platform. Use FileShare on the entire file instead. +#endif + +; +; System.Threading.Tasks +; + +; AsyncMethodBuilder +AsyncMethodBuilder_InstanceNotInitialized=The builder was not properly initialized. + +; TaskAwaiter and YieldAwaitable +AwaitableAwaiter_InstanceNotInitialized=The awaitable or awaiter was not properly initialized. +TaskAwaiter_TaskNotCompleted=The awaited task has not yet completed. + +; Task<T> +TaskT_SetException_HasAnInitializer=A task's Exception may only be set directly if the task was created without a function. +TaskT_TransitionToFinal_AlreadyCompleted=An attempt was made to transition a task to a final state when it had already completed. +TaskT_ctor_SelfReplicating=It is invalid to specify TaskCreationOptions.SelfReplicating for a Task<TResult>. +TaskT_DebuggerNoResult={Not yet computed} + +; Task +Task_ctor_LRandSR=(Internal)An attempt was made to create a LongRunning SelfReplicating task. +Task_ThrowIfDisposed=The task has been disposed. +Task_Dispose_NotCompleted=A task may only be disposed if it is in a completion state (RanToCompletion, Faulted or Canceled). +Task_Start_Promise=Start may not be called on a promise-style task. +Task_Start_AlreadyStarted=Start may not be called on a task that was already started. +Task_Start_TaskCompleted=Start may not be called on a task that has completed. +Task_Start_ContinuationTask=Start may not be called on a continuation task. +Task_RunSynchronously_AlreadyStarted=RunSynchronously may not be called on a task that was already started. +Task_RunSynchronously_TaskCompleted=RunSynchronously may not be called on a task that has already completed. +Task_RunSynchronously_Promise=RunSynchronously may not be called on a task not bound to a delegate, such as the task returned from an asynchronous method. +Task_RunSynchronously_Continuation=RunSynchronously may not be called on a continuation task. +Task_ContinueWith_NotOnAnything=The specified TaskContinuationOptions excluded all continuation kinds. +Task_ContinueWith_ESandLR=The specified TaskContinuationOptions combined LongRunning and ExecuteSynchronously. Synchronous continuations should not be long running. +Task_MultiTaskContinuation_NullTask=The tasks argument included a null value. +Task_MultiTaskContinuation_FireOptions=It is invalid to exclude specific continuation kinds for continuations off of multiple tasks. +Task_MultiTaskContinuation_EmptyTaskList=The tasks argument contains no tasks. +Task_FromAsync_TaskManagerShutDown=FromAsync was called with a TaskManager that had already shut down. +Task_FromAsync_SelfReplicating=It is invalid to specify TaskCreationOptions.SelfReplicating in calls to FromAsync. +Task_FromAsync_LongRunning=It is invalid to specify TaskCreationOptions.LongRunning in calls to FromAsync. +Task_FromAsync_PreferFairness=It is invalid to specify TaskCreationOptions.PreferFairness in calls to FromAsync. +Task_WaitMulti_NullTask=The tasks array included at least one null element. +Task_Delay_InvalidMillisecondsDelay=The value needs to be either -1 (signifying an infinite timeout), 0 or a positive integer. +Task_Delay_InvalidDelay=The value needs to translate in milliseconds to -1 (signifying an infinite timeout), 0 or a positive integer less than or equal to Int32.MaxValue. + +; TaskCanceledException +TaskCanceledException_ctor_DefaultMessage=A task was canceled. + +;TaskCompletionSource<T> +TaskCompletionSourceT_TrySetException_NullException=The exceptions collection included at least one null element. +TaskCompletionSourceT_TrySetException_NoExceptions=The exceptions collection was empty. + +;TaskExceptionHolder +TaskExceptionHolder_UnknownExceptionType=(Internal)Expected an Exception or an IEnumerable<Exception> +TaskExceptionHolder_UnhandledException=A Task's exception(s) were not observed either by Waiting on the Task or accessing its Exception property. As a result, the unobserved exception was rethrown by the finalizer thread. + +; TaskScheduler +TaskScheduler_ExecuteTask_TaskAlreadyExecuted=ExecuteTask may not be called for a task which was already executed. +TaskScheduler_ExecuteTask_WrongTaskScheduler=ExecuteTask may not be called for a task which was previously queued to a different TaskScheduler. +TaskScheduler_InconsistentStateAfterTryExecuteTaskInline=The TryExecuteTaskInline call to the underlying scheduler succeeded, but the task body was not invoked. +TaskScheduler_FromCurrentSynchronizationContext_NoCurrent=The current SynchronizationContext may not be used as a TaskScheduler. + +; TaskSchedulerException +TaskSchedulerException_ctor_DefaultMessage=An exception was thrown by a TaskScheduler. + +; +; ParallelState ( used in Parallel.For(), Parallel.ForEach() ) +ParallelState_Break_InvalidOperationException_BreakAfterStop=Break was called after Stop was called. +ParallelState_Stop_InvalidOperationException_StopAfterBreak=Stop was called after Break was called. +ParallelState_NotSupportedException_UnsupportedMethod=This method is not supported. + +; +; TPLETWProvider events +event_ParallelLoopBegin=Beginning {3} loop {2} from Task {1}. +event_ParallelLoopEnd=Ending loop {2} after {3} iterations. +event_ParallelInvokeBegin=Beginning ParallelInvoke {2} from Task {1} for {4} actions. +event_ParallelInvokeEnd=Ending ParallelInvoke {2}. +event_ParallelFork=Task {1} entering fork/join {2}. +event_ParallelJoin=Task {1} leaving fork/join {2}. +event_TaskScheduled=Task {2} scheduled to TaskScheduler {0}. +event_TaskStarted=Task {2} executing. +event_TaskCompleted=Task {2} completed. +event_TaskWaitBegin=Beginning wait ({3}) on Task {2}. +event_TaskWaitEnd=Ending wait on Task {2}. + + +; +; Weak Reference Exception +; +WeakReference_NoLongerValid = The weak reference is no longer valid. + + +; +; Interop Exceptions +; +Interop.COM_TypeMismatch = Type mismatch between source and destination types. +Interop_Marshal_Unmappable_Char = Cannot marshal: Encountered unmappable character. + +; +; Loader Exceptions +; +Loader_InvalidPath = Relative path must be a string that contains the substring, "..", or does not contain a root directory. +Loader_Name = Name: +Loader_NoContextPolicies = There are no context policies. +Loader_ContextPolicies = Context Policies: + +; +; AppDomain Exceptions +AppDomain_RequireApplicationName = ApplicationName must be set before the DynamicBase can be set. +AppDomain_AppBaseNotSet = The ApplicationBase must be set before retrieving this property. +AppDomain_BindingModelIsLocked = Binding model is already locked for the AppDomain and cannot be reset. +Argument_CustomAssemblyLoadContextRequestedNameMismatch = Resolved assembly's simple name should be the same as of the requested assembly. + +; +; XMLSyntaxExceptions +XMLSyntax_UnexpectedEndOfFile = Unexpected end of file. +XMLSyntax_ExpectedCloseBracket = Expected > character. +XMLSyntax_ExpectedSlashOrString = Expected / character or string. +XMLSyntax_UnexpectedCloseBracket = Unexpected > character. +XMLSyntax_SyntaxError = Invalid syntax on line {0}. +XMLSyntax_SyntaxErrorEx = Invalid syntax on line {0} - '{1}'. +XMLSyntax_InvalidSyntax = Invalid syntax. +XML_Syntax_InvalidSyntaxInFile = Invalid XML in file '{0}' near element '{1}'. +XMLSyntax_InvalidSyntaxSatAssemTag = Invalid XML in file "{0}" near element "{1}". The <satelliteassemblies> section only supports <assembly> tags. +XMLSyntax_InvalidSyntaxSatAssemTagBadAttr = Invalid XML in file "{0}" near "{1}" and "{2}". In the <satelliteassemblies> section, the <assembly> tag must have exactly 1 attribute called 'name', whose value is a fully-qualified assembly name. +XMLSyntax_InvalidSyntaxSatAssemTagNoAttr = Invalid XML in file "{0}". In the <satelliteassemblies> section, the <assembly> tag must have exactly 1 attribute called 'name', whose value is a fully-qualified assembly name. + +; MembershipConditions +StrongName_ToString = StrongName - {0}{1}{2} +StrongName_Name = name = {0} +StrongName_Version = version = {0} +Site_ToString = Site +Publisher_ToString = Publisher +Hash_ToString = Hash - {0} = {1} +ApplicationDirectory_ToString = ApplicationDirectory +Zone_ToString = Zone - {0} +All_ToString = All code +Url_ToString = Url +GAC_ToString = GAC + +; Interop non exception strings. +TypeLibConverter_ImportedTypeLibProductName = Assembly imported from type library '{0}'. + +; +; begin System.TimeZoneInfo ArgumentException's +; +Argument_AdjustmentRulesNoNulls = The AdjustmentRule array cannot contain null elements. +Argument_AdjustmentRulesOutOfOrder = The elements of the AdjustmentRule array must be in chronological order and must not overlap. +Argument_AdjustmentRulesAmbiguousOverlap = The elements of the AdjustmentRule array must not contain ambiguous time periods that extend beyond the DateStart or DateEnd properties of the element. +Argument_AdjustmentRulesrDaylightSavingTimeOverlap = The elements of the AdjustmentRule array must not contain Daylight Saving Time periods that overlap adjacent elements in such a way as to cause invalid or ambiguous time periods. +Argument_AdjustmentRulesrDaylightSavingTimeOverlapNonRuleRange = The elements of the AdjustmentRule array must not contain Daylight Saving Time periods that overlap the DateStart or DateEnd properties in such a way as to cause invalid or ambiguous time periods. +Argument_AdjustmentRulesInvalidOverlap = The elements of the AdjustmentRule array must not contain invalid time periods that extend beyond the DateStart or DateEnd properties of the element. +Argument_ConvertMismatch = The conversion could not be completed because the supplied DateTime did not have the Kind property set correctly. For example, when the Kind property is DateTimeKind.Local, the source time zone must be TimeZoneInfo.Local. +Argument_DateTimeHasTimeOfDay = The supplied DateTime includes a TimeOfDay setting. This is not supported. +Argument_DateTimeIsInvalid = The supplied DateTime represents an invalid time. For example, when the clock is adjusted forward, any time in the period that is skipped is invalid. +Argument_DateTimeIsNotAmbiguous = The supplied DateTime is not in an ambiguous time range. +Argument_DateTimeOffsetIsNotAmbiguous = The supplied DateTimeOffset is not in an ambiguous time range. +Argument_DateTimeKindMustBeUnspecifiedOrUtc = The supplied DateTime must have the Kind property set to DateTimeKind.Unspecified or DateTimeKind.Utc. +Argument_DateTimeHasTicks = The supplied DateTime must have the Year, Month, and Day properties set to 1. The time cannot be specified more precisely than whole milliseconds. +Argument_InvalidId = The specified ID parameter '{0}' is not supported. +Argument_InvalidSerializedString = The specified serialized string '{0}' is not supported. +Argument_InvalidREG_TZI_FORMAT = The REG_TZI_FORMAT structure is corrupt. +Argument_OutOfOrderDateTimes = The DateStart property must come before the DateEnd property. +Argument_TimeSpanHasSeconds = The TimeSpan parameter cannot be specified more precisely than whole minutes. +Argument_TimeZoneInfoBadTZif = The tzfile does not begin with the magic characters 'TZif'. Please verify that the file is not corrupt. +Argument_TimeZoneInfoInvalidTZif = The TZif data structure is corrupt. +Argument_TransitionTimesAreIdentical = The DaylightTransitionStart property must not equal the DaylightTransitionEnd property. +; +; begin System.TimeZoneInfo ArgumentOutOfRangeException's +; +ArgumentOutOfRange_DayParam = The Day parameter must be in the range 1 through 31. +ArgumentOutOfRange_DayOfWeek = The DayOfWeek enumeration must be in the range 0 through 6. +ArgumentOutOfRange_MonthParam = The Month parameter must be in the range 1 through 12. +ArgumentOutOfRange_UtcOffset = The TimeSpan parameter must be within plus or minus 14.0 hours. +ArgumentOutOfRange_UtcOffsetAndDaylightDelta = The sum of the BaseUtcOffset and DaylightDelta properties must within plus or minus 14.0 hours. +ArgumentOutOfRange_Week = The Week parameter must be in the range 1 through 5. +; +; begin System.TimeZoneInfo InvalidTimeZoneException's +; +InvalidTimeZone_InvalidRegistryData = The time zone ID '{0}' was found on the local computer, but the registry information was corrupt. +InvalidTimeZone_InvalidFileData = The time zone ID '{0}' was found on the local computer, but the file at '{1}' was corrupt. +InvalidTimeZone_InvalidWin32APIData = The Local time zone was found on the local computer, but the data was corrupt. +InvalidTimeZone_NoTTInfoStructures = There are no ttinfo structures in the tzfile. At least one ttinfo structure is required in order to construct a TimeZoneInfo object. +InvalidTimeZone_UnparseablePosixMDateString = '{0}' is not a valid POSIX-TZ-environment-variable MDate rule. A valid rule has the format 'Mm.w.d'. +InvalidTimeZone_JulianDayNotSupported = Julian dates in POSIX strings are unsupported. +; +; begin System.TimeZoneInfo SecurityException's +; +Security_CannotReadRegistryData = The time zone ID '{0}' was found on the local computer, but the application does not have permission to read the registry information. +Security_CannotReadFileData = The time zone ID '{0}' was found on the local computer, but the application does not have permission to read the file. +; +; begin System.TimeZoneInfo SerializationException's +; +Serialization_CorruptField = The value of the field '{0}' is invalid. The serialized data is corrupt. +Serialization_InvalidEscapeSequence = The serialized data contained an invalid escape sequence '\\{0}'. +; +; begin System.TimeZoneInfo TimeZoneNotFoundException's +; +TimeZoneNotFound_MissingData = The time zone ID '{0}' was not found on the local computer. +; +; end System.TimeZoneInfo +; + + +; Tuple +ArgumentException_TupleIncorrectType=Argument must be of type {0}. +ArgumentException_TupleNonIComparableElement=The tuple contains an element of type {0} which does not implement the IComparable interface. +ArgumentException_TupleLastArgumentNotATuple=The last element of an eight element tuple must be a Tuple. +ArgumentException_OtherNotArrayOfCorrectLength=Object is not a array with the same number of elements as the array to compare it to. + +; WinRT collection adapters +Argument_IndexOutOfArrayBounds=The specified index is out of bounds of the specified array. +Argument_InsufficientSpaceToCopyCollection=The specified space is not sufficient to copy the elements from this Collection. +ArgumentOutOfRange_IndexLargerThanMaxValue=This collection cannot work with indices larger than Int32.MaxValue - 1 (0x7FFFFFFF - 1). +ArgumentOutOfRange_IndexOutOfRange=The specified index is outside the current index range of this collection. +InvalidOperation_CollectionBackingListTooLarge=The collection backing this List contains too many elements. +InvalidOperation_CollectionBackingDictionaryTooLarge=The collection backing this Dictionary contains too many elements. +InvalidOperation_CannotRemoveLastFromEmptyCollection=Cannot remove the last element from an empty collection. + +; Buffers +ArgumentException_BufferNotFromPool=The buffer is not associated with this pool and may not be returned to it. + +;------------------ +; Encoding names: +; +;Total items: 147 +; +Globalization.cp_1200 = Unicode +Globalization.cp_1201 = Unicode (Big-Endian) +Globalization.cp_65001 = Unicode (UTF-8) +Globalization.cp_65000 = Unicode (UTF-7) +Globalization.cp_12000 = Unicode (UTF-32) +Globalization.cp_12001 = Unicode (UTF-32 Big-Endian) +Globalization.cp_20127 = US-ASCII +Globalization.cp_28591 = Western European (ISO) + +#endif // INCLUDE_DEBUG + +;------------------ + +; ValueTuple +ArgumentException_ValueTupleIncorrectType=Argument must be of type {0}. +ArgumentException_ValueTupleLastArgumentNotAValueTuple=The last element of an eight element ValueTuple must be a ValueTuple. + +; SafeSerializationEventArgs +Serialization_NonSerType=Type '{0}' in Assembly '{1}' is not marked as serializable. + diff --git a/src/mscorlib/src/System/Activator.cs b/src/mscorlib/src/System/Activator.cs index 34c6ea5874..3ee9ec5180 100644 --- a/src/mscorlib/src/System/Activator.cs +++ b/src/mscorlib/src/System/Activator.cs @@ -66,7 +66,7 @@ namespace System Contract.EndContractBlock(); if (type is System.Reflection.Emit.TypeBuilder) - throw new NotSupportedException(SR.NotSupported_CreateInstanceWithTypeBuilder); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_CreateInstanceWithTypeBuilder")); // If they didn't specify a lookup, then we will provide the default lookup. if ((bindingAttr & (BindingFlags)LookupMask) == 0) @@ -74,13 +74,13 @@ namespace System if (activationAttributes != null && activationAttributes.Length > 0) { - throw new PlatformNotSupportedException(SR.NotSupported_ActivAttr); + throw new PlatformNotSupportedException(Environment.GetResourceString("NotSupported_ActivAttr")); } RuntimeType rt = type.UnderlyingSystemType as RuntimeType; if (rt == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(type)); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return rt.CreateInstanceImpl(bindingAttr, binder, args, culture, activationAttributes, ref stackMark); @@ -164,7 +164,7 @@ namespace System RuntimeType rt = type.UnderlyingSystemType as RuntimeType; if (rt == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(type)); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return rt.CreateInstanceDefaultCtor(!nonPublic, false, true, ref stackMark); @@ -178,7 +178,7 @@ namespace System // This is a workaround to maintain compatibility with V2. Without this we would throw a NotSupportedException for void[]. // Array, Ref, and Pointer types don't have default constructors. if (rt.HasElementType) - throw new MissingMethodException(SR.Arg_NoDefCTor); + throw new MissingMethodException(Environment.GetResourceString("Arg_NoDefCTor")); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; @@ -371,7 +371,7 @@ namespace System if (Attr.Length > 0) { if (((ComVisibleAttribute)Attr[0]).Value == false) - throw new TypeLoadException(SR.Argument_TypeMustBeVisibleFromCom); + throw new TypeLoadException(Environment.GetResourceString("Argument_TypeMustBeVisibleFromCom")); } Log(assembly != null, "CreateInstance:: ", "Loaded " + assembly.FullName, "Failed to Load: " + assemblyName); diff --git a/src/mscorlib/src/System/AggregateException.cs b/src/mscorlib/src/System/AggregateException.cs index 22bc323215..3a3b08dc04 100644 --- a/src/mscorlib/src/System/AggregateException.cs +++ b/src/mscorlib/src/System/AggregateException.cs @@ -38,7 +38,7 @@ namespace System /// Initializes a new instance of the <see cref="AggregateException"/> class. /// </summary> public AggregateException() - : base(SR.AggregateException_ctor_DefaultMessage) + : base(Environment.GetResourceString("AggregateException_ctor_DefaultMessage")) { m_innerExceptions = new ReadOnlyCollection<Exception>(new Exception[0]); } @@ -83,7 +83,7 @@ namespace System /// <exception cref="T:System.ArgumentException">An element of <paramref name="innerExceptions"/> is /// null.</exception> public AggregateException(IEnumerable<Exception> innerExceptions) : - this(SR.AggregateException_ctor_DefaultMessage, innerExceptions) + this(Environment.GetResourceString("AggregateException_ctor_DefaultMessage"), innerExceptions) { } @@ -97,7 +97,7 @@ namespace System /// <exception cref="T:System.ArgumentException">An element of <paramref name="innerExceptions"/> is /// null.</exception> public AggregateException(params Exception[] innerExceptions) : - this(SR.AggregateException_ctor_DefaultMessage, innerExceptions) + this(Environment.GetResourceString("AggregateException_ctor_DefaultMessage"), innerExceptions) { } @@ -161,7 +161,7 @@ namespace System if (exceptionsCopy[i] == null) { - throw new ArgumentException(SR.AggregateException_ctor_InnerExceptionNull); + throw new ArgumentException(Environment.GetResourceString("AggregateException_ctor_InnerExceptionNull")); } } @@ -180,7 +180,7 @@ namespace System /// <exception cref="T:System.ArgumentException">An element of <paramref name="innerExceptionInfos"/> is /// null.</exception> internal AggregateException(IEnumerable<ExceptionDispatchInfo> innerExceptionInfos) : - this(SR.AggregateException_ctor_DefaultMessage, innerExceptionInfos) + this(Environment.GetResourceString("AggregateException_ctor_DefaultMessage"), innerExceptionInfos) { } @@ -240,7 +240,7 @@ namespace System if (exceptionsCopy[i] == null) { - throw new ArgumentException(SR.AggregateException_ctor_InnerExceptionNull); + throw new ArgumentException(Environment.GetResourceString("AggregateException_ctor_InnerExceptionNull")); } } @@ -267,7 +267,7 @@ namespace System Exception[] innerExceptions = info.GetValue("InnerExceptions", typeof(Exception[])) as Exception[]; if (innerExceptions == null) { - throw new SerializationException(SR.AggregateException_DeserializationFailure); + throw new SerializationException(Environment.GetResourceString("AggregateException_DeserializationFailure")); } m_innerExceptions = new ReadOnlyCollection<Exception>(innerExceptions); @@ -466,7 +466,7 @@ namespace System { text = String.Format( CultureInfo.InvariantCulture, - SR.AggregateException_ToString, + Environment.GetResourceString("AggregateException_ToString"), text, Environment.NewLine, i, m_innerExceptions[i].ToString(), "<---", Environment.NewLine); } diff --git a/src/mscorlib/src/System/AppContext/AppContext.cs b/src/mscorlib/src/System/AppContext/AppContext.cs index 7c7e74f19b..b8d3076e8c 100644 --- a/src/mscorlib/src/System/AppContext/AppContext.cs +++ b/src/mscorlib/src/System/AppContext/AppContext.cs @@ -116,7 +116,7 @@ namespace System if (switchName == null) throw new ArgumentNullException(nameof(switchName)); if (switchName.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(switchName)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(switchName)); // By default, the switch is not enabled. isEnabled = false; @@ -212,7 +212,7 @@ namespace System if (switchName == null) throw new ArgumentNullException(nameof(switchName)); if (switchName.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(switchName)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(switchName)); SwitchValueState switchValue = (isEnabled ? SwitchValueState.HasTrueValue : SwitchValueState.HasFalseValue) | SwitchValueState.HasLookedForOverride; diff --git a/src/mscorlib/src/System/AppDomain.cs b/src/mscorlib/src/System/AppDomain.cs index 893389678d..4db0c15fda 100644 --- a/src/mscorlib/src/System/AppDomain.cs +++ b/src/mscorlib/src/System/AppDomain.cs @@ -133,7 +133,7 @@ namespace System if (nested != null) nestedDelegates.Add(nested); else - throw new ArgumentException(SR.Arg_MustBeStatic, + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeStatic"), list[i].Method.ReflectedType.FullName + "::" + list[i].Method.Name); } else @@ -341,7 +341,7 @@ namespace System // uninitialized object through remoting, etc. if (_pDomain.IsNull()) { - throw new InvalidOperationException(SR.Argument_InvalidHandle); + throw new InvalidOperationException(Environment.GetResourceString("Argument_InvalidHandle")); } return new AppDomainHandle(_pDomain); @@ -397,20 +397,20 @@ namespace System } catch (FileNotFoundException e) { - throw new TypeLoadException(SR.Argument_NoDomainManager, e); + throw new TypeLoadException(Environment.GetResourceString("Argument_NoDomainManager"), e); } catch (SecurityException e) { - throw new TypeLoadException(SR.Argument_NoDomainManager, e); + throw new TypeLoadException(Environment.GetResourceString("Argument_NoDomainManager"), e); } catch (TypeLoadException e) { - throw new TypeLoadException(SR.Argument_NoDomainManager, e); + throw new TypeLoadException(Environment.GetResourceString("Argument_NoDomainManager"), e); } if (_domainManager == null) { - throw new TypeLoadException(SR.Argument_NoDomainManager); + throw new TypeLoadException(Environment.GetResourceString("Argument_NoDomainManager")); } // If this domain was not created by a managed call to CreateDomain, then the AppDomainSetup @@ -501,7 +501,7 @@ namespace System { #if FEATURE_APPX if (IsAppXModel()) - throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.LoadFrom")); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_AppX", "Assembly.LoadFrom")); #endif } @@ -513,7 +513,7 @@ namespace System { #if FEATURE_APPX if (IsAppXModel()) - throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.LoadFile")); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_AppX", "Assembly.LoadFile")); #endif } @@ -525,7 +525,7 @@ namespace System { #if FEATURE_APPX if (IsAppXModel()) - throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.ReflectionOnlyLoad")); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_AppX", "Assembly.ReflectionOnlyLoad")); #endif } @@ -537,7 +537,7 @@ namespace System { #if FEATURE_APPX if (IsAppXModel()) - throw new NotSupportedException(SR.Format(SR.NotSupported_AppX, "Assembly.Load(byte[], ...)")); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_AppX", "Assembly.Load(byte[], ...)")); #endif } @@ -682,16 +682,16 @@ namespace System String fn = nGetFriendlyName(); if (fn != null) { - sb.Append(SR.Loader_Name + fn); + sb.Append(Environment.GetResourceString("Loader_Name") + fn); sb.Append(Environment.NewLine); } if (_Policies == null || _Policies.Length == 0) - sb.Append(SR.Loader_NoContextPolicies + sb.Append(Environment.GetResourceString("Loader_NoContextPolicies") + Environment.NewLine); else { - sb.Append(SR.Loader_ContextPolicies + sb.Append(Environment.GetResourceString("Loader_ContextPolicies") + Environment.NewLine); for (int i = 0; i < _Policies.Length; i++) { @@ -729,7 +729,7 @@ namespace System } if (currentVal != null) { - throw new InvalidOperationException(SR.InvalidOperation_SetData_OnlyOnce); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_SetData_OnlyOnce")); } lock (((ICollection)LocalStore).SyncRoot) @@ -785,7 +785,7 @@ namespace System private AppDomain() { - throw new NotSupportedException(SR.GetResourceString(ResId.NotSupported_Constructor)); + throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_Constructor)); } [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -1153,7 +1153,7 @@ namespace System throw new ArgumentNullException("APPBASE"); if (PathInternal.IsPartiallyQualified(propertyValues[i])) - throw new ArgumentException(SR.Argument_AbsolutePathRequired); + throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired")); newSetup.ApplicationBase = NormalizePath(propertyValues[i], fullCheck: true); } @@ -1168,7 +1168,7 @@ namespace System case "MultiDomain": newSetup.LoaderOptimization = LoaderOptimization.MultiDomain; break; case "MultiDomainHost": newSetup.LoaderOptimization = LoaderOptimization.MultiDomainHost; break; case "NotSpecified": newSetup.LoaderOptimization = LoaderOptimization.NotSpecified; break; - default: throw new ArgumentException(SR.Argument_UnrecognizedLoaderOptimization, "LOADER_OPTIMIZATION"); + default: throw new ArgumentException(Environment.GetResourceString("Argument_UnrecognizedLoaderOptimization"), "LOADER_OPTIMIZATION"); } } else if (propertyNames[i] == "TRUSTED_PLATFORM_ASSEMBLIES" || @@ -1254,7 +1254,7 @@ namespace System continue; if (PathInternal.IsPartiallyQualified(path)) - throw new ArgumentException(SR.Argument_AbsolutePathRequired); + throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired")); string appPath = NormalizePath(path, fullCheck: true); sb.Append(appPath); diff --git a/src/mscorlib/src/System/AppDomainSetup.cs b/src/mscorlib/src/System/AppDomainSetup.cs index 2529660670..34e6cb6010 100644 --- a/src/mscorlib/src/System/AppDomainSetup.cs +++ b/src/mscorlib/src/System/AppDomainSetup.cs @@ -261,7 +261,7 @@ namespace System // with it for "file:\\" + "\\server" and "file:\\\" + "\localpath" if ((len > 8) && ((path[8] == '\\') || (path[8] == '/'))) - throw new ArgumentException(SR.Argument_InvalidPathChars); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidPathChars")); // file:\\\ means local path else @@ -369,7 +369,7 @@ namespace System String appBase = Value[(int)LoaderInformation.ApplicationBaseValue]; if ((appBase == null) || (appBase.Length == 0)) - throw new MemberAccessException(SR.AppDomain_AppBaseNotSet); + throw new MemberAccessException(Environment.GetResourceString("AppDomain_AppBaseNotSet")); StringBuilder result = StringBuilderCache.Acquire(); diff --git a/src/mscorlib/src/System/AppDomainUnloadedException.cs b/src/mscorlib/src/System/AppDomainUnloadedException.cs index b11ae3381e..b8b6150c9f 100644 --- a/src/mscorlib/src/System/AppDomainUnloadedException.cs +++ b/src/mscorlib/src/System/AppDomainUnloadedException.cs @@ -20,7 +20,7 @@ namespace System internal class AppDomainUnloadedException : SystemException { public AppDomainUnloadedException() - : base(SR.Arg_AppDomainUnloadedException) + : base(Environment.GetResourceString("Arg_AppDomainUnloadedException")) { SetErrorCode(__HResults.COR_E_APPDOMAINUNLOADED); } diff --git a/src/mscorlib/src/System/ArgIterator.cs b/src/mscorlib/src/System/ArgIterator.cs index b608e7e494..394d579b94 100644 --- a/src/mscorlib/src/System/ArgIterator.cs +++ b/src/mscorlib/src/System/ArgIterator.cs @@ -131,7 +131,7 @@ namespace System // Inherited from object public override bool Equals(Object o) { - throw new NotSupportedException(SR.NotSupported_NYI); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NYI")); } #else public ArgIterator(RuntimeArgumentHandle arglist) diff --git a/src/mscorlib/src/System/ArgumentOutOfRangeException.cs b/src/mscorlib/src/System/ArgumentOutOfRangeException.cs index a5f838a70f..a20b43ff1f 100644 --- a/src/mscorlib/src/System/ArgumentOutOfRangeException.cs +++ b/src/mscorlib/src/System/ArgumentOutOfRangeException.cs @@ -33,7 +33,7 @@ namespace System get { if (_rangeMessage == null) - _rangeMessage = SR.Arg_ArgumentOutOfRangeException; + _rangeMessage = Environment.GetResourceString("Arg_ArgumentOutOfRangeException"); return _rangeMessage; } } @@ -81,7 +81,7 @@ namespace System String s = base.Message; if (m_actualValue != null) { - String valueMessage = SR.Format(SR.ArgumentOutOfRange_ActualValue, m_actualValue.ToString()); + String valueMessage = Environment.GetResourceString("ArgumentOutOfRange_ActualValue", m_actualValue.ToString()); if (s == null) return valueMessage; return s + Environment.NewLine + valueMessage; diff --git a/src/mscorlib/src/System/Attribute.cs b/src/mscorlib/src/System/Attribute.cs index baa9a71638..7ffbedf78d 100644 --- a/src/mscorlib/src/System/Attribute.cs +++ b/src/mscorlib/src/System/Attribute.cs @@ -431,7 +431,7 @@ namespace System return AttributeUsageAttribute.Default; throw new FormatException( - SR.Format(SR.Format_AttributeUsage, type)); + Environment.GetResourceString("Format_AttributeUsage", type)); } private static Attribute[] CreateAttributeArrayHelper(Type elementType, int elementCount) @@ -459,7 +459,7 @@ namespace System throw new ArgumentNullException(nameof(type)); if (!type.IsSubclassOf(typeof(Attribute)) && type != typeof(Attribute)) - throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass); + throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass")); Contract.EndContractBlock(); switch (element.MemberType) @@ -514,7 +514,7 @@ namespace System throw new ArgumentNullException(nameof(attributeType)); if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute)) - throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass); + throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass")); Contract.EndContractBlock(); switch (element.MemberType) @@ -545,7 +545,7 @@ namespace System if (attrib.Length == 1) return attrib[0]; - throw new AmbiguousMatchException(SR.RFLCT_AmbigCust); + throw new AmbiguousMatchException(Environment.GetResourceString("RFLCT.AmbigCust")); } #endregion @@ -570,10 +570,10 @@ namespace System throw new ArgumentNullException(nameof(attributeType)); if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute)) - throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass); + throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass")); if (element.Member == null) - throw new ArgumentException(SR.Argument_InvalidParameterInfo, nameof(element)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidParameterInfo"), nameof(element)); Contract.EndContractBlock(); @@ -590,7 +590,7 @@ namespace System throw new ArgumentNullException(nameof(element)); if (element.Member == null) - throw new ArgumentException(SR.Argument_InvalidParameterInfo, nameof(element)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidParameterInfo"), nameof(element)); Contract.EndContractBlock(); @@ -616,7 +616,7 @@ namespace System throw new ArgumentNullException(nameof(attributeType)); if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute)) - throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass); + throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass")); Contract.EndContractBlock(); MemberInfo member = element.Member; @@ -634,7 +634,7 @@ namespace System default: Debug.Assert(false, "Invalid type for ParameterInfo member in Attribute class"); - throw new ArgumentException(SR.Argument_InvalidParamInfo); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidParamInfo")); } } @@ -658,7 +658,7 @@ namespace System if (attrib.Length == 1) return attrib[0]; - throw new AmbiguousMatchException(SR.RFLCT_AmbigCust); + throw new AmbiguousMatchException(Environment.GetResourceString("RFLCT.AmbigCust")); } #endregion @@ -692,7 +692,7 @@ namespace System throw new ArgumentNullException(nameof(attributeType)); if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute)) - throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass); + throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass")); Contract.EndContractBlock(); return (Attribute[])element.GetCustomAttributes(attributeType, inherit); @@ -713,7 +713,7 @@ namespace System throw new ArgumentNullException(nameof(attributeType)); if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute)) - throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass); + throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass")); Contract.EndContractBlock(); return element.IsDefined(attributeType, false); @@ -736,7 +736,7 @@ namespace System if (attrib.Length == 1) return attrib[0]; - throw new AmbiguousMatchException(SR.RFLCT_AmbigCust); + throw new AmbiguousMatchException(Environment.GetResourceString("RFLCT.AmbigCust")); } #endregion @@ -756,7 +756,7 @@ namespace System throw new ArgumentNullException(nameof(attributeType)); if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute)) - throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass); + throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass")); Contract.EndContractBlock(); return (Attribute[])element.GetCustomAttributes(attributeType, inherit); @@ -791,7 +791,7 @@ namespace System throw new ArgumentNullException(nameof(attributeType)); if (!attributeType.IsSubclassOf(typeof(Attribute)) && attributeType != typeof(Attribute)) - throw new ArgumentException(SR.Argument_MustHaveAttributeBaseClass); + throw new ArgumentException(Environment.GetResourceString("Argument_MustHaveAttributeBaseClass")); Contract.EndContractBlock(); return element.IsDefined(attributeType, false); @@ -814,7 +814,7 @@ namespace System if (attrib.Length == 1) return attrib[0]; - throw new AmbiguousMatchException(SR.RFLCT_AmbigCust); + throw new AmbiguousMatchException(Environment.GetResourceString("RFLCT.AmbigCust")); } #endregion diff --git a/src/mscorlib/src/System/BadImageFormatException.cs b/src/mscorlib/src/System/BadImageFormatException.cs index 9cb692fc05..13d9556f1d 100644 --- a/src/mscorlib/src/System/BadImageFormatException.cs +++ b/src/mscorlib/src/System/BadImageFormatException.cs @@ -26,7 +26,7 @@ namespace System private String _fusionLog; // fusion log (when applicable) public BadImageFormatException() - : base(SR.Arg_BadImageFormatException) + : base(Environment.GetResourceString("Arg_BadImageFormatException")) { SetErrorCode(__HResults.COR_E_BADIMAGEFORMAT); } @@ -71,7 +71,7 @@ namespace System { if ((_fileName == null) && (HResult == System.__HResults.COR_E_EXCEPTION)) - _message = SR.Arg_BadImageFormatException; + _message = Environment.GetResourceString("Arg_BadImageFormatException"); else _message = FileLoadException.FormatFileLoadExceptionMessage(_fileName, HResult); @@ -88,7 +88,7 @@ namespace System String s = GetType().FullName + ": " + Message; if (_fileName != null && _fileName.Length != 0) - s += Environment.NewLine + SR.Format(SR.IO_FileName_Name, _fileName); + s += Environment.NewLine + Environment.GetResourceString("IO.FileName_Name", _fileName); if (InnerException != null) s = s + " ---> " + InnerException.ToString(); diff --git a/src/mscorlib/src/System/Boolean.cs b/src/mscorlib/src/System/Boolean.cs index 6be8e31f53..7a7ac0eee8 100644 --- a/src/mscorlib/src/System/Boolean.cs +++ b/src/mscorlib/src/System/Boolean.cs @@ -134,7 +134,7 @@ namespace System } if (!(obj is Boolean)) { - throw new ArgumentException(SR.Arg_MustBeBoolean); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeBoolean")); } if (m_value == ((Boolean)obj).m_value) @@ -174,7 +174,7 @@ namespace System Boolean result = false; if (!TryParse(value, out result)) { - throw new FormatException(SR.Format_BadBoolean); + throw new FormatException(Environment.GetResourceString("Format_BadBoolean")); } else { @@ -268,7 +268,7 @@ namespace System /// <internalonly/> char IConvertible.ToChar(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Boolean", "Char")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Boolean", "Char")); } /// <internalonly/> @@ -340,7 +340,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Boolean", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Boolean", "DateTime")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/Buffer.cs b/src/mscorlib/src/System/Buffer.cs index 92b938df8c..5c14d73aa6 100644 --- a/src/mscorlib/src/System/Buffer.cs +++ b/src/mscorlib/src/System/Buffer.cs @@ -142,7 +142,7 @@ namespace System // Is it of primitive types? if (!IsPrimitiveTypeArray(array)) - throw new ArgumentException(SR.Arg_MustBePrimArray, nameof(array)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBePrimArray"), nameof(array)); // Is the index in valid range of the array? if (index < 0 || index >= _ByteLength(array)) @@ -168,7 +168,7 @@ namespace System // Is it of primitive types? if (!IsPrimitiveTypeArray(array)) - throw new ArgumentException(SR.Arg_MustBePrimArray, nameof(array)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBePrimArray"), nameof(array)); // Is the index in valid range of the array? if (index < 0 || index >= _ByteLength(array)) @@ -196,7 +196,7 @@ namespace System // Is it of primitive types? if (!IsPrimitiveTypeArray(array)) - throw new ArgumentException(SR.Arg_MustBePrimArray, nameof(array)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBePrimArray"), nameof(array)); return _ByteLength(array); } diff --git a/src/mscorlib/src/System/Byte.cs b/src/mscorlib/src/System/Byte.cs index e041af2840..9d603600fc 100644 --- a/src/mscorlib/src/System/Byte.cs +++ b/src/mscorlib/src/System/Byte.cs @@ -51,7 +51,7 @@ namespace System } if (!(value is Byte)) { - throw new ArgumentException(SR.Arg_MustBeByte); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeByte")); } return m_value - (((Byte)value).m_value); @@ -123,10 +123,10 @@ namespace System } catch (OverflowException e) { - throw new OverflowException(SR.Overflow_Byte, e); + throw new OverflowException(Environment.GetResourceString("Overflow_Byte"), e); } - if (i < MinValue || i > MaxValue) throw new OverflowException(SR.Overflow_Byte); + if (i < MinValue || i > MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_Byte")); return (byte)i; } @@ -276,7 +276,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Byte", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Byte", "DateTime")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/Char.cs b/src/mscorlib/src/System/Char.cs index 5fa886c4eb..bf3818f985 100644 --- a/src/mscorlib/src/System/Char.cs +++ b/src/mscorlib/src/System/Char.cs @@ -141,7 +141,7 @@ namespace System } if (!(value is Char)) { - throw new ArgumentException(SR.Arg_MustBeChar); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeChar")); } return (m_value - ((Char)value).m_value); @@ -189,7 +189,7 @@ namespace System if (s.Length != 1) { - throw new FormatException(SR.Format_NeedSingleChar); + throw new FormatException(Environment.GetResourceString("Format_NeedSingleChar")); } return s[0]; } @@ -475,7 +475,7 @@ namespace System /// <internalonly/> bool IConvertible.ToBoolean(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Boolean")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Char", "Boolean")); } /// <internalonly/> @@ -535,25 +535,25 @@ namespace System /// <internalonly/> float IConvertible.ToSingle(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Single")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Char", "Single")); } /// <internalonly/> double IConvertible.ToDouble(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Double")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Char", "Double")); } /// <internalonly/> Decimal IConvertible.ToDecimal(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "Decimal")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Char", "Decimal")); } /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Char", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Char", "DateTime")); } /// <internalonly/> @@ -1038,7 +1038,7 @@ namespace System // are considered as irregular code unit sequence, but they are not illegal. if ((utf32 < 0 || utf32 > UNICODE_PLANE16_END) || (utf32 >= HIGH_SURROGATE_START && utf32 <= LOW_SURROGATE_END)) { - throw new ArgumentOutOfRangeException(nameof(utf32), SR.ArgumentOutOfRange_InvalidUTF32); + throw new ArgumentOutOfRangeException(nameof(utf32), Environment.GetResourceString("ArgumentOutOfRange_InvalidUTF32")); } Contract.EndContractBlock(); @@ -1069,11 +1069,11 @@ namespace System { if (!IsHighSurrogate(highSurrogate)) { - throw new ArgumentOutOfRangeException(nameof(highSurrogate), SR.ArgumentOutOfRange_InvalidHighSurrogate); + throw new ArgumentOutOfRangeException(nameof(highSurrogate), Environment.GetResourceString("ArgumentOutOfRange_InvalidHighSurrogate")); } if (!IsLowSurrogate(lowSurrogate)) { - throw new ArgumentOutOfRangeException(nameof(lowSurrogate), SR.ArgumentOutOfRange_InvalidLowSurrogate); + throw new ArgumentOutOfRangeException(nameof(lowSurrogate), Environment.GetResourceString("ArgumentOutOfRange_InvalidLowSurrogate")); } Contract.EndContractBlock(); return (((highSurrogate - CharUnicodeInfo.HIGH_SURROGATE_START) * 0x400) + (lowSurrogate - CharUnicodeInfo.LOW_SURROGATE_START) + UNICODE_PLANE01_START); @@ -1096,7 +1096,7 @@ namespace System if (index < 0 || index >= s.Length) { - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index")); } Contract.EndContractBlock(); // Check if the character at index is a high surrogate. @@ -1117,19 +1117,19 @@ namespace System } else { - throw new ArgumentException(SR.Format(SR.Argument_InvalidHighSurrogate, index), nameof(s)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHighSurrogate", index), nameof(s)); } } else { // Found a high surrogate at the end of the string. - throw new ArgumentException(SR.Format(SR.Argument_InvalidHighSurrogate, index), nameof(s)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHighSurrogate", index), nameof(s)); } } else { // Find a low surrogate at the character pointed by index. - throw new ArgumentException(SR.Format(SR.Argument_InvalidLowSurrogate, index), nameof(s)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidLowSurrogate", index), nameof(s)); } } // Not a high-surrogate or low-surrogate. Genereate the UTF32 value for the BMP characters. diff --git a/src/mscorlib/src/System/Collections/ArrayList.cs b/src/mscorlib/src/System/Collections/ArrayList.cs index c95f9b949d..96aca31bad 100644 --- a/src/mscorlib/src/System/Collections/ArrayList.cs +++ b/src/mscorlib/src/System/Collections/ArrayList.cs @@ -62,7 +62,7 @@ namespace System.Collections // public ArrayList(int capacity) { - if (capacity < 0) throw new ArgumentOutOfRangeException(nameof(capacity), SR.Format(SR.ArgumentOutOfRange_MustBeNonNegNum, nameof(capacity))); + if (capacity < 0) throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_MustBeNonNegNum", nameof(capacity))); Contract.EndContractBlock(); if (capacity == 0) @@ -78,7 +78,7 @@ namespace System.Collections public ArrayList(ICollection c) { if (c == null) - throw new ArgumentNullException(nameof(c), SR.ArgumentNull_Collection); + throw new ArgumentNullException(nameof(c), Environment.GetResourceString("ArgumentNull_Collection")); Contract.EndContractBlock(); int count = c.Count; @@ -108,7 +108,7 @@ namespace System.Collections { if (value < _size) { - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_SmallCapacity); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity")); } Contract.Ensures(Capacity >= 0); Contract.EndContractBlock(); @@ -180,13 +180,13 @@ namespace System.Collections { get { - if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); + if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index")); Contract.EndContractBlock(); return _items[index]; } set { - if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); + if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index")); Contract.EndContractBlock(); _items[index] = value; _version++; @@ -269,7 +269,7 @@ namespace System.Collections public virtual void CopyTo(Array array, int arrayIndex) { if ((array != null) && (array.Rank != 1)) - throw new ArgumentException(SR.Arg_RankMultiDimNotSupported); + throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported")); Contract.EndContractBlock(); // Delegate rest of error checking to Array.Copy. Array.Copy(_items, 0, array, arrayIndex, _size); @@ -324,7 +324,7 @@ namespace System.Collections public virtual void Insert(int index, Object value) { // Note that insertions at the end are legal. - if (index < 0 || index > _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_ArrayListInsert); + if (index < 0 || index > _size) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_ArrayListInsert")); //Contract.Ensures(Count == Contract.OldValue(Count) + 1); Contract.EndContractBlock(); @@ -346,8 +346,8 @@ namespace System.Collections public virtual void InsertRange(int index, ICollection c) { if (c == null) - throw new ArgumentNullException(nameof(c), SR.ArgumentNull_Collection); - if (index < 0 || index > _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); + throw new ArgumentNullException(nameof(c), Environment.GetResourceString("ArgumentNull_Collection")); + if (index < 0 || index > _size) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index")); //Contract.Ensures(Count == Contract.OldValue(Count) + c.Count); Contract.EndContractBlock(); @@ -399,7 +399,7 @@ namespace System.Collections // public virtual void RemoveAt(int index) { - if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); + if (index < 0 || index >= _size) throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index")); Contract.Ensures(Count >= 0); //Contract.Ensures(Count == Contract.OldValue(Count) - 1); Contract.EndContractBlock(); @@ -467,7 +467,7 @@ namespace System.Collections } set { - throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection")); } } @@ -478,12 +478,12 @@ namespace System.Collections public virtual int Add(Object obj) { - throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection")); } public virtual void Clear() { - throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection")); } public virtual bool Contains(Object obj) @@ -508,17 +508,17 @@ namespace System.Collections public virtual void Insert(int index, Object obj) { - throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection")); } public virtual void Remove(Object value) { - throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection")); } public virtual void RemoveAt(int index) { - throw new NotSupportedException(SR.NotSupported_ReadOnlyCollection); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ReadOnlyCollection")); } } @@ -552,7 +552,7 @@ namespace System.Collections { if (version != list._version) { - throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion)); + throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion)); } if (isArrayList) @@ -594,11 +594,11 @@ namespace System.Collections { // check if enumeration has not started or has terminated if (index == -1) { - throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); + throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); } else { - throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumEnded)); + throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded)); } } @@ -610,7 +610,7 @@ namespace System.Collections { if (version != list._version) { - throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion)); + throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion)); } currentElement = dummyObject; diff --git a/src/mscorlib/src/System/Collections/Comparer.cs b/src/mscorlib/src/System/Collections/Comparer.cs index 7f4f9f0a07..f1480e1f4f 100644 --- a/src/mscorlib/src/System/Collections/Comparer.cs +++ b/src/mscorlib/src/System/Collections/Comparer.cs @@ -87,7 +87,7 @@ namespace System.Collections if (ib != null) return -ib.CompareTo(a); - throw new ArgumentException(SR.Argument_ImplementIComparable); + throw new ArgumentException(Environment.GetResourceString("Argument_ImplementIComparable")); } public void GetObjectData(SerializationInfo info, StreamingContext context) diff --git a/src/mscorlib/src/System/Collections/CompatibleComparer.cs b/src/mscorlib/src/System/Collections/CompatibleComparer.cs index 1c90707184..54c9132449 100644 --- a/src/mscorlib/src/System/Collections/CompatibleComparer.cs +++ b/src/mscorlib/src/System/Collections/CompatibleComparer.cs @@ -33,7 +33,7 @@ namespace System.Collections if (ia != null) return ia.CompareTo(b); - throw new ArgumentException(SR.Argument_ImplementIComparable); + throw new ArgumentException(Environment.GetResourceString("Argument_ImplementIComparable")); } public new bool Equals(Object a, Object b) diff --git a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs index c6211dadd3..991e17d6dc 100644 --- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs +++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentQueue.cs @@ -205,7 +205,7 @@ namespace System.Collections.Concurrent /// cref="ICollection"/>. This property is not supported. /// </summary> /// <exception cref="NotSupportedException">The SyncRoot property is not supported.</exception> - object ICollection.SyncRoot { get { throw new NotSupportedException(SR.ConcurrentCollection_SyncRoot_NotSupported); } } + object ICollection.SyncRoot { get { throw new NotSupportedException(Environment.GetResourceString("ConcurrentCollection_SyncRoot_NotSupported")); } } /// <summary>Returns an enumerator that iterates through a collection.</summary> /// <returns>An <see cref="IEnumerator"/> that can be used to iterate through the collection.</returns> @@ -443,7 +443,7 @@ namespace System.Collections.Concurrent long count = GetCount(head, headHead, tail, tailTail); if (index > array.Length - count) { - throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall); + throw new ArgumentException(Environment.GetResourceString("Arg_ArrayPlusOffTooSmall")); } // Copy the items to the target array diff --git a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs index 82bc4f9f5c..7b2bb9c74e 100644 --- a/src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs +++ b/src/mscorlib/src/System/Collections/Concurrent/ConcurrentStack.cs @@ -135,7 +135,7 @@ namespace System.Collections.Concurrent { get { - throw new NotSupportedException(SR.ConcurrentCollection_SyncRoot_NotSupported); + throw new NotSupportedException(Environment.GetResourceString("ConcurrentCollection_SyncRoot_NotSupported")); } } diff --git a/src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs b/src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs index c36f57cf75..a0ce919ce5 100644 --- a/src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs +++ b/src/mscorlib/src/System/Collections/EmptyReadOnlyDictionaryInternal.cs @@ -43,13 +43,13 @@ namespace System.Collections throw new ArgumentNullException(nameof(array)); if (array.Rank != 1) - throw new ArgumentException(SR.Arg_RankMultiDimNotSupported); + throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported")); if (index < 0) - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (array.Length - index < this.Count) - throw new ArgumentException(SR.ArgumentOutOfRange_Index, nameof(index)); + throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_Index"), nameof(index)); Contract.EndContractBlock(); // the actual copy is a NOP @@ -87,7 +87,7 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } Contract.EndContractBlock(); return null; @@ -96,17 +96,17 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } if (!key.GetType().IsSerializable) - throw new ArgumentException(SR.Argument_NotSerializable, nameof(key)); + throw new ArgumentException(Environment.GetResourceString("Argument_NotSerializable"), nameof(key)); if ((value != null) && (!value.GetType().IsSerializable)) - throw new ArgumentException(SR.Argument_NotSerializable, nameof(value)); + throw new ArgumentException(Environment.GetResourceString("Argument_NotSerializable"), nameof(value)); Contract.EndContractBlock(); - throw new InvalidOperationException(SR.InvalidOperation_ReadOnly); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly")); } } @@ -135,22 +135,22 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } if (!key.GetType().IsSerializable) - throw new ArgumentException(SR.Argument_NotSerializable, nameof(key)); + throw new ArgumentException(Environment.GetResourceString("Argument_NotSerializable"), nameof(key)); if ((value != null) && (!value.GetType().IsSerializable)) - throw new ArgumentException(SR.Argument_NotSerializable, nameof(value)); + throw new ArgumentException(Environment.GetResourceString("Argument_NotSerializable"), nameof(value)); Contract.EndContractBlock(); - throw new InvalidOperationException(SR.InvalidOperation_ReadOnly); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly")); } public void Clear() { - throw new InvalidOperationException(SR.InvalidOperation_ReadOnly); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly")); } public bool IsReadOnly @@ -176,7 +176,7 @@ namespace System.Collections public void Remove(Object key) { - throw new InvalidOperationException(SR.InvalidOperation_ReadOnly); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly")); } private sealed class NodeEnumerator : IDictionaryEnumerator @@ -196,7 +196,7 @@ namespace System.Collections { get { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } } @@ -210,7 +210,7 @@ namespace System.Collections { get { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } } @@ -218,7 +218,7 @@ namespace System.Collections { get { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } } @@ -226,7 +226,7 @@ namespace System.Collections { get { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } } } diff --git a/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs b/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs index e313cda0fb..d3284bec1f 100644 --- a/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs +++ b/src/mscorlib/src/System/Collections/Generic/ArraySortHelper.cs @@ -50,7 +50,7 @@ namespace System.Collections.Generic internal static void ThrowOrIgnoreBadComparer(Object comparer) { - throw new ArgumentException(SR.Format(SR.Arg_BogusIComparer, comparer)); + throw new ArgumentException(Environment.GetResourceString("Arg_BogusIComparer", comparer)); } } @@ -109,7 +109,7 @@ namespace System.Collections.Generic } catch (Exception e) { - throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e); } } @@ -126,7 +126,7 @@ namespace System.Collections.Generic } catch (Exception e) { - throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e); } } @@ -149,7 +149,7 @@ namespace System.Collections.Generic } catch (Exception e) { - throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e); } } @@ -399,7 +399,7 @@ namespace System.Collections.Generic } catch (Exception e) { - throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e); } } @@ -421,7 +421,7 @@ namespace System.Collections.Generic } catch (Exception e) { - throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e); } } @@ -723,7 +723,7 @@ namespace System.Collections.Generic } catch (Exception e) { - throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e); } } @@ -980,7 +980,7 @@ namespace System.Collections.Generic } catch (Exception e) { - throw new InvalidOperationException(SR.InvalidOperation_IComparerFailed, e); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_IComparerFailed"), e); } } diff --git a/src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs b/src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs index 0cd1bc1c12..a717558fbf 100644 --- a/src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs +++ b/src/mscorlib/src/System/Collections/Generic/EqualityComparer.cs @@ -320,11 +320,11 @@ namespace System.Collections.Generic if (array == null) throw new ArgumentNullException(nameof(array)); if (startIndex < 0) - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count")); if (count > array.Length - startIndex) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); if (count == 0) return -1; fixed (byte* pbytes = array) diff --git a/src/mscorlib/src/System/Collections/Hashtable.cs b/src/mscorlib/src/System/Collections/Hashtable.cs index f21ee99d58..3a8d2630b4 100644 --- a/src/mscorlib/src/System/Collections/Hashtable.cs +++ b/src/mscorlib/src/System/Collections/Hashtable.cs @@ -203,9 +203,9 @@ namespace System.Collections public Hashtable(int capacity, float loadFactor) { if (capacity < 0) - throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (!(loadFactor >= 0.1f && loadFactor <= 1.0f)) - throw new ArgumentOutOfRangeException(nameof(loadFactor), SR.Format(SR.ArgumentOutOfRange_HashtableLoadFactor, .1, 1.0)); + throw new ArgumentOutOfRangeException(nameof(loadFactor), Environment.GetResourceString("ArgumentOutOfRange_HashtableLoadFactor", .1, 1.0)); Contract.EndContractBlock(); // Based on perf work, .72 is the optimal load factor for this table. @@ -213,7 +213,7 @@ namespace System.Collections double rawsize = capacity / this.loadFactor; if (rawsize > Int32.MaxValue) - throw new ArgumentException(SR.Arg_HTCapacityOverflow); + throw new ArgumentException(Environment.GetResourceString("Arg_HTCapacityOverflow")); // Avoid awfully small sizes int hashsize = (rawsize > InitialSize) ? HashHelpers.GetPrime((int)rawsize) : InitialSize; @@ -343,7 +343,7 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } Contract.EndContractBlock(); @@ -415,13 +415,13 @@ namespace System.Collections public virtual void CopyTo(Array array, int arrayIndex) { if (array == null) - throw new ArgumentNullException(nameof(array), SR.ArgumentNull_Array); + throw new ArgumentNullException(nameof(array), Environment.GetResourceString("ArgumentNull_Array")); if (array.Rank != 1) - throw new ArgumentException(SR.Arg_RankMultiDimNotSupported); + throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported")); if (arrayIndex < 0) - throw new ArgumentOutOfRangeException(nameof(arrayIndex), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(arrayIndex), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (array.Length - arrayIndex < Count) - throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall); + throw new ArgumentException(Environment.GetResourceString("Arg_ArrayPlusOffTooSmall")); Contract.EndContractBlock(); CopyEntries(array, arrayIndex); } @@ -455,7 +455,7 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } Contract.EndContractBlock(); @@ -698,7 +698,7 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } Contract.EndContractBlock(); if (count >= loadsize) @@ -760,7 +760,7 @@ namespace System.Collections { if (add) { - throw new ArgumentException(SR.Format(SR.Argument_AddingDuplicate__, buckets[bucketNumber].key, key)); + throw new ArgumentException(Environment.GetResourceString("Argument_AddingDuplicate__", buckets[bucketNumber].key, key)); } isWriterInProgress = true; buckets[bucketNumber].val = nvalue; @@ -804,7 +804,7 @@ namespace System.Collections // Then verify that our double hash function (h2, described at top of file) // meets the requirements described above. You should never see this assert. Debug.Assert(false, "hash table insert failed! Load factor too high, or our double hashing function is incorrect."); - throw new InvalidOperationException(SR.InvalidOperation_HashInsertFailed); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_HashInsertFailed")); } private void putEntry(bucket[] newBuckets, Object key, Object nvalue, int hashcode) @@ -841,7 +841,7 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } Contract.EndContractBlock(); Debug.Assert(!isWriterInProgress, "Race condition detected in usages of Hashtable - multiple threads appear to be writing to a Hashtable instance simultaneously! Don't do that - use Hashtable.Synchronized."); @@ -880,7 +880,7 @@ namespace System.Collections bn = (int)(((long)bn + incr) % (uint)buckets.Length); } while (b.hash_coll < 0 && ++ntry < buckets.Length); - //throw new ArgumentException(SR.Arg_RemoveArgNotFound); + //throw new ArgumentException(Environment.GetResourceString("Arg_RemoveArgNotFound")); } // Returns the object to synchronize on for this hash table. @@ -975,7 +975,7 @@ namespace System.Collections // Explicitly check to see if anyone changed the Hashtable while we // were serializing it. That's a race condition in their code. if (version != oldVersion) - throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion)); + throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion)); } } @@ -995,7 +995,7 @@ namespace System.Collections if (siInfo == null) { - throw new SerializationException(SR.Serialization_InvalidOnDeser); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidOnDeser")); } int hashsize = 0; @@ -1052,21 +1052,21 @@ namespace System.Collections if (serKeys == null) { - throw new SerializationException(SR.Serialization_MissingKeys); + throw new SerializationException(Environment.GetResourceString("Serialization_MissingKeys")); } if (serValues == null) { - throw new SerializationException(SR.Serialization_MissingValues); + throw new SerializationException(Environment.GetResourceString("Serialization_MissingValues")); } if (serKeys.Length != serValues.Length) { - throw new SerializationException(SR.Serialization_KeyValueDifferentSizes); + throw new SerializationException(Environment.GetResourceString("Serialization_KeyValueDifferentSizes")); } for (int i = 0; i < serKeys.Length; i++) { if (serKeys[i] == null) { - throw new SerializationException(SR.Serialization_NullKey); + throw new SerializationException(Environment.GetResourceString("Serialization_NullKey")); } Insert(serKeys[i], serValues[i], true); } @@ -1094,12 +1094,12 @@ namespace System.Collections if (array == null) throw new ArgumentNullException(nameof(array)); if (array.Rank != 1) - throw new ArgumentException(SR.Arg_RankMultiDimNotSupported); + throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported")); if (arrayIndex < 0) - throw new ArgumentOutOfRangeException(nameof(arrayIndex), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(arrayIndex), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); if (array.Length - arrayIndex < _hashtable.count) - throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall); + throw new ArgumentException(Environment.GetResourceString("Arg_ArrayPlusOffTooSmall")); _hashtable.CopyKeys(array, arrayIndex); } @@ -1141,12 +1141,12 @@ namespace System.Collections if (array == null) throw new ArgumentNullException(nameof(array)); if (array.Rank != 1) - throw new ArgumentException(SR.Arg_RankMultiDimNotSupported); + throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported")); if (arrayIndex < 0) - throw new ArgumentOutOfRangeException(nameof(arrayIndex), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(arrayIndex), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); if (array.Length - arrayIndex < _hashtable.count) - throw new ArgumentException(SR.Arg_ArrayPlusOffTooSmall); + throw new ArgumentException(Environment.GetResourceString("Arg_ArrayPlusOffTooSmall")); _hashtable.CopyValues(array, arrayIndex); } @@ -1273,7 +1273,7 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } Contract.EndContractBlock(); return _table.ContainsKey(key); @@ -1386,14 +1386,14 @@ namespace System.Collections { get { - if (current == false) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); + if (current == false) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); return currentKey; } } public virtual bool MoveNext() { - if (version != hashtable.version) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion)); + if (version != hashtable.version) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion)); while (bucket > 0) { bucket--; @@ -1414,7 +1414,7 @@ namespace System.Collections { get { - if (current == false) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumOpCantHappen)); + if (current == false) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumOpCantHappen)); return new DictionaryEntry(currentKey, currentValue); } } @@ -1424,7 +1424,7 @@ namespace System.Collections { get { - if (current == false) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumOpCantHappen)); + if (current == false) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumOpCantHappen)); if (getObjectRetType == Keys) return currentKey; @@ -1439,14 +1439,14 @@ namespace System.Collections { get { - if (current == false) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumOpCantHappen)); + if (current == false) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumOpCantHappen)); return currentValue; } } public virtual void Reset() { - if (version != hashtable.version) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumFailedVersion)); + if (version != hashtable.version) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumFailedVersion)); current = false; bucket = hashtable.buckets.Length; currentKey = null; @@ -1523,7 +1523,7 @@ namespace System.Collections public static int GetPrime(int min) { if (min < 0) - throw new ArgumentException(SR.Arg_HTCapacityOverflow); + throw new ArgumentException(Environment.GetResourceString("Arg_HTCapacityOverflow")); Contract.EndContractBlock(); for (int i = 0; i < primes.Length; i++) diff --git a/src/mscorlib/src/System/Collections/ListDictionaryInternal.cs b/src/mscorlib/src/System/Collections/ListDictionaryInternal.cs index 3f92038d4f..bfd11588f3 100644 --- a/src/mscorlib/src/System/Collections/ListDictionaryInternal.cs +++ b/src/mscorlib/src/System/Collections/ListDictionaryInternal.cs @@ -38,7 +38,7 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } Contract.EndContractBlock(); DictionaryNode node = head; @@ -57,7 +57,7 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } Contract.EndContractBlock(); @@ -159,7 +159,7 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } Contract.EndContractBlock(); @@ -171,7 +171,7 @@ namespace System.Collections { if (node.key.Equals(key)) { - throw new ArgumentException(SR.Format(SR.Argument_AddingDuplicate__, node.key, key)); + throw new ArgumentException(Environment.GetResourceString("Argument_AddingDuplicate__", node.key, key)); } last = node; } @@ -207,7 +207,7 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } Contract.EndContractBlock(); for (DictionaryNode node = head; node != null; node = node.next) @@ -226,13 +226,13 @@ namespace System.Collections throw new ArgumentNullException(nameof(array)); if (array.Rank != 1) - throw new ArgumentException(SR.Arg_RankMultiDimNotSupported); + throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported")); if (index < 0) - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (array.Length - index < this.Count) - throw new ArgumentException(SR.ArgumentOutOfRange_Index, nameof(index)); + throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_Index"), nameof(index)); Contract.EndContractBlock(); for (DictionaryNode node = head; node != null; node = node.next) @@ -256,7 +256,7 @@ namespace System.Collections { if (key == null) { - throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); + throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); } Contract.EndContractBlock(); version++; @@ -315,7 +315,7 @@ namespace System.Collections { if (current == null) { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } return new DictionaryEntry(current.key, current.value); } @@ -327,7 +327,7 @@ namespace System.Collections { if (current == null) { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } return current.key; } @@ -339,7 +339,7 @@ namespace System.Collections { if (current == null) { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } return current.value; } @@ -349,7 +349,7 @@ namespace System.Collections { if (version != list.version) { - throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumFailedVersion")); } if (start) { @@ -370,7 +370,7 @@ namespace System.Collections { if (version != list.version) { - throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumFailedVersion")); } start = true; current = null; @@ -394,12 +394,12 @@ namespace System.Collections if (array == null) throw new ArgumentNullException(nameof(array)); if (array.Rank != 1) - throw new ArgumentException(SR.Arg_RankMultiDimNotSupported); + throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported")); if (index < 0) - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); if (array.Length - index < list.Count) - throw new ArgumentException(SR.ArgumentOutOfRange_Index, nameof(index)); + throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_Index"), nameof(index)); for (DictionaryNode node = list.head; node != null; node = node.next) { array.SetValue(isKeys ? node.key : node.value, index); @@ -465,7 +465,7 @@ namespace System.Collections { if (current == null) { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } return isKeys ? current.key : current.value; } @@ -475,7 +475,7 @@ namespace System.Collections { if (version != list.version) { - throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumFailedVersion")); } if (start) { @@ -496,7 +496,7 @@ namespace System.Collections { if (version != list.version) { - throw new InvalidOperationException(SR.InvalidOperation_EnumFailedVersion); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumFailedVersion")); } start = true; current = null; diff --git a/src/mscorlib/src/System/CurrentTimeZone.cs b/src/mscorlib/src/System/CurrentTimeZone.cs index d0957477b6..d55df27a12 100644 --- a/src/mscorlib/src/System/CurrentTimeZone.cs +++ b/src/mscorlib/src/System/CurrentTimeZone.cs @@ -150,7 +150,7 @@ namespace System { if (year < 1 || year > 9999) { - throw new ArgumentOutOfRangeException(nameof(year), SR.Format(SR.ArgumentOutOfRange_Range, 1, 9999)); + throw new ArgumentOutOfRangeException(nameof(year), Environment.GetResourceString("ArgumentOutOfRange_Range", 1, 9999)); } Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/DBNull.cs b/src/mscorlib/src/System/DBNull.cs index 0b859e7668..817f6e547f 100644 --- a/src/mscorlib/src/System/DBNull.cs +++ b/src/mscorlib/src/System/DBNull.cs @@ -23,7 +23,7 @@ namespace System private DBNull(SerializationInfo info, StreamingContext context) { - throw new NotSupportedException(SR.NotSupported_DBNullSerial); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DBNullSerial")); } public static readonly DBNull Value = new DBNull(); @@ -51,85 +51,85 @@ namespace System /// <internalonly/> bool IConvertible.ToBoolean(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> char IConvertible.ToChar(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> sbyte IConvertible.ToSByte(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> byte IConvertible.ToByte(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> short IConvertible.ToInt16(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> ushort IConvertible.ToUInt16(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> int IConvertible.ToInt32(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> uint IConvertible.ToUInt32(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> long IConvertible.ToInt64(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> ulong IConvertible.ToUInt64(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> float IConvertible.ToSingle(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> double IConvertible.ToDouble(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> decimal IConvertible.ToDecimal(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.InvalidCast_FromDBNull); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromDBNull")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/DateTime.cs b/src/mscorlib/src/System/DateTime.cs index 894e849765..360aceee90 100644 --- a/src/mscorlib/src/System/DateTime.cs +++ b/src/mscorlib/src/System/DateTime.cs @@ -142,7 +142,7 @@ namespace System public DateTime(long ticks) { if (ticks < MinTicks || ticks > MaxTicks) - throw new ArgumentOutOfRangeException(nameof(ticks), SR.ArgumentOutOfRange_DateTimeBadTicks); + throw new ArgumentOutOfRangeException(nameof(ticks), Environment.GetResourceString("ArgumentOutOfRange_DateTimeBadTicks")); Contract.EndContractBlock(); dateData = (UInt64)ticks; } @@ -156,11 +156,11 @@ namespace System { if (ticks < MinTicks || ticks > MaxTicks) { - throw new ArgumentOutOfRangeException(nameof(ticks), SR.ArgumentOutOfRange_DateTimeBadTicks); + throw new ArgumentOutOfRangeException(nameof(ticks), Environment.GetResourceString("ArgumentOutOfRange_DateTimeBadTicks")); } if (kind < DateTimeKind.Unspecified || kind > DateTimeKind.Local) { - throw new ArgumentException(SR.Argument_InvalidDateTimeKind, nameof(kind)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidDateTimeKind"), nameof(kind)); } Contract.EndContractBlock(); dateData = ((UInt64)ticks | ((UInt64)kind << KindShift)); @@ -170,7 +170,7 @@ namespace System { if (ticks < MinTicks || ticks > MaxTicks) { - throw new ArgumentOutOfRangeException(nameof(ticks), SR.ArgumentOutOfRange_DateTimeBadTicks); + throw new ArgumentOutOfRangeException(nameof(ticks), Environment.GetResourceString("ArgumentOutOfRange_DateTimeBadTicks")); } Contract.Requires(kind == DateTimeKind.Local, "Internal Constructor is for local times only"); Contract.EndContractBlock(); @@ -206,7 +206,7 @@ namespace System { if (kind < DateTimeKind.Unspecified || kind > DateTimeKind.Local) { - throw new ArgumentException(SR.Argument_InvalidDateTimeKind, nameof(kind)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidDateTimeKind"), nameof(kind)); } Contract.EndContractBlock(); Int64 ticks = DateToTicks(year, month, day) + TimeToTicks(hour, minute, second); @@ -231,13 +231,13 @@ namespace System { if (millisecond < 0 || millisecond >= MillisPerSecond) { - throw new ArgumentOutOfRangeException(nameof(millisecond), SR.Format(SR.ArgumentOutOfRange_Range, 0, MillisPerSecond - 1)); + throw new ArgumentOutOfRangeException(nameof(millisecond), Environment.GetResourceString("ArgumentOutOfRange_Range", 0, MillisPerSecond - 1)); } Contract.EndContractBlock(); Int64 ticks = DateToTicks(year, month, day) + TimeToTicks(hour, minute, second); ticks += millisecond * TicksPerMillisecond; if (ticks < MinTicks || ticks > MaxTicks) - throw new ArgumentException(SR.Arg_DateTimeRange); + throw new ArgumentException(Environment.GetResourceString("Arg_DateTimeRange")); dateData = (UInt64)ticks; } @@ -245,17 +245,17 @@ namespace System { if (millisecond < 0 || millisecond >= MillisPerSecond) { - throw new ArgumentOutOfRangeException(nameof(millisecond), SR.Format(SR.ArgumentOutOfRange_Range, 0, MillisPerSecond - 1)); + throw new ArgumentOutOfRangeException(nameof(millisecond), Environment.GetResourceString("ArgumentOutOfRange_Range", 0, MillisPerSecond - 1)); } if (kind < DateTimeKind.Unspecified || kind > DateTimeKind.Local) { - throw new ArgumentException(SR.Argument_InvalidDateTimeKind, nameof(kind)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidDateTimeKind"), nameof(kind)); } Contract.EndContractBlock(); Int64 ticks = DateToTicks(year, month, day) + TimeToTicks(hour, minute, second); ticks += millisecond * TicksPerMillisecond; if (ticks < MinTicks || ticks > MaxTicks) - throw new ArgumentException(SR.Arg_DateTimeRange); + throw new ArgumentException(Environment.GetResourceString("Arg_DateTimeRange")); dateData = ((UInt64)ticks | ((UInt64)kind << KindShift)); } @@ -268,13 +268,13 @@ namespace System throw new ArgumentNullException(nameof(calendar)); if (millisecond < 0 || millisecond >= MillisPerSecond) { - throw new ArgumentOutOfRangeException(nameof(millisecond), SR.Format(SR.ArgumentOutOfRange_Range, 0, MillisPerSecond - 1)); + throw new ArgumentOutOfRangeException(nameof(millisecond), Environment.GetResourceString("ArgumentOutOfRange_Range", 0, MillisPerSecond - 1)); } Contract.EndContractBlock(); Int64 ticks = calendar.ToDateTime(year, month, day, hour, minute, second, 0).Ticks; ticks += millisecond * TicksPerMillisecond; if (ticks < MinTicks || ticks > MaxTicks) - throw new ArgumentException(SR.Arg_DateTimeRange); + throw new ArgumentException(Environment.GetResourceString("Arg_DateTimeRange")); dateData = (UInt64)ticks; } @@ -284,17 +284,17 @@ namespace System throw new ArgumentNullException(nameof(calendar)); if (millisecond < 0 || millisecond >= MillisPerSecond) { - throw new ArgumentOutOfRangeException(nameof(millisecond), SR.Format(SR.ArgumentOutOfRange_Range, 0, MillisPerSecond - 1)); + throw new ArgumentOutOfRangeException(nameof(millisecond), Environment.GetResourceString("ArgumentOutOfRange_Range", 0, MillisPerSecond - 1)); } if (kind < DateTimeKind.Unspecified || kind > DateTimeKind.Local) { - throw new ArgumentException(SR.Argument_InvalidDateTimeKind, nameof(kind)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidDateTimeKind"), nameof(kind)); } Contract.EndContractBlock(); Int64 ticks = calendar.ToDateTime(year, month, day, hour, minute, second, 0).Ticks; ticks += millisecond * TicksPerMillisecond; if (ticks < MinTicks || ticks > MaxTicks) - throw new ArgumentException(SR.Arg_DateTimeRange); + throw new ArgumentException(Environment.GetResourceString("Arg_DateTimeRange")); dateData = ((UInt64)ticks | ((UInt64)kind << KindShift)); } @@ -339,12 +339,12 @@ namespace System } else { - throw new SerializationException(SR.Serialization_MissingDateTimeData); + throw new SerializationException(Environment.GetResourceString("Serialization_MissingDateTimeData")); } Int64 ticks = InternalTicks; if (ticks < MinTicks || ticks > MaxTicks) { - throw new SerializationException(SR.Serialization_DateTimeTicksOutOfRange); + throw new SerializationException(Environment.GetResourceString("Serialization_DateTimeTicksOutOfRange")); } } @@ -380,7 +380,7 @@ namespace System { long millis = (long)(value * scale + (value >= 0 ? 0.5 : -0.5)); if (millis <= -MaxMillis || millis >= MaxMillis) - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_AddValue); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_AddValue")); return AddTicks(millis * TicksPerMillisecond); } @@ -447,7 +447,7 @@ namespace System // public DateTime AddMonths(int months) { - if (months < -120000 || months > 120000) throw new ArgumentOutOfRangeException(nameof(months), SR.ArgumentOutOfRange_DateTimeBadMonths); + if (months < -120000 || months > 120000) throw new ArgumentOutOfRangeException(nameof(months), Environment.GetResourceString("ArgumentOutOfRange_DateTimeBadMonths")); Contract.EndContractBlock(); int y = GetDatePart(DatePartYear); int m = GetDatePart(DatePartMonth); @@ -465,7 +465,7 @@ namespace System } if (y < 1 || y > 9999) { - throw new ArgumentOutOfRangeException(nameof(months), SR.ArgumentOutOfRange_DateArithmetic); + throw new ArgumentOutOfRangeException(nameof(months), Environment.GetResourceString("ArgumentOutOfRange_DateArithmetic")); } int days = DaysInMonth(y, m); if (d > days) d = days; @@ -492,7 +492,7 @@ namespace System long ticks = InternalTicks; if (value > MaxTicks - ticks || value < MinTicks - ticks) { - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_DateArithmetic); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_DateArithmetic")); } return new DateTime((UInt64)(ticks + value) | InternalKind); } @@ -511,7 +511,7 @@ namespace System { // DateTimeOffset.AddYears(int years) is implemented on top of DateTime.AddYears(int value). Use the more appropriate // parameter name out of the two for the exception. - throw new ArgumentOutOfRangeException("years", SR.ArgumentOutOfRange_DateTimeBadYears); + throw new ArgumentOutOfRangeException("years", Environment.GetResourceString("ArgumentOutOfRange_DateTimeBadYears")); } Contract.EndContractBlock(); return AddMonths(value * 12); @@ -540,7 +540,7 @@ namespace System if (value == null) return 1; if (!(value is DateTime)) { - throw new ArgumentException(SR.Arg_MustBeDateTime); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDateTime")); } return Compare(this, (DateTime)value); @@ -565,7 +565,7 @@ namespace System return n * TicksPerDay; } } - throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_BadYearMonthDay); + throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("ArgumentOutOfRange_BadYearMonthDay")); } // Return the tick count corresponding to the given hour, minute, second. @@ -578,7 +578,7 @@ namespace System { return (TimeSpan.TimeToTicks(hour, minute, second)); } - throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_BadHourMinuteSecond); + throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("ArgumentOutOfRange_BadHourMinuteSecond")); } // Returns the number of days in the month given by the year and @@ -586,7 +586,7 @@ namespace System // public static int DaysInMonth(int year, int month) { - if (month < 1 || month > 12) throw new ArgumentOutOfRangeException(nameof(month), SR.ArgumentOutOfRange_Month); + if (month < 1 || month > 12) throw new ArgumentOutOfRangeException(nameof(month), Environment.GetResourceString("ArgumentOutOfRange_Month")); Contract.EndContractBlock(); // IsLeapYear checks the year argument int[] days = IsLeapYear(year) ? DaysToMonth366 : DaysToMonth365; @@ -599,7 +599,7 @@ namespace System { // The check done this way will take care of NaN if (!(value < OADateMaxAsDouble) || !(value > OADateMinAsDouble)) - throw new ArgumentException(SR.Arg_OleAutDateInvalid); + throw new ArgumentException(Environment.GetResourceString("Arg_OleAutDateInvalid")); // Conversion to long will not cause an overflow here, as at this point the "value" is in between OADateMinAsDouble and OADateMaxAsDouble long millis = (long)(value * MillisPerDay + (value >= 0 ? 0.5 : -0.5)); @@ -613,7 +613,7 @@ namespace System millis += DoubleDateOffset / TicksPerMillisecond; - if (millis < 0 || millis >= MaxMillis) throw new ArgumentException(SR.Arg_OleAutDateScale); + if (millis < 0 || millis >= MaxMillis) throw new ArgumentException(Environment.GetResourceString("Arg_OleAutDateScale")); return millis * TicksPerMillisecond; } @@ -688,7 +688,7 @@ namespace System } if (ticks < MinTicks || ticks > MaxTicks) { - throw new ArgumentException(SR.Argument_DateTimeBadBinaryData, nameof(dateData)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeBadBinaryData"), nameof(dateData)); } return new DateTime(ticks, DateTimeKind.Local, isAmbiguousLocalDst); } @@ -704,7 +704,7 @@ namespace System { Int64 ticks = dateData & (Int64)TicksMask; if (ticks < MinTicks || ticks > MaxTicks) - throw new ArgumentException(SR.Argument_DateTimeBadBinaryData, nameof(dateData)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeBadBinaryData"), nameof(dateData)); return new DateTime((UInt64)dateData); } @@ -721,7 +721,7 @@ namespace System { if (fileTime < 0 || fileTime > MaxTicks - FileTimeOffset) { - throw new ArgumentOutOfRangeException(nameof(fileTime), SR.ArgumentOutOfRange_FileTimeInvalid); + throw new ArgumentOutOfRangeException(nameof(fileTime), Environment.GetResourceString("ArgumentOutOfRange_FileTimeInvalid")); } Contract.EndContractBlock(); @@ -1091,7 +1091,7 @@ namespace System { if (year < 1 || year > 9999) { - throw new ArgumentOutOfRangeException(nameof(year), SR.ArgumentOutOfRange_Year); + throw new ArgumentOutOfRangeException(nameof(year), Environment.GetResourceString("ArgumentOutOfRange_Year")); } Contract.EndContractBlock(); return year % 4 == 0 && (year % 100 != 0 || year % 400 == 0); @@ -1157,7 +1157,7 @@ namespace System long valueTicks = value._ticks; if (ticks - MinTicks < valueTicks || ticks - MaxTicks > valueTicks) { - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_DateArithmetic); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_DateArithmetic")); } return new DateTime((UInt64)(ticks - valueTicks) | InternalKind); } @@ -1170,7 +1170,7 @@ namespace System if (value < TicksPerDay) // This is a fix for VB. They want the default day to be 1/1/0001 rathar then 12/30/1899. value += DoubleDateOffset; // We could have moved this fix down but we would like to keep the bounds check. if (value < OADateMinAsTicks) - throw new OverflowException(SR.Arg_OleAutDateInvalid); + throw new OverflowException(Environment.GetResourceString("Arg_OleAutDateInvalid")); // Currently, our max date == OA's max date (12/31/9999), so we don't // need an overflow check in that direction. long millis = (value - DoubleDateOffset) / TicksPerMillisecond; @@ -1202,7 +1202,7 @@ namespace System ticks -= FileTimeOffset; if (ticks < 0) { - throw new ArgumentOutOfRangeException(null, SR.ArgumentOutOfRange_FileTimeInvalid); + throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("ArgumentOutOfRange_FileTimeInvalid")); } return ticks; } @@ -1225,14 +1225,14 @@ namespace System if (tick > DateTime.MaxTicks) { if (throwOnOverflow) - throw new ArgumentException(SR.Arg_ArgumentOutOfRangeException); + throw new ArgumentException(Environment.GetResourceString("Arg_ArgumentOutOfRangeException")); else return new DateTime(DateTime.MaxTicks, DateTimeKind.Local); } if (tick < DateTime.MinTicks) { if (throwOnOverflow) - throw new ArgumentException(SR.Arg_ArgumentOutOfRangeException); + throw new ArgumentException(Environment.GetResourceString("Arg_ArgumentOutOfRangeException")); else return new DateTime(DateTime.MinTicks, DateTimeKind.Local); } @@ -1321,7 +1321,7 @@ namespace System long valueTicks = t._ticks; if (valueTicks > MaxTicks - ticks || valueTicks < MinTicks - ticks) { - throw new ArgumentOutOfRangeException(nameof(t), SR.ArgumentOutOfRange_DateArithmetic); + throw new ArgumentOutOfRangeException(nameof(t), Environment.GetResourceString("ArgumentOutOfRange_DateArithmetic")); } return new DateTime((UInt64)(ticks + valueTicks) | d.InternalKind); } @@ -1332,7 +1332,7 @@ namespace System long valueTicks = t._ticks; if (ticks - MinTicks < valueTicks || ticks - MaxTicks > valueTicks) { - throw new ArgumentOutOfRangeException(nameof(t), SR.ArgumentOutOfRange_DateArithmetic); + throw new ArgumentOutOfRangeException(nameof(t), Environment.GetResourceString("ArgumentOutOfRange_DateArithmetic")); } return new DateTime((UInt64)(ticks - valueTicks) | d.InternalKind); } @@ -1423,79 +1423,79 @@ namespace System /// <internalonly/> bool IConvertible.ToBoolean(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Boolean")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Boolean")); } /// <internalonly/> char IConvertible.ToChar(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Char")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Char")); } /// <internalonly/> sbyte IConvertible.ToSByte(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "SByte")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "SByte")); } /// <internalonly/> byte IConvertible.ToByte(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Byte")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Byte")); } /// <internalonly/> short IConvertible.ToInt16(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Int16")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Int16")); } /// <internalonly/> ushort IConvertible.ToUInt16(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "UInt16")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "UInt16")); } /// <internalonly/> int IConvertible.ToInt32(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Int32")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Int32")); } /// <internalonly/> uint IConvertible.ToUInt32(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "UInt32")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "UInt32")); } /// <internalonly/> long IConvertible.ToInt64(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Int64")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Int64")); } /// <internalonly/> ulong IConvertible.ToUInt64(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "UInt64")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "UInt64")); } /// <internalonly/> float IConvertible.ToSingle(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Single")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Single")); } /// <internalonly/> double IConvertible.ToDouble(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Double")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Double")); } /// <internalonly/> Decimal IConvertible.ToDecimal(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "DateTime", "Decimal")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "DateTime", "Decimal")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/DateTimeOffset.cs b/src/mscorlib/src/System/DateTimeOffset.cs index 35253bae8a..9f85edfe75 100644 --- a/src/mscorlib/src/System/DateTimeOffset.cs +++ b/src/mscorlib/src/System/DateTimeOffset.cs @@ -95,14 +95,14 @@ namespace System { if (offset != TimeZoneInfo.GetLocalUtcOffset(dateTime, TimeZoneInfoOptions.NoThrowOnInvalidTime)) { - throw new ArgumentException(SR.Argument_OffsetLocalMismatch, nameof(offset)); + throw new ArgumentException(Environment.GetResourceString("Argument_OffsetLocalMismatch"), nameof(offset)); } } else if (dateTime.Kind == DateTimeKind.Utc) { if (offset != TimeSpan.Zero) { - throw new ArgumentException(SR.Argument_OffsetUtcMismatch, nameof(offset)); + throw new ArgumentException(Environment.GetResourceString("Argument_OffsetUtcMismatch"), nameof(offset)); } } m_offsetMinutes = ValidateOffset(offset); @@ -482,7 +482,7 @@ namespace System if (obj == null) return 1; if (!(obj is DateTimeOffset)) { - throw new ArgumentException(SR.Arg_MustBeDateTimeOffset); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDateTimeOffset")); } DateTime objUtc = ((DateTimeOffset)obj).UtcDateTime; @@ -555,7 +555,7 @@ namespace System if (seconds < UnixMinSeconds || seconds > UnixMaxSeconds) { throw new ArgumentOutOfRangeException(nameof(seconds), - string.Format(SR.ArgumentOutOfRange_Range, UnixMinSeconds, UnixMaxSeconds)); + string.Format(Environment.GetResourceString("ArgumentOutOfRange_Range"), UnixMinSeconds, UnixMaxSeconds)); } long ticks = seconds * TimeSpan.TicksPerSecond + UnixEpochTicks; @@ -570,7 +570,7 @@ namespace System if (milliseconds < MinMilliseconds || milliseconds > MaxMilliseconds) { throw new ArgumentOutOfRangeException(nameof(milliseconds), - string.Format(SR.ArgumentOutOfRange_Range, MinMilliseconds, MaxMilliseconds)); + string.Format(Environment.GetResourceString("ArgumentOutOfRange_Range"), MinMilliseconds, MaxMilliseconds)); } long ticks = milliseconds * TimeSpan.TicksPerMillisecond + UnixEpochTicks; @@ -588,7 +588,7 @@ namespace System } catch (ArgumentException e) { - throw new SerializationException(SR.Serialization_InvalidData, e); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e); } } @@ -846,11 +846,11 @@ namespace System Int64 ticks = offset.Ticks; if (ticks % TimeSpan.TicksPerMinute != 0) { - throw new ArgumentException(SR.Argument_OffsetPrecision, nameof(offset)); + throw new ArgumentException(Environment.GetResourceString("Argument_OffsetPrecision"), nameof(offset)); } if (ticks < MinOffset || ticks > MaxOffset) { - throw new ArgumentOutOfRangeException(nameof(offset), SR.Argument_OffsetOutOfRange); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("Argument_OffsetOutOfRange")); } return (Int16)(offset.Ticks / TimeSpan.TicksPerMinute); } @@ -866,7 +866,7 @@ namespace System Int64 utcTicks = dateTime.Ticks - offset.Ticks; if (utcTicks < DateTime.MinTicks || utcTicks > DateTime.MaxTicks) { - throw new ArgumentOutOfRangeException(nameof(offset), SR.Argument_UTCOutOfRange); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("Argument_UTCOutOfRange")); } // make sure the Kind is set to Unspecified // @@ -877,15 +877,15 @@ namespace System { if ((style & DateTimeFormatInfo.InvalidDateTimeStyles) != 0) { - throw new ArgumentException(SR.Argument_InvalidDateTimeStyles, parameterName); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidDateTimeStyles"), parameterName); } if (((style & (DateTimeStyles.AssumeLocal)) != 0) && ((style & (DateTimeStyles.AssumeUniversal)) != 0)) { - throw new ArgumentException(SR.Argument_ConflictingDateTimeStyles, parameterName); + throw new ArgumentException(Environment.GetResourceString("Argument_ConflictingDateTimeStyles"), parameterName); } if ((style & DateTimeStyles.NoCurrentDateDefault) != 0) { - throw new ArgumentException(SR.Argument_DateTimeOffsetInvalidDateTimeStyles, parameterName); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeOffsetInvalidDateTimeStyles"), parameterName); } Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/Decimal.cs b/src/mscorlib/src/System/Decimal.cs index 7245396fde..dedcc92e18 100644 --- a/src/mscorlib/src/System/Decimal.cs +++ b/src/mscorlib/src/System/Decimal.cs @@ -286,7 +286,7 @@ namespace System return; } } - throw new ArgumentException(SR.Arg_DecBitCtor); + throw new ArgumentException(Environment.GetResourceString("Arg_DecBitCtor")); } // Constructs a Decimal from its constituent parts. @@ -294,7 +294,7 @@ namespace System public Decimal(int lo, int mid, int hi, bool isNegative, byte scale) { if (scale > 28) - throw new ArgumentOutOfRangeException(nameof(scale), SR.ArgumentOutOfRange_DecimalScale); + throw new ArgumentOutOfRangeException(nameof(scale), Environment.GetResourceString("ArgumentOutOfRange_DecimalScale")); Contract.EndContractBlock(); this.lo = lo; this.mid = mid; @@ -314,7 +314,7 @@ namespace System } catch (ArgumentException e) { - throw new SerializationException(SR.Overflow_Decimal, e); + throw new SerializationException(Environment.GetResourceString("Overflow_Decimal"), e); } } @@ -328,7 +328,7 @@ namespace System } catch (ArgumentException e) { - throw new SerializationException(SR.Overflow_Decimal, e); + throw new SerializationException(Environment.GetResourceString("Overflow_Decimal"), e); } } @@ -343,7 +343,7 @@ namespace System this.flags = flags; return; } - throw new ArgumentException(SR.Arg_DecBitCtor); + throw new ArgumentException(Environment.GetResourceString("Arg_DecBitCtor")); } // Returns the absolute value of the given Decimal. If d is @@ -399,7 +399,7 @@ namespace System if (value == null) return 1; if (!(value is Decimal)) - throw new ArgumentException(SR.Arg_MustBeDecimal); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDecimal")); Decimal other = (Decimal)value; return FCallCompare(ref this, ref other); @@ -782,10 +782,10 @@ namespace System public static Decimal Round(Decimal d, int decimals, MidpointRounding mode) { if ((decimals < 0) || (decimals > 28)) - throw new ArgumentOutOfRangeException(nameof(decimals), SR.ArgumentOutOfRange_DecimalRound); + throw new ArgumentOutOfRangeException(nameof(decimals), Environment.GetResourceString("ArgumentOutOfRange_DecimalRound")); if (mode < MidpointRounding.ToEven || mode > MidpointRounding.AwayFromZero) { - throw new ArgumentException(SR.Format(SR.Argument_InvalidEnumValue, mode, nameof(MidpointRounding)), nameof(mode)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidEnumValue", mode, nameof(MidpointRounding)), nameof(mode)); } Contract.EndContractBlock(); @@ -824,9 +824,9 @@ namespace System } catch (OverflowException e) { - throw new OverflowException(SR.Overflow_Byte, e); + throw new OverflowException(Environment.GetResourceString("Overflow_Byte"), e); } - if (temp < Byte.MinValue || temp > Byte.MaxValue) throw new OverflowException(SR.Overflow_Byte); + if (temp < Byte.MinValue || temp > Byte.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_Byte")); return (byte)temp; } @@ -844,9 +844,9 @@ namespace System } catch (OverflowException e) { - throw new OverflowException(SR.Overflow_SByte, e); + throw new OverflowException(Environment.GetResourceString("Overflow_SByte"), e); } - if (temp < SByte.MinValue || temp > SByte.MaxValue) throw new OverflowException(SR.Overflow_SByte); + if (temp < SByte.MinValue || temp > SByte.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_SByte")); return (sbyte)temp; } @@ -863,9 +863,9 @@ namespace System } catch (OverflowException e) { - throw new OverflowException(SR.Overflow_Int16, e); + throw new OverflowException(Environment.GetResourceString("Overflow_Int16"), e); } - if (temp < Int16.MinValue || temp > Int16.MaxValue) throw new OverflowException(SR.Overflow_Int16); + if (temp < Int16.MinValue || temp > Int16.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_Int16")); return (short)temp; } @@ -913,7 +913,7 @@ namespace System if (i <= 0) return i; } } - throw new OverflowException(SR.Overflow_Int32); + throw new OverflowException(Environment.GetResourceString("Overflow_Int32")); } // Converts a Decimal to a long. The Decimal value is rounded towards zero @@ -936,7 +936,7 @@ namespace System if (l <= 0) return l; } } - throw new OverflowException(SR.Overflow_Int64); + throw new OverflowException(Environment.GetResourceString("Overflow_Int64")); } // Converts a Decimal to an ushort. The Decimal @@ -953,9 +953,9 @@ namespace System } catch (OverflowException e) { - throw new OverflowException(SR.Overflow_UInt16, e); + throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"), e); } - if (temp < UInt16.MinValue || temp > UInt16.MaxValue) throw new OverflowException(SR.Overflow_UInt16); + if (temp < UInt16.MinValue || temp > UInt16.MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_UInt16")); return (ushort)temp; } @@ -973,7 +973,7 @@ namespace System if (d.flags >= 0 || i == 0) return i; } - throw new OverflowException(SR.Overflow_UInt32); + throw new OverflowException(Environment.GetResourceString("Overflow_UInt32")); } // Converts a Decimal to an unsigned long. The Decimal @@ -990,7 +990,7 @@ namespace System if (d.flags >= 0 || l == 0) return l; } - throw new OverflowException(SR.Overflow_UInt64); + throw new OverflowException(Environment.GetResourceString("Overflow_UInt64")); } // Converts a Decimal to a float. Since a float has fewer significant @@ -1094,7 +1094,7 @@ namespace System } catch (OverflowException e) { - throw new OverflowException(SR.Overflow_Char, e); + throw new OverflowException(Environment.GetResourceString("Overflow_Char"), e); } return (char)temp; } @@ -1240,7 +1240,7 @@ namespace System /// <internalonly/> char IConvertible.ToChar(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Decimal", "Char")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Decimal", "Char")); } /// <internalonly/> @@ -1312,7 +1312,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Decimal", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Decimal", "DateTime")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/DefaultBinder.cs b/src/mscorlib/src/System/DefaultBinder.cs index 91790facb0..789698f77e 100644 --- a/src/mscorlib/src/System/DefaultBinder.cs +++ b/src/mscorlib/src/System/DefaultBinder.cs @@ -40,7 +40,7 @@ namespace System ParameterModifier[] modifiers, CultureInfo cultureInfo, String[] names, out Object state) { if (match == null || match.Length == 0) - throw new ArgumentException(SR.Arg_EmptyArray, nameof(match)); + throw new ArgumentException(Environment.GetResourceString("Arg_EmptyArray"), nameof(match)); Contract.EndContractBlock(); MethodBase[] candidates = (MethodBase[])match.Clone(); @@ -292,7 +292,7 @@ namespace System // If we didn't find a method if (CurIdx == 0) - throw new MissingMethodException(SR.MissingMember); + throw new MissingMethodException(Environment.GetResourceString("MissingMember")); if (CurIdx == 1) { @@ -375,7 +375,7 @@ namespace System } if (ambig) - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); // Reorder (if needed) if (names != null) @@ -499,7 +499,7 @@ namespace System } } if (CurIdx == 0) - throw new MissingFieldException(SR.MissingField); + throw new MissingFieldException(Environment.GetResourceString("MissingField")); if (CurIdx == 1) return candidates[0]; } @@ -522,7 +522,7 @@ namespace System } } if (ambig) - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); return candidates[currentMin]; } @@ -539,13 +539,13 @@ namespace System { realTypes[i] = types[i].UnderlyingSystemType; if (!(realTypes[i] is RuntimeType)) - throw new ArgumentException(SR.Arg_MustBeType, nameof(types)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(types)); } types = realTypes; // We don't automatically jump out on exact match. if (match == null || match.Length == 0) - throw new ArgumentException(SR.Arg_EmptyArray, nameof(match)); + throw new ArgumentException(Environment.GetResourceString("Arg_EmptyArray"), nameof(match)); MethodBase[] candidates = (MethodBase[])match.Clone(); @@ -606,7 +606,7 @@ namespace System } } if (ambig) - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); return candidates[currentMin]; } @@ -620,7 +620,7 @@ namespace System throw new ArgumentNullException(nameof(indexes)); } if (match == null || match.Length == 0) - throw new ArgumentException(SR.Arg_EmptyArray, nameof(match)); + throw new ArgumentException(Environment.GetResourceString("Arg_EmptyArray"), nameof(match)); Contract.EndContractBlock(); PropertyInfo[] candidates = (PropertyInfo[])match.Clone(); @@ -718,7 +718,7 @@ namespace System } if (ambig) - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); return candidates[currentMin]; } @@ -727,7 +727,7 @@ namespace System // This is because the default is built into the low level invoke code. public override Object ChangeType(Object value, Type type, CultureInfo cultureInfo) { - throw new NotSupportedException(SR.NotSupported_ChangeType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ChangeType")); } public override void ReorderArgumentArray(ref Object[] args, Object state) @@ -833,7 +833,7 @@ namespace System continue; if (bestMatch != null) - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); bestMatch = match[i]; } @@ -1110,7 +1110,7 @@ namespace System // This can only happen if at least one is vararg or generic. if (currentHierarchyDepth == deepestHierarchy) { - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); } // Check to see if this method is on the most derived class. diff --git a/src/mscorlib/src/System/Delegate.cs b/src/mscorlib/src/System/Delegate.cs index de0ff6532c..5f017733da 100644 --- a/src/mscorlib/src/System/Delegate.cs +++ b/src/mscorlib/src/System/Delegate.cs @@ -57,7 +57,7 @@ namespace System if (!BindToMethodName(target, (RuntimeType)target.GetType(), method, DelegateBindingFlags.InstanceMethodOnly | DelegateBindingFlags.ClosedDelegateOnly)) - throw new ArgumentException(SR.Arg_DlgtTargMeth); + throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth")); } // This constructor is called from a class to generate a @@ -69,7 +69,7 @@ namespace System throw new ArgumentNullException(nameof(target)); if (target.IsGenericType && target.ContainsGenericParameters) - throw new ArgumentException(SR.Arg_UnboundGenParam, nameof(target)); + throw new ArgumentException(Environment.GetResourceString("Arg_UnboundGenParam"), nameof(target)); if (method == null) throw new ArgumentNullException(nameof(method)); @@ -77,7 +77,7 @@ namespace System RuntimeType rtTarget = target as RuntimeType; if (rtTarget == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(target)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(target)); // This API existed in v1/v1.1 and only expected to create open // static delegates. Constrain the call to BindToMethodName to such @@ -291,7 +291,7 @@ namespace System return source; if (!InternalEqualTypes(source, value)) - throw new ArgumentException(SR.Arg_DlgtTypeMis); + throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTypeMis")); return source.RemoveImpl(value); } @@ -312,7 +312,7 @@ namespace System protected virtual Delegate CombineImpl(Delegate d) { - throw new MulticastNotSupportedException(SR.Multicast_Combine); + throw new MulticastNotSupportedException(Environment.GetResourceString("Multicast_Combine")); } protected virtual Delegate RemoveImpl(Delegate d) @@ -351,9 +351,9 @@ namespace System RuntimeType rtType = type as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(type)); if (!rtType.IsDelegate()) - throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(type)); Delegate d = InternalAlloc(rtType); // This API existed in v1/v1.1 and only expected to create closed @@ -370,7 +370,7 @@ namespace System (ignoreCase ? DelegateBindingFlags.CaselessMatching : 0))) { if (throwOnBindFailure) - throw new ArgumentException(SR.Arg_DlgtTargMeth); + throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth")); d = null; } @@ -397,7 +397,7 @@ namespace System if (target == null) throw new ArgumentNullException(nameof(target)); if (target.IsGenericType && target.ContainsGenericParameters) - throw new ArgumentException(SR.Arg_UnboundGenParam, nameof(target)); + throw new ArgumentException(Environment.GetResourceString("Arg_UnboundGenParam"), nameof(target)); if (method == null) throw new ArgumentNullException(nameof(method)); Contract.EndContractBlock(); @@ -405,11 +405,11 @@ namespace System RuntimeType rtType = type as RuntimeType; RuntimeType rtTarget = target as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(type)); if (rtTarget == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(target)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(target)); if (!rtType.IsDelegate()) - throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(type)); Delegate d = InternalAlloc(rtType); // This API existed in v1/v1.1 and only expected to create open @@ -422,7 +422,7 @@ namespace System (ignoreCase ? DelegateBindingFlags.CaselessMatching : 0))) { if (throwOnBindFailure) - throw new ArgumentException(SR.Arg_DlgtTargMeth); + throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth")); d = null; } @@ -442,14 +442,14 @@ namespace System RuntimeType rtType = type as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(type)); RuntimeMethodInfo rmi = method as RuntimeMethodInfo; if (rmi == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(method)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), nameof(method)); if (!rtType.IsDelegate()) - throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(type)); // This API existed in v1/v1.1 and only expected to create closed // instance delegates. Constrain the call to BindToMethodInfo to @@ -468,7 +468,7 @@ namespace System ref stackMark); if (d == null && throwOnBindFailure) - throw new ArgumentException(SR.Arg_DlgtTargMeth); + throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth")); return d; } @@ -492,14 +492,14 @@ namespace System RuntimeType rtType = type as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(type)); RuntimeMethodInfo rmi = method as RuntimeMethodInfo; if (rmi == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(method)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), nameof(method)); if (!rtType.IsDelegate()) - throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(type)); // This API is new in Whidbey and allows the full range of delegate // flexability (open or closed delegates binding to static or @@ -515,7 +515,7 @@ namespace System ref stackMark); if (d == null && throwOnBindFailure) - throw new ArgumentException(SR.Arg_DlgtTargMeth); + throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth")); return d; } @@ -562,10 +562,10 @@ namespace System RuntimeType rtType = type as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(type)); if (!rtType.IsDelegate()) - throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(type)); // Initialize the method... Delegate d = InternalAlloc(rtType); @@ -578,7 +578,7 @@ namespace System method.GetMethodInfo(), RuntimeMethodHandle.GetDeclaringType(method.GetMethodInfo()), DelegateBindingFlags.RelaxedSignature | DelegateBindingFlags.SkipSecurityChecks)) - throw new ArgumentException(SR.Arg_DlgtTargMeth); + throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth")); return d; } @@ -595,10 +595,10 @@ namespace System RuntimeMethodInfo rtMethod = method as RuntimeMethodInfo; if (rtMethod == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(method)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), nameof(method)); if (!type.IsDelegate()) - throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(type)); // This API is used by the formatters when deserializing a delegate. // They pass us the specific target method (that was already the @@ -613,7 +613,7 @@ namespace System DelegateBindingFlags.RelaxedSignature); if (d == null) - throw new ArgumentException(SR.Arg_DlgtTargMeth); + throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth")); return d; } diff --git a/src/mscorlib/src/System/DelegateSerializationHolder.cs b/src/mscorlib/src/System/DelegateSerializationHolder.cs index 5f8f0ef3f0..4112816ba5 100644 --- a/src/mscorlib/src/System/DelegateSerializationHolder.cs +++ b/src/mscorlib/src/System/DelegateSerializationHolder.cs @@ -28,10 +28,10 @@ namespace System Type c = delegateType.BaseType; if (c == null || (c != typeof(Delegate) && c != typeof(MulticastDelegate))) - throw new ArgumentException(SR.Arg_MustBeDelegate, "type"); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), "type"); if (method.DeclaringType == null) - throw new NotSupportedException(SR.NotSupported_GlobalMethodSerialization); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_GlobalMethodSerialization")); DelegateEntry de = new DelegateEntry(delegateType.FullName, delegateType.Module.Assembly.FullName, target, method.ReflectedType.Module.Assembly.FullName, method.ReflectedType.FullName, method.Name); @@ -170,7 +170,7 @@ namespace System private void ThrowInsufficientState(string field) { throw new SerializationException( - SR.Format(SR.Serialization_InsufficientDeserializationState, field)); + Environment.GetResourceString("Serialization_InsufficientDeserializationState", field)); } private DelegateEntry OldDelegateWireFormat(SerializationInfo info, StreamingContext context) @@ -272,7 +272,7 @@ namespace System #region ISerializable public void GetObjectData(SerializationInfo info, StreamingContext context) { - throw new NotSupportedException(SR.NotSupported_DelegateSerHolderSerial); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DelegateSerHolderSerial")); } #endregion } diff --git a/src/mscorlib/src/System/Diagnostics/Assert.cs b/src/mscorlib/src/System/Diagnostics/Assert.cs index 67e6914aa4..c0b4e4c229 100644 --- a/src/mscorlib/src/System/Diagnostics/Assert.cs +++ b/src/mscorlib/src/System/Diagnostics/Assert.cs @@ -67,7 +67,7 @@ namespace System.Diagnostics if (Debugger.Launch() == false) { throw new InvalidOperationException( - SR.InvalidOperation_DebuggerLaunchFailed); + Environment.GetResourceString("InvalidOperation_DebuggerLaunchFailed")); } } } diff --git a/src/mscorlib/src/System/Diagnostics/Contracts/Contracts.cs b/src/mscorlib/src/System/Diagnostics/Contracts/Contracts.cs index 76b15197f2..fe1afe3fab 100644 --- a/src/mscorlib/src/System/Diagnostics/Contracts/Contracts.cs +++ b/src/mscorlib/src/System/Diagnostics/Contracts/Contracts.cs @@ -640,7 +640,7 @@ namespace System.Diagnostics.Contracts { if (fromInclusive > toExclusive) #if CORECLR - throw new ArgumentException(SR.Argument_ToExclusiveLessThanFromExclusive); + throw new ArgumentException(Environment.GetResourceString("Argument_ToExclusiveLessThanFromExclusive")); #else throw new ArgumentException("fromInclusive must be less than or equal to toExclusive."); #endif @@ -700,7 +700,7 @@ namespace System.Diagnostics.Contracts { if (fromInclusive > toExclusive) #if CORECLR - throw new ArgumentException(SR.Argument_ToExclusiveLessThanFromExclusive); + throw new ArgumentException(Environment.GetResourceString("Argument_ToExclusiveLessThanFromExclusive")); #else throw new ArgumentException("fromInclusive must be less than or equal to toExclusive."); #endif diff --git a/src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs b/src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs index 09d1e6baca..1e86b914e6 100644 --- a/src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs +++ b/src/mscorlib/src/System/Diagnostics/Contracts/ContractsBCL.cs @@ -73,7 +73,7 @@ namespace System.Diagnostics.Contracts if (probablyNotRewritten == null) probablyNotRewritten = thisAssembly; String simpleName = probablyNotRewritten.GetName().Name; - System.Runtime.CompilerServices.ContractHelper.TriggerFailure(kind, SR.Format(SR.MustUseCCRewrite, contractKind, simpleName), null, null, null); + System.Runtime.CompilerServices.ContractHelper.TriggerFailure(kind, Environment.GetResourceString("MustUseCCRewrite", contractKind, simpleName), null, null, null); _assertingMustUseRewriter = false; } @@ -95,7 +95,7 @@ namespace System.Diagnostics.Contracts static partial void ReportFailure(ContractFailureKind failureKind, String userMessage, String conditionText, Exception innerException) { if (failureKind < ContractFailureKind.Precondition || failureKind > ContractFailureKind.Assume) - throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, failureKind), nameof(failureKind)); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", failureKind), nameof(failureKind)); Contract.EndContractBlock(); // displayMessage == null means: yes we handled it. Otherwise it is the localized failure message @@ -308,7 +308,7 @@ namespace System.Runtime.CompilerServices static partial void RaiseContractFailedEventImplementation(ContractFailureKind failureKind, String userMessage, String conditionText, Exception innerException, ref string resultFailureMessage) { if (failureKind < ContractFailureKind.Precondition || failureKind > ContractFailureKind.Assume) - throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, failureKind), nameof(failureKind)); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", failureKind), nameof(failureKind)); Contract.EndContractBlock(); string returnValue; @@ -382,7 +382,7 @@ namespace System.Runtime.CompilerServices // May need to rethink Assert.Fail w/ TaskDialogIndirect as a model. Window title. Main instruction. Content. Expanded info. // Optional info like string for collapsed text vs. expanded text. - String windowTitle = SR.GetResourceString(GetResourceNameForFailure(kind)); + String windowTitle = Environment.GetResourceString(GetResourceNameForFailure(kind)); const int numStackFramesToSkip = 2; // To make stack traces easier to read System.Diagnostics.Assert.Fail(conditionText, displayMessage, windowTitle, COR_E_CODECONTRACTFAILED, StackTrace.TraceFormat.Normal, numStackFramesToSkip); // If we got here, the user selected Ignore. Continue. @@ -440,11 +440,11 @@ namespace System.Runtime.CompilerServices if (!String.IsNullOrEmpty(conditionText)) { resourceName += "_Cnd"; - failureMessage = SR.Format(SR.GetResourceString(resourceName), conditionText); + failureMessage = Environment.GetResourceString(resourceName, conditionText); } else { - failureMessage = SR.GetResourceString(resourceName); + failureMessage = Environment.GetResourceString(resourceName); } // Now add in the user message, if present. diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/EventCounter.cs b/src/mscorlib/src/System/Diagnostics/Eventing/EventCounter.cs index 2ad0581ad4..b1f946464e 100644 --- a/src/mscorlib/src/System/Diagnostics/Eventing/EventCounter.cs +++ b/src/mscorlib/src/System/Diagnostics/Eventing/EventCounter.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs b/src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs index b691dd38b9..71c421231e 100644 --- a/src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs +++ b/src/mscorlib/src/System/Diagnostics/Eventing/EventSource_CoreCLR.cs @@ -128,7 +128,7 @@ namespace System.Diagnostics.Tracing private static string GetResourceString(string key, params object[] args) { - return SR.Format(SR.GetResourceString(key), args); + return Environment.GetResourceString(key, args); } private static readonly bool m_EventSourcePreventRecursion = false; @@ -214,7 +214,7 @@ namespace System.Diagnostics.Tracing { internal static string GetResourceString(string key, params object[] args) { - return SR.Format(SR.GetResourceString(key), args); + return Environment.GetResourceString(key, args); } } } diff --git a/src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/PropertyValue.cs b/src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/PropertyValue.cs index 00ffcdc9c0..f95e36da42 100644 --- a/src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/PropertyValue.cs +++ b/src/mscorlib/src/System/Diagnostics/Eventing/TraceLogging/PropertyValue.cs @@ -1,4 +1,4 @@ -using System.Reflection; +using System.Reflection; using System.Runtime.InteropServices; using System.Diagnostics; diff --git a/src/mscorlib/src/System/Diagnostics/LogSwitch.cs b/src/mscorlib/src/System/Diagnostics/LogSwitch.cs index 29d6a1d4e6..85f4f4f646 100644 --- a/src/mscorlib/src/System/Diagnostics/LogSwitch.cs +++ b/src/mscorlib/src/System/Diagnostics/LogSwitch.cs @@ -37,7 +37,7 @@ namespace System.Diagnostics public LogSwitch(String name, String description, LogSwitch parent) { if (name != null && name.Length == 0) - throw new ArgumentOutOfRangeException(nameof(Name), SR.Argument_StringZeroLength); + throw new ArgumentOutOfRangeException(nameof(Name), Environment.GetResourceString("Argument_StringZeroLength")); Contract.EndContractBlock(); if ((name != null) && (parent != null)) diff --git a/src/mscorlib/src/System/Diagnostics/Stacktrace.cs b/src/mscorlib/src/System/Diagnostics/Stacktrace.cs index cdedb66ed8..20cf4a5d7a 100644 --- a/src/mscorlib/src/System/Diagnostics/Stacktrace.cs +++ b/src/mscorlib/src/System/Diagnostics/Stacktrace.cs @@ -283,7 +283,7 @@ namespace System.Diagnostics { if (skipFrames < 0) throw new ArgumentOutOfRangeException(nameof(skipFrames), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); m_iNumOfFrames = 0; @@ -299,7 +299,7 @@ namespace System.Diagnostics { if (skipFrames < 0) throw new ArgumentOutOfRangeException(nameof(skipFrames), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); m_iNumOfFrames = 0; @@ -344,7 +344,7 @@ namespace System.Diagnostics if (skipFrames < 0) throw new ArgumentOutOfRangeException(nameof(skipFrames), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); m_iNumOfFrames = 0; @@ -363,7 +363,7 @@ namespace System.Diagnostics if (skipFrames < 0) throw new ArgumentOutOfRangeException(nameof(skipFrames), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); m_iNumOfFrames = 0; @@ -539,8 +539,8 @@ namespace System.Diagnostics if (traceFormat != TraceFormat.NoResourceLookup) { - word_At = SR.Word_At; - inFileLineNum = SR.StackTrace_InFileLineNumber; + word_At = Environment.GetResourceString("Word_At"); + inFileLineNum = Environment.GetResourceString("StackTrace_InFileLineNumber"); } bool fFirstFrame = true; @@ -658,7 +658,7 @@ namespace System.Diagnostics if (sf.GetIsLastFrameFromForeignExceptionStackTrace()) { sb.Append(Environment.NewLine); - sb.Append(SR.Exception_EndStackTraceFromPreviousThrow); + sb.Append(Environment.GetResourceString("Exception_EndStackTraceFromPreviousThrow")); } } } diff --git a/src/mscorlib/src/System/Diagnostics/log.cs b/src/mscorlib/src/System/Diagnostics/log.cs index b62ea493e7..8b6ab50bd6 100644 --- a/src/mscorlib/src/System/Diagnostics/log.cs +++ b/src/mscorlib/src/System/Diagnostics/log.cs @@ -88,7 +88,7 @@ namespace System.Diagnostics throw new ArgumentNullException("LogSwitch"); if (level < 0) - throw new ArgumentOutOfRangeException(nameof(level), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(level), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Is logging for this level for this switch enabled? diff --git a/src/mscorlib/src/System/DllNotFoundException.cs b/src/mscorlib/src/System/DllNotFoundException.cs index dd0f27e7c1..63b263e9dd 100644 --- a/src/mscorlib/src/System/DllNotFoundException.cs +++ b/src/mscorlib/src/System/DllNotFoundException.cs @@ -21,7 +21,7 @@ namespace System public class DllNotFoundException : TypeLoadException { public DllNotFoundException() - : base(SR.Arg_DllNotFoundException) + : base(Environment.GetResourceString("Arg_DllNotFoundException")) { SetErrorCode(__HResults.COR_E_DLLNOTFOUND); } diff --git a/src/mscorlib/src/System/Double.cs b/src/mscorlib/src/System/Double.cs index b6e0012d38..d7319b6c48 100644 --- a/src/mscorlib/src/System/Double.cs +++ b/src/mscorlib/src/System/Double.cs @@ -120,7 +120,7 @@ namespace System else return 1; } - throw new ArgumentException(SR.Arg_MustBeDouble); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDouble")); } public int CompareTo(Double value) @@ -330,7 +330,7 @@ namespace System /// <internalonly/> char IConvertible.ToChar(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Double", "Char")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Double", "Char")); } /// <internalonly/> @@ -402,7 +402,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Double", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Double", "DateTime")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/Enum.cs b/src/mscorlib/src/System/Enum.cs index cf26a33818..0f01052f31 100644 --- a/src/mscorlib/src/System/Enum.cs +++ b/src/mscorlib/src/System/Enum.cs @@ -69,7 +69,7 @@ namespace System case CorElementType.U8: return (*(ulong*)pValue).ToString("X16", null); default: - throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnknownEnumType")); } } } @@ -103,7 +103,7 @@ namespace System return ((UInt64)(Int64)value).ToString("X16", null); // All unsigned types will be directly cast default: - throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnknownEnumType")); } } @@ -250,7 +250,7 @@ namespace System break; // All unsigned types will be directly cast default: - throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnknownEnumType")); } return result; @@ -316,20 +316,20 @@ namespace System switch (m_failure) { case ParseFailureKind.Argument: - return new ArgumentException(SR.GetResourceString(m_failureMessageID)); + return new ArgumentException(Environment.GetResourceString(m_failureMessageID)); case ParseFailureKind.ArgumentNull: return new ArgumentNullException(m_failureParameter); case ParseFailureKind.ArgumentWithParameter: - return new ArgumentException(SR.Format(SR.GetResourceString(m_failureMessageID), m_failureMessageFormatArgument)); + return new ArgumentException(Environment.GetResourceString(m_failureMessageID, m_failureMessageFormatArgument)); case ParseFailureKind.UnhandledException: return m_innerException; default: Debug.Assert(false, "Unknown EnumParseFailure: " + m_failure); - return new ArgumentException(SR.Arg_EnumValueNotFound); + return new ArgumentException(Environment.GetResourceString("Arg_EnumValueNotFound")); } } } @@ -402,10 +402,10 @@ namespace System RuntimeType rtType = enumType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType)); if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType)); if (value == null) { @@ -624,7 +624,7 @@ namespace System default: // All unsigned types will be directly cast - throw new ArgumentException(SR.Arg_MustBeEnumBaseTypeOrEnum, nameof(value)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnumBaseTypeOrEnum"), nameof(value)); } } @@ -644,7 +644,7 @@ namespace System throw new ArgumentNullException(nameof(enumType)); if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType)); if (value == null) throw new ArgumentNullException(nameof(value)); @@ -655,7 +655,7 @@ namespace System RuntimeType rtType = enumType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType)); // Check if both of them are of the same type Type valueType = value.GetType(); @@ -666,24 +666,24 @@ namespace System if (valueType.IsEnum) { if (!valueType.IsEquivalentTo(enumType)) - throw new ArgumentException(SR.Format(SR.Arg_EnumAndObjectMustBeSameType, valueType.ToString(), enumType.ToString())); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumAndObjectMustBeSameType", valueType.ToString(), enumType.ToString())); if (format.Length != 1) { // all acceptable format string are of length 1 - throw new FormatException(SR.Format_InvalidEnumFormatSpecification); + throw new FormatException(Environment.GetResourceString("Format_InvalidEnumFormatSpecification")); } return ((Enum)value).ToString(format); } // The value must be of the same type as the Underlying type of the Enum else if (valueType != underlyingType) { - throw new ArgumentException(SR.Format(SR.Arg_EnumFormatUnderlyingTypeAndObjectMustBeSameType, valueType.ToString(), underlyingType.ToString())); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumFormatUnderlyingTypeAndObjectMustBeSameType", valueType.ToString(), underlyingType.ToString())); } if (format.Length != 1) { // all acceptable format string are of length 1 - throw new FormatException(SR.Format_InvalidEnumFormatSpecification); + throw new FormatException(Environment.GetResourceString("Format_InvalidEnumFormatSpecification")); } char formatCh = format[0]; @@ -699,7 +699,7 @@ namespace System if (formatCh == 'F' || formatCh == 'f') return Enum.InternalFlagsFormat(rtType, ToUInt64(value)) ?? value.ToString(); - throw new FormatException(SR.Format_InvalidEnumFormatSpecification); + throw new FormatException(Environment.GetResourceString("Format_InvalidEnumFormatSpecification")); } #endregion @@ -916,14 +916,15 @@ namespace System Type thisType = this.GetType(); Type targetType = target.GetType(); - throw new ArgumentException(SR.Format(SR.Arg_EnumAndObjectMustBeSameType, targetType.ToString(), thisType.ToString())); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumAndObjectMustBeSameType", + targetType.ToString(), thisType.ToString())); } else { // assert valid return code (3) Debug.Assert(ret == retInvalidEnumType, "Enum.InternalCompareTo return code was invalid"); - throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnknownEnumType")); } } #endregion @@ -935,7 +936,7 @@ namespace System if (format == null || format.Length == 0) formatCh = 'G'; else if (format.Length != 1) - throw new FormatException(SR.Format_InvalidEnumFormatSpecification); + throw new FormatException(Environment.GetResourceString("Format_InvalidEnumFormatSpecification")); else formatCh = format[0]; @@ -951,7 +952,7 @@ namespace System if (formatCh == 'F' || formatCh == 'f') return InternalFlagsFormat((RuntimeType)GetType(), ToUInt64()) ?? GetValue().ToString(); - throw new FormatException(SR.Format_InvalidEnumFormatSpecification); + throw new FormatException(Environment.GetResourceString("Format_InvalidEnumFormatSpecification")); } [Obsolete("The provider argument is not used. Please use ToString().")] @@ -968,7 +969,7 @@ namespace System if (!this.GetType().IsEquivalentTo(flag.GetType())) { - throw new ArgumentException(SR.Format(SR.Argument_EnumTypeDoesNotMatch, flag.GetType(), this.GetType())); + throw new ArgumentException(Environment.GetResourceString("Argument_EnumTypeDoesNotMatch", flag.GetType(), this.GetType())); } return InternalHasFlag(flag); @@ -1002,7 +1003,7 @@ namespace System case CorElementType.U8: return TypeCode.UInt64; default: - throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnknownEnumType")); } } @@ -1087,7 +1088,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Enum", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Enum", "DateTime")); } /// <internalonly/> @@ -1104,11 +1105,11 @@ namespace System if (enumType == null) throw new ArgumentNullException(nameof(enumType)); if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType)); Contract.EndContractBlock(); RuntimeType rtType = enumType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType)); return InternalBoxEnum(rtType, value); } @@ -1117,11 +1118,11 @@ namespace System if (enumType == null) throw new ArgumentNullException(nameof(enumType)); if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType)); Contract.EndContractBlock(); RuntimeType rtType = enumType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType)); return InternalBoxEnum(rtType, value); } @@ -1130,11 +1131,11 @@ namespace System if (enumType == null) throw new ArgumentNullException(nameof(enumType)); if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType)); Contract.EndContractBlock(); RuntimeType rtType = enumType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType)); return InternalBoxEnum(rtType, value); } @@ -1143,11 +1144,11 @@ namespace System if (enumType == null) throw new ArgumentNullException(nameof(enumType)); if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType)); Contract.EndContractBlock(); RuntimeType rtType = enumType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType)); return InternalBoxEnum(rtType, value); } @@ -1157,11 +1158,11 @@ namespace System if (enumType == null) throw new ArgumentNullException(nameof(enumType)); if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType)); Contract.EndContractBlock(); RuntimeType rtType = enumType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType)); return InternalBoxEnum(rtType, value); } @@ -1171,11 +1172,11 @@ namespace System if (enumType == null) throw new ArgumentNullException(nameof(enumType)); if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType)); Contract.EndContractBlock(); RuntimeType rtType = enumType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType)); return InternalBoxEnum(rtType, value); } @@ -1184,11 +1185,11 @@ namespace System if (enumType == null) throw new ArgumentNullException(nameof(enumType)); if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType)); Contract.EndContractBlock(); RuntimeType rtType = enumType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType)); return InternalBoxEnum(rtType, value); } @@ -1198,11 +1199,11 @@ namespace System if (enumType == null) throw new ArgumentNullException(nameof(enumType)); if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType)); Contract.EndContractBlock(); RuntimeType rtType = enumType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType)); return InternalBoxEnum(rtType, unchecked((long)value)); } @@ -1211,11 +1212,11 @@ namespace System if (enumType == null) throw new ArgumentNullException(nameof(enumType)); if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType)); Contract.EndContractBlock(); RuntimeType rtType = enumType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType)); return InternalBoxEnum(rtType, value); } @@ -1224,11 +1225,11 @@ namespace System if (enumType == null) throw new ArgumentNullException(nameof(enumType)); if (!enumType.IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), nameof(enumType)); Contract.EndContractBlock(); RuntimeType rtType = enumType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(enumType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(enumType)); return InternalBoxEnum(rtType, value ? 1 : 0); } #endregion diff --git a/src/mscorlib/src/System/Environment.cs b/src/mscorlib/src/System/Environment.cs index 911b5b1640..823c237150 100644 --- a/src/mscorlib/src/System/Environment.cs +++ b/src/mscorlib/src/System/Environment.cs @@ -50,18 +50,132 @@ namespace System // that includes the contents of the environment variable. private const int MaxSystemEnvVariableLength = 1024; private const int MaxUserEnvVariableLength = 255; - private const int MaxMachineNameLength = 256; - // Looks up the resource string value for key. - // - // if you change this method's signature then you must change the code that calls it - // in excep.cpp and probably you will have to visit mscorlib.h to add the new signature - // as well as metasig.h to create the new signature type - internal static String GetResourceStringLocal(String key) + internal sealed class ResourceHelper { - return SR.GetResourceString(key); + internal ResourceHelper(String name) + { + m_name = name; + } + + private String m_name; + private ResourceManager SystemResMgr; + + // To avoid infinite loops when calling GetResourceString. See comments + // in GetResourceString for this field. + private List<string> currentlyLoading; + + // process-wide state (since this is only used in one domain), + // used to avoid the TypeInitialization infinite recusion + // in GetResourceStringCode + internal bool resourceManagerInited = false; + + // Is this thread currently doing infinite resource lookups? + private int infinitelyRecursingCount; + + internal String GetResourceString(String key) + { + if (key == null || key.Length == 0) + { + Debug.Assert(false, "Environment::GetResourceString with null or empty key. Bug in caller, or weird recursive loading problem?"); + return "[Resource lookup failed - null or empty resource name]"; + } + + // We have a somewhat common potential for infinite + // loops with mscorlib's ResourceManager. If "potentially dangerous" + // code throws an exception, we will get into an infinite loop + // inside the ResourceManager and this "potentially dangerous" code. + // Potentially dangerous code includes the IO package, CultureInfo, + // parts of the loader, some parts of Reflection, Security (including + // custom user-written permissions that may parse an XML file at + // class load time), assembly load event handlers, etc. Essentially, + // this is not a bounded set of code, and we need to fix the problem. + // Fortunately, this is limited to mscorlib's error lookups and is NOT + // a general problem for all user code using the ResourceManager. + + // The solution is to make sure only one thread at a time can call + // GetResourceString. Also, since resource lookups can be + // reentrant, if the same thread comes into GetResourceString + // twice looking for the exact same resource name before + // returning, we're going into an infinite loop and we should + // return a bogus string. + + bool lockTaken = false; + try + { + Monitor.Enter(this, ref lockTaken); + + // Are we recursively looking up the same resource? Note - our backout code will set + // the ResourceHelper's currentlyLoading stack to null if an exception occurs. + if (currentlyLoading != null && currentlyLoading.Count > 0 && currentlyLoading.LastIndexOf(key) != -1) + { + // We can start infinitely recursing for one resource lookup, + // then during our failure reporting, start infinitely recursing again. + // avoid that. + if (infinitelyRecursingCount > 0) + { + return "[Resource lookup failed - infinite recursion or critical failure detected.]"; + } + infinitelyRecursingCount++; + + // Note: our infrastructure for reporting this exception will again cause resource lookup. + // This is the most direct way of dealing with that problem. + string message = $"Infinite recursion during resource lookup within {System.CoreLib.Name}. This may be a bug in {System.CoreLib.Name}, or potentially in certain extensibility points such as assembly resolve events or CultureInfo names. Resource name: {key}"; + Assert.Fail("[Recursive resource lookup bug]", message, Assert.COR_E_FAILFAST, System.Diagnostics.StackTrace.TraceFormat.NoResourceLookup); + Environment.FailFast(message); + } + if (currentlyLoading == null) + currentlyLoading = new List<string>(); + + // Call class constructors preemptively, so that we cannot get into an infinite + // loop constructing a TypeInitializationException. If this were omitted, + // we could get the Infinite recursion assert above by failing type initialization + // between the Push and Pop calls below. + if (!resourceManagerInited) + { + RuntimeHelpers.RunClassConstructor(typeof(ResourceManager).TypeHandle); + RuntimeHelpers.RunClassConstructor(typeof(ResourceReader).TypeHandle); + RuntimeHelpers.RunClassConstructor(typeof(RuntimeResourceSet).TypeHandle); + RuntimeHelpers.RunClassConstructor(typeof(BinaryReader).TypeHandle); + resourceManagerInited = true; + } + + currentlyLoading.Add(key); // Push + + if (SystemResMgr == null) + { + SystemResMgr = new ResourceManager(m_name, typeof(Object).Assembly); + } + string s = SystemResMgr.GetString(key, null); + currentlyLoading.RemoveAt(currentlyLoading.Count - 1); // Pop + + Debug.Assert(s != null, "Managed resource string lookup failed. Was your resource name misspelled? Did you rebuild mscorlib after adding a resource to resources.txt? Debug this w/ cordbg and bug whoever owns the code that called Environment.GetResourceString. Resource name was: \"" + key + "\""); + return s; + } + catch + { + if (lockTaken) + { + // Backout code - throw away potentially corrupt state + SystemResMgr = null; + currentlyLoading = null; + } + throw; + } + finally + { + if (lockTaken) + { + Monitor.Exit(this); + } + } + } } + private static volatile ResourceHelper m_resHelper; // Doesn't need to be initialized as they're zero-init. + + private const int MaxMachineNameLength = 256; + // Private object for locking instead of locking on a public type for SQL reliability work. private static Object s_InternalSyncObject; private static Object InternalSyncObject @@ -249,7 +363,7 @@ namespace System StringBuilder buf = new StringBuilder(MaxMachineNameLength); int len = MaxMachineNameLength; if (Win32Native.GetComputerName(buf, ref len) == 0) - throw new InvalidOperationException(SR.InvalidOperation_ComputerName); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ComputerName")); return buf.ToString(); } } @@ -406,12 +520,12 @@ namespace System Microsoft.Win32.Win32Native.OSVERSIONINFO osvi = new Microsoft.Win32.Win32Native.OSVERSIONINFO(); if (!GetVersion(osvi)) { - throw new InvalidOperationException(SR.InvalidOperation_GetVersion); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_GetVersion")); } Microsoft.Win32.Win32Native.OSVERSIONINFOEX osviEx = new Microsoft.Win32.Win32Native.OSVERSIONINFOEX(); if (!GetVersionEx(osviEx)) - throw new InvalidOperationException(SR.InvalidOperation_GetVersion); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_GetVersion")); #if PLATFORM_UNIX PlatformID id = PlatformID.Unix; @@ -486,6 +600,94 @@ namespace System return st.ToString(System.Diagnostics.StackTrace.TraceFormat.Normal); } + private static void InitResourceHelper() + { + // Only the default AppDomain should have a ResourceHelper. All calls to + // GetResourceString from any AppDomain delegate to GetResourceStringLocal + // in the default AppDomain via the fcall GetResourceFromDefault. + + bool tookLock = false; + RuntimeHelpers.PrepareConstrainedRegions(); + try + { + Monitor.Enter(Environment.InternalSyncObject, ref tookLock); + + if (m_resHelper == null) + { + ResourceHelper rh = new ResourceHelper(System.CoreLib.Name); + + System.Threading.Thread.MemoryBarrier(); + m_resHelper = rh; + } + } + finally + { + if (tookLock) + Monitor.Exit(Environment.InternalSyncObject); + } + } + + // Looks up the resource string value for key. + // + // if you change this method's signature then you must change the code that calls it + // in excep.cpp and probably you will have to visit mscorlib.h to add the new signature + // as well as metasig.h to create the new signature type + internal static String GetResourceStringLocal(String key) + { + if (m_resHelper == null) + InitResourceHelper(); + + return m_resHelper.GetResourceString(key); + } + + internal static String GetResourceString(String key) + { + return GetResourceStringLocal(key); + } + + // The reason the following overloads exist are to reduce code bloat. + // Since GetResourceString is basically only called when exceptions are + // thrown, we want the code size to be as small as possible. + // Using the params object[] overload works against this since the + // initialization of the array is done inline in the caller at the IL + // level. So we have overloads that simply wrap the params one. + + [MethodImpl(MethodImplOptions.NoInlining)] + internal static string GetResourceString(string key, object val0) + { + return GetResourceStringFormatted(key, new object[] { val0 }); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + internal static string GetResourceString(string key, object val0, object val1) + { + return GetResourceStringFormatted(key, new object[] { val0, val1 }); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + internal static string GetResourceString(string key, object val0, object val1, object val2) + { + return GetResourceStringFormatted(key, new object[] { val0, val1, val2 }); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + internal static string GetResourceString(string key, object val0, object val1, object val2, object val3) + { + return GetResourceStringFormatted(key, new object[] { val0, val1, val2, val3 }); + } + + [MethodImpl(MethodImplOptions.NoInlining)] + internal static String GetResourceString(string key, params object[] values) + { + return GetResourceStringFormatted(key, values); + } + + private static String GetResourceStringFormatted(string key, params object[] values) + { + string rs = GetResourceString(key); + return String.Format(CultureInfo.CurrentCulture, rs, values); + } + public static extern bool HasShutdownStarted { [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -618,19 +820,19 @@ namespace System } if (variable.Length == 0) { - throw new ArgumentException(SR.Argument_StringZeroLength, nameof(variable)); + throw new ArgumentException(GetResourceString("Argument_StringZeroLength"), nameof(variable)); } if (variable[0] == '\0') { - throw new ArgumentException(SR.Argument_StringFirstCharIsZero, nameof(variable)); + throw new ArgumentException(GetResourceString("Argument_StringFirstCharIsZero"), nameof(variable)); } if (variable.Length >= MaxEnvVariableValueLength) { - throw new ArgumentException(SR.Argument_LongEnvVarValue, nameof(variable)); + throw new ArgumentException(GetResourceString("Argument_LongEnvVarValue"), nameof(variable)); } if (variable.IndexOf('=') != -1) { - throw new ArgumentException(SR.Argument_IllegalEnvVarName, nameof(variable)); + throw new ArgumentException(GetResourceString("Argument_IllegalEnvVarName"), nameof(variable)); } if (string.IsNullOrEmpty(value) || value[0] == '\0') @@ -640,7 +842,7 @@ namespace System } else if (value.Length >= MaxEnvVariableValueLength) { - throw new ArgumentException(SR.Argument_LongEnvVarValue, nameof(value)); + throw new ArgumentException(GetResourceString("Argument_LongEnvVarValue"), nameof(value)); } } @@ -650,7 +852,7 @@ namespace System target != EnvironmentVariableTarget.Machine && target != EnvironmentVariableTarget.User) { - throw new ArgumentOutOfRangeException(nameof(target), target, SR.Format(SR.Arg_EnumIllegalVal, target)); + throw new ArgumentOutOfRangeException(nameof(target), target, SR.Format(GetResourceString("Arg_EnumIllegalVal"), target)); } } @@ -751,7 +953,7 @@ namespace System } else { - throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)target)); + throw new ArgumentException(GetResourceString("Arg_EnumIllegalVal", (int)target)); } using (RegistryKey environmentKey = baseKey.OpenSubKey(keyName, writable: false)) @@ -797,7 +999,7 @@ namespace System } else { - throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)target)); + throw new ArgumentException(GetResourceString("Arg_EnumIllegalVal", (int)target)); } using (RegistryKey environmentKey = baseKey.OpenSubKey(keyName, writable: false)) @@ -840,7 +1042,7 @@ namespace System case Win32Native.ERROR_FILENAME_EXCED_RANGE: // The error message from Win32 is "The filename or extension is too long", // which is not accurate. - throw new ArgumentException(SR.Format(SR.Argument_LongEnvVarValue)); + throw new ArgumentException(GetResourceString("Argument_LongEnvVarValue")); default: throw new ArgumentException(Win32Native.GetMessage(errorCode)); } @@ -879,7 +1081,7 @@ namespace System const int MaxUserEnvVariableLength = 255; if (variable.Length >= MaxUserEnvVariableLength) { - throw new ArgumentException(SR.Argument_LongEnvVarValue, nameof(variable)); + throw new ArgumentException(GetResourceString("Argument_LongEnvVarValue"), nameof(variable)); } baseKey = Registry.CurrentUser; @@ -887,7 +1089,7 @@ namespace System } else { - throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)target)); + throw new ArgumentException(GetResourceString("Arg_EnumIllegalVal", (int)target)); } using (RegistryKey environmentKey = baseKey.OpenSubKey(keyName, writable: true)) diff --git a/src/mscorlib/src/System/Exception.cs b/src/mscorlib/src/System/Exception.cs index 096bee243e..6036063ca6 100644 --- a/src/mscorlib/src/System/Exception.cs +++ b/src/mscorlib/src/System/Exception.cs @@ -98,7 +98,7 @@ namespace System if (_className == null || HResult == 0) - throw new SerializationException(SR.Serialization_InsufficientState); + throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState")); // If we are constructing a new exception after a cross-appdomain call... if (context.State == StreamingContextStates.CrossAppDomain) @@ -130,7 +130,7 @@ namespace System { _className = GetClassName(); } - return SR.Format(SR.Exception_WasThrown, _className); + return Environment.GetResourceString("Exception_WasThrown", _className); } else { @@ -388,7 +388,7 @@ namespace System if (moduleBuilder != null) rtModule = moduleBuilder.InternalModule; else - throw new ArgumentException(SR.Argument_MustBeRuntimeReflectionObject); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeReflectionObject")); } _source = rtModule.GetRuntimeAssembly().GetSimpleName(); @@ -422,7 +422,7 @@ namespace System if (_innerException != null) { s = s + " ---> " + _innerException.ToString(needFileLineInfo, needMessage) + Environment.NewLine + - " " + SR.Exception_EndOfInnerExceptionStack; + " " + Environment.GetResourceString("Exception_EndOfInnerExceptionStack"); } string stackTrace = GetStackTrace(needFileLineInfo); diff --git a/src/mscorlib/src/System/GC.cs b/src/mscorlib/src/System/GC.cs index aeb0ca5196..347bc3f511 100644 --- a/src/mscorlib/src/System/GC.cs +++ b/src/mscorlib/src/System/GC.cs @@ -114,13 +114,13 @@ namespace System if (bytesAllocated <= 0) { throw new ArgumentOutOfRangeException(nameof(bytesAllocated), - SR.ArgumentOutOfRange_NeedPosNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum")); } if ((4 == IntPtr.Size) && (bytesAllocated > Int32.MaxValue)) { throw new ArgumentOutOfRangeException("pressure", - SR.ArgumentOutOfRange_MustBeNonNegInt32); + Environment.GetResourceString("ArgumentOutOfRange_MustBeNonNegInt32")); } Contract.EndContractBlock(); @@ -132,13 +132,13 @@ namespace System if (bytesAllocated <= 0) { throw new ArgumentOutOfRangeException(nameof(bytesAllocated), - SR.ArgumentOutOfRange_NeedPosNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum")); } if ((4 == IntPtr.Size) && (bytesAllocated > Int32.MaxValue)) { throw new ArgumentOutOfRangeException(nameof(bytesAllocated), - SR.ArgumentOutOfRange_MustBeNonNegInt32); + Environment.GetResourceString("ArgumentOutOfRange_MustBeNonNegInt32")); } Contract.EndContractBlock(); @@ -181,12 +181,12 @@ namespace System { if (generation < 0) { - throw new ArgumentOutOfRangeException(nameof(generation), SR.ArgumentOutOfRange_GenericPositive); + throw new ArgumentOutOfRangeException(nameof(generation), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive")); } if ((mode < GCCollectionMode.Default) || (mode > GCCollectionMode.Optimized)) { - throw new ArgumentOutOfRangeException(nameof(mode), SR.ArgumentOutOfRange_Enum); + throw new ArgumentOutOfRangeException(nameof(mode), Environment.GetResourceString("ArgumentOutOfRange_Enum")); } Contract.EndContractBlock(); @@ -217,7 +217,7 @@ namespace System { if (generation < 0) { - throw new ArgumentOutOfRangeException(nameof(generation), SR.ArgumentOutOfRange_GenericPositive); + throw new ArgumentOutOfRangeException(nameof(generation), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive")); } Contract.EndContractBlock(); return _CollectionCount(generation, 0); @@ -372,7 +372,7 @@ namespace System throw new ArgumentOutOfRangeException(nameof(maxGenerationThreshold), String.Format( CultureInfo.CurrentCulture, - SR.ArgumentOutOfRange_Bounds_Lower_Upper, + Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper"), 1, 99)); } @@ -382,14 +382,14 @@ namespace System throw new ArgumentOutOfRangeException(nameof(largeObjectHeapThreshold), String.Format( CultureInfo.CurrentCulture, - SR.ArgumentOutOfRange_Bounds_Lower_Upper, + Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper"), 1, 99)); } if (!_RegisterForFullGCNotification(maxGenerationThreshold, largeObjectHeapThreshold)) { - throw new InvalidOperationException(SR.InvalidOperation_NotWithConcurrentGC); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotWithConcurrentGC")); } } @@ -397,7 +397,7 @@ namespace System { if (!_CancelFullGCNotification()) { - throw new InvalidOperationException(SR.InvalidOperation_NotWithConcurrentGC); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotWithConcurrentGC")); } } @@ -409,7 +409,7 @@ namespace System public static GCNotificationStatus WaitForFullGCApproach(int millisecondsTimeout) { if (millisecondsTimeout < -1) - throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); return (GCNotificationStatus)_WaitForFullGCApproach(millisecondsTimeout); } @@ -422,7 +422,7 @@ namespace System public static GCNotificationStatus WaitForFullGCComplete(int millisecondsTimeout) { if (millisecondsTimeout < -1) - throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); return (GCNotificationStatus)_WaitForFullGCComplete(millisecondsTimeout); } diff --git a/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs b/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs index 09b871f1c5..24c5c4ae8e 100644 --- a/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs +++ b/src/mscorlib/src/System/Globalization/CompareInfo.Unix.cs @@ -292,7 +292,7 @@ namespace System.Globalization if ((options & ValidSortkeyCtorMaskOffFlags) != 0) { - throw new ArgumentException(SR.Argument_InvalidFlag, nameof(options)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag"), nameof(options)); } byte [] keyData; diff --git a/src/mscorlib/src/System/Globalization/DateTimeFormat.cs b/src/mscorlib/src/System/Globalization/DateTimeFormat.cs index e34ca354f1..b87731ad74 100644 --- a/src/mscorlib/src/System/Globalization/DateTimeFormat.cs +++ b/src/mscorlib/src/System/Globalization/DateTimeFormat.cs @@ -338,7 +338,7 @@ namespace System // // This means that '\' is at the end of the formatting string. // - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } } else @@ -353,7 +353,7 @@ namespace System throw new FormatException( String.Format( CultureInfo.CurrentCulture, - SR.Format_BadQuote, quoteChar)); + Environment.GetResourceString("Format_BadQuote"), quoteChar)); } // @@ -538,7 +538,7 @@ namespace System } else { - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } break; case 't': @@ -706,7 +706,7 @@ namespace System // This means that '%' is at the end of the format string or // "%%" appears in the format string. // - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } break; case '\\': @@ -729,7 +729,7 @@ namespace System // // This means that '\' is at the end of the formatting string. // - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } break; default: @@ -898,7 +898,7 @@ namespace System realFormat = dtfi.YearMonthPattern; break; default: - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } return (realFormat); } @@ -949,7 +949,7 @@ namespace System if (offset != NullOffset) { // This format is not supported by DateTimeOffset - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } // Universal time is always in Greogrian calendar. // @@ -1180,7 +1180,7 @@ namespace System results = new String[] { Format(dateTime, new String(format, 1), dtfi) }; break; default: - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } return (results); } diff --git a/src/mscorlib/src/System/Globalization/DateTimeParse.cs b/src/mscorlib/src/System/Globalization/DateTimeParse.cs index 6056b5c6a6..cddfc29092 100644 --- a/src/mscorlib/src/System/Globalization/DateTimeParse.cs +++ b/src/mscorlib/src/System/Globalization/DateTimeParse.cs @@ -4660,13 +4660,13 @@ new DS[] { DS.ERROR, DS.TX_NNN, DS.TX_NNN, DS.TX_NNN, DS.ERROR, DS.ERROR, switch (result.failure) { case ParseFailureKind.ArgumentNull: - return new ArgumentNullException(result.failureArgumentName, SR.GetResourceString(result.failureMessageID)); + return new ArgumentNullException(result.failureArgumentName, Environment.GetResourceString(result.failureMessageID)); case ParseFailureKind.Format: - return new FormatException(SR.GetResourceString(result.failureMessageID)); + return new FormatException(Environment.GetResourceString(result.failureMessageID)); case ParseFailureKind.FormatWithParameter: - return new FormatException(SR.Format(SR.GetResourceString(result.failureMessageID), result.failureMessageFormatArgument)); + return new FormatException(Environment.GetResourceString(result.failureMessageID, result.failureMessageFormatArgument)); case ParseFailureKind.FormatBadDateTimeCalendar: - return new FormatException(SR.Format(SR.GetResourceString(result.failureMessageID), result.calendar)); + return new FormatException(Environment.GetResourceString(result.failureMessageID, result.calendar)); default: Debug.Assert(false, "Unkown DateTimeParseFailure: " + result); return null; diff --git a/src/mscorlib/src/System/Globalization/DigitShapes.cs b/src/mscorlib/src/System/Globalization/DigitShapes.cs index b21f480805..0e4dcc87c3 100644 --- a/src/mscorlib/src/System/Globalization/DigitShapes.cs +++ b/src/mscorlib/src/System/Globalization/DigitShapes.cs @@ -15,4 +15,4 @@ namespace System.Globalization None = 0x0001, // Gives full Unicode compatibility. NativeNational = 0x0002 // National shapes } -} +}
\ No newline at end of file diff --git a/src/mscorlib/src/System/Globalization/EncodingTable.Unix.cs b/src/mscorlib/src/System/Globalization/EncodingTable.Unix.cs index dc61c9f0d9..0fce2e58fc 100644 --- a/src/mscorlib/src/System/Globalization/EncodingTable.Unix.cs +++ b/src/mscorlib/src/System/Globalization/EncodingTable.Unix.cs @@ -21,7 +21,7 @@ namespace System.Globalization CodePageDataItem dataItem = s_encodingDataTableItems[i]; arrayEncodingInfo[i] = new EncodingInfo(dataItem.CodePage, dataItem.WebName, - SR.GetResourceString(dataItem.DisplayNameResourceKey)); + Environment.GetResourceString(dataItem.DisplayNameResourceKey)); } return arrayEncodingInfo; @@ -45,7 +45,7 @@ namespace System.Globalization throw new ArgumentException( string.Format( CultureInfo.CurrentCulture, - SR.Argument_EncodingNotSupported, name), nameof(name)); + Environment.GetResourceString("Argument_EncodingNotSupported"), name), nameof(name)); } internal static CodePageDataItem GetCodePageDataItem(int codepage) diff --git a/src/mscorlib/src/System/Globalization/EncodingTable.cs b/src/mscorlib/src/System/Globalization/EncodingTable.cs index 6d9cc3127f..e54dfd19b2 100644 --- a/src/mscorlib/src/System/Globalization/EncodingTable.cs +++ b/src/mscorlib/src/System/Globalization/EncodingTable.cs @@ -95,7 +95,7 @@ namespace System.Globalization throw new ArgumentException( String.Format( CultureInfo.CurrentCulture, - SR.Argument_EncodingNotSupported, name), nameof(name)); + Environment.GetResourceString("Argument_EncodingNotSupported"), name), nameof(name)); } // Return a list of all EncodingInfo objects describing all of our encodings @@ -117,7 +117,7 @@ namespace System.Globalization for (i = 0; i < lastCodePageItem; i++) { arrayEncodingInfo[i] = new EncodingInfo(codePageDataPtr[i].codePage, CodePageDataItem.CreateString(codePageDataPtr[i].Names, 0), - SR.GetResourceString("Globalization_cp_" + codePageDataPtr[i].codePage)); + Environment.GetResourceString("Globalization.cp_" + codePageDataPtr[i].codePage)); } return arrayEncodingInfo; diff --git a/src/mscorlib/src/System/Globalization/SortVersion.cs b/src/mscorlib/src/System/Globalization/SortVersion.cs index 9d6118e7ec..983179c149 100644 --- a/src/mscorlib/src/System/Globalization/SortVersion.cs +++ b/src/mscorlib/src/System/Globalization/SortVersion.cs @@ -98,4 +98,4 @@ namespace System.Globalization return !(left == right); } } -} +}
\ No newline at end of file diff --git a/src/mscorlib/src/System/Globalization/TimeSpanFormat.cs b/src/mscorlib/src/System/Globalization/TimeSpanFormat.cs index ca053eded3..8011c0b577 100644 --- a/src/mscorlib/src/System/Globalization/TimeSpanFormat.cs +++ b/src/mscorlib/src/System/Globalization/TimeSpanFormat.cs @@ -62,7 +62,7 @@ namespace System.Globalization return FormatStandard(value, false, format, pattern); } - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } return FormatCustomized(value, format, DateTimeFormatInfo.GetInstance(formatProvider)); @@ -191,19 +191,19 @@ namespace System.Globalization case 'h': tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); if (tokenLen > 2) - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); DateTimeFormat.FormatDigits(result, hours, tokenLen); break; case 'm': tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); if (tokenLen > 2) - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); DateTimeFormat.FormatDigits(result, minutes, tokenLen); break; case 's': tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); if (tokenLen > 2) - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); DateTimeFormat.FormatDigits(result, seconds, tokenLen); break; case 'f': @@ -212,7 +212,7 @@ namespace System.Globalization // tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); if (tokenLen > DateTimeFormat.MaxSecondsFractionDigits) - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); tmp = (long)fraction; tmp /= (long)Math.Pow(10, DateTimeFormat.MaxSecondsFractionDigits - tokenLen); @@ -224,7 +224,7 @@ namespace System.Globalization // tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); if (tokenLen > DateTimeFormat.MaxSecondsFractionDigits) - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); tmp = (long)fraction; tmp /= (long)Math.Pow(10, DateTimeFormat.MaxSecondsFractionDigits - tokenLen); @@ -253,7 +253,7 @@ namespace System.Globalization // tokenLen = DateTimeFormat.ParseRepeatPattern(format, i, ch); if (tokenLen > 8) - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); DateTimeFormat.FormatDigits(result, day, tokenLen, true); break; case '\'': @@ -278,7 +278,7 @@ namespace System.Globalization // This means that '%' is at the end of the format string or // "%%" appears in the format string. // - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } break; case '\\': @@ -296,11 +296,11 @@ namespace System.Globalization // // This means that '\' is at the end of the formatting string. // - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } break; default: - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } i += tokenLen; } diff --git a/src/mscorlib/src/System/Globalization/TimeSpanParse.cs b/src/mscorlib/src/System/Globalization/TimeSpanParse.cs index a29e6c2e29..0be4f2f28d 100644 --- a/src/mscorlib/src/System/Globalization/TimeSpanParse.cs +++ b/src/mscorlib/src/System/Globalization/TimeSpanParse.cs @@ -65,7 +65,7 @@ namespace System.Globalization internal static void ValidateStyles(TimeSpanStyles style, String parameterName) { if (style != TimeSpanStyles.None && style != TimeSpanStyles.AssumeNegative) - throw new ArgumentException(SR.Argument_InvalidTimeSpanStyles, parameterName); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidTimeSpanStyles"), parameterName); } internal const int unlimitedDigits = -1; @@ -544,20 +544,20 @@ namespace System.Globalization switch (m_failure) { case ParseFailureKind.ArgumentNull: - return new ArgumentNullException(m_failureArgumentName, SR.GetResourceString(m_failureMessageID)); + return new ArgumentNullException(m_failureArgumentName, Environment.GetResourceString(m_failureMessageID)); case ParseFailureKind.FormatWithParameter: - return new FormatException(SR.Format(SR.GetResourceString(m_failureMessageID), m_failureMessageFormatArgument)); + return new FormatException(Environment.GetResourceString(m_failureMessageID, m_failureMessageFormatArgument)); case ParseFailureKind.Format: - return new FormatException(SR.GetResourceString(m_failureMessageID)); + return new FormatException(Environment.GetResourceString(m_failureMessageID)); case ParseFailureKind.Overflow: - return new OverflowException(SR.GetResourceString(m_failureMessageID)); + return new OverflowException(Environment.GetResourceString(m_failureMessageID)); default: Debug.Assert(false, "Unknown TimeSpanParseFailure: " + m_failure); - return new FormatException(SR.Format_InvalidString); + return new FormatException(Environment.GetResourceString("Format_InvalidString")); } } } diff --git a/src/mscorlib/src/System/Guid.cs b/src/mscorlib/src/System/Guid.cs index c7e6220f8b..0d4024b212 100644 --- a/src/mscorlib/src/System/Guid.cs +++ b/src/mscorlib/src/System/Guid.cs @@ -50,7 +50,7 @@ namespace System if (b == null) throw new ArgumentNullException(nameof(b)); if (b.Length != 16) - throw new ArgumentException(SR.Format(SR.Arg_GuidArrayCtor, "16"), nameof(b)); + throw new ArgumentException(Environment.GetResourceString("Arg_GuidArrayCtor", "16"), nameof(b)); Contract.EndContractBlock(); _a = ((int)b[3] << 24) | ((int)b[2] << 16) | ((int)b[1] << 8) | b[0]; @@ -91,7 +91,7 @@ namespace System throw new ArgumentNullException(nameof(d)); // Check that array is not too big if (d.Length != 8) - throw new ArgumentException(SR.Format(SR.Arg_GuidArrayCtor, "8"), nameof(d)); + throw new ArgumentException(Environment.GetResourceString("Arg_GuidArrayCtor", "8"), nameof(d)); Contract.EndContractBlock(); _a = a; @@ -212,23 +212,23 @@ namespace System switch (m_failure) { case ParseFailureKind.ArgumentNull: - return new ArgumentNullException(m_failureArgumentName, SR.GetResourceString(m_failureMessageID)); + return new ArgumentNullException(m_failureArgumentName, Environment.GetResourceString(m_failureMessageID)); case ParseFailureKind.FormatWithInnerException: - return new FormatException(SR.GetResourceString(m_failureMessageID), m_innerException); + return new FormatException(Environment.GetResourceString(m_failureMessageID), m_innerException); case ParseFailureKind.FormatWithParameter: - return new FormatException(SR.Format(SR.GetResourceString(m_failureMessageID), m_failureMessageFormatArgument)); + return new FormatException(Environment.GetResourceString(m_failureMessageID, m_failureMessageFormatArgument)); case ParseFailureKind.Format: - return new FormatException(SR.GetResourceString(m_failureMessageID)); + return new FormatException(Environment.GetResourceString(m_failureMessageID)); case ParseFailureKind.NativeException: return m_innerException; default: Debug.Assert(false, "Unknown GuidParseFailure: " + m_failure); - return new FormatException(SR.Format_GuidUnrecognized); + return new FormatException(Environment.GetResourceString("Format_GuidUnrecognized")); } } } @@ -310,7 +310,7 @@ namespace System if (format.Length != 1) { // all acceptable format strings are of length 1 - throw new FormatException(SR.Format_InvalidGuidFormatSpecification); + throw new FormatException(Environment.GetResourceString("Format_InvalidGuidFormatSpecification")); } GuidStyles style; @@ -337,7 +337,7 @@ namespace System } else { - throw new FormatException(SR.Format_InvalidGuidFormatSpecification); + throw new FormatException(Environment.GetResourceString("Format_InvalidGuidFormatSpecification")); } GuidResult result = new GuidResult(); @@ -883,7 +883,7 @@ namespace System } else if (parseResult.throwStyle == GuidParseThrowStyle.AllButOverflow) { - throw new FormatException(SR.Format_GuidUnrecognized, ex); + throw new FormatException(Environment.GetResourceString("Format_GuidUnrecognized"), ex); } else { @@ -935,7 +935,7 @@ namespace System } else if (parseResult.throwStyle == GuidParseThrowStyle.AllButOverflow) { - throw new FormatException(SR.Format_GuidUnrecognized, ex); + throw new FormatException(Environment.GetResourceString("Format_GuidUnrecognized"), ex); } else { @@ -1110,7 +1110,7 @@ namespace System } if (!(value is Guid)) { - throw new ArgumentException(SR.Arg_MustBeGuid, nameof(value)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeGuid"), nameof(value)); } Guid g = (Guid)value; @@ -1331,7 +1331,7 @@ namespace System if (format.Length != 1) { // all acceptable format strings are of length 1 - throw new FormatException(SR.Format_InvalidGuidFormatSpecification); + throw new FormatException(Environment.GetResourceString("Format_InvalidGuidFormatSpecification")); } char formatCh = format[0]; @@ -1384,7 +1384,7 @@ namespace System } else { - throw new FormatException(SR.Format_InvalidGuidFormatSpecification); + throw new FormatException(Environment.GetResourceString("Format_InvalidGuidFormatSpecification")); } unsafe diff --git a/src/mscorlib/src/System/IO/BinaryReader.cs b/src/mscorlib/src/System/IO/BinaryReader.cs index cebba6ea98..2f81b0072c 100644 --- a/src/mscorlib/src/System/IO/BinaryReader.cs +++ b/src/mscorlib/src/System/IO/BinaryReader.cs @@ -60,7 +60,7 @@ namespace System.IO throw new ArgumentNullException(nameof(encoding)); } if (!input.CanRead) - throw new ArgumentException(SR.Argument_StreamNotReadable); + throw new ArgumentException(Environment.GetResourceString("Argument_StreamNotReadable")); Contract.EndContractBlock(); m_stream = input; m_decoder = encoding.GetDecoder(); @@ -264,7 +264,7 @@ namespace System.IO catch (ArgumentException e) { // ReadDecimal cannot leak out ArgumentException - throw new IOException(SR.Arg_DecBitCtor, e); + throw new IOException(Environment.GetResourceString("Arg_DecBitCtor"), e); } } @@ -285,7 +285,7 @@ namespace System.IO stringLength = Read7BitEncodedInt(); if (stringLength < 0) { - throw new IOException(SR.Format(SR.IO_InvalidStringLen_Len, stringLength)); + throw new IOException(Environment.GetResourceString("IO.IO_InvalidStringLen_Len", stringLength)); } if (stringLength == 0) @@ -332,19 +332,19 @@ namespace System.IO { if (buffer == null) { - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); } if (index < 0) { - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (count < 0) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (buffer.Length - index < count) { - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); } Contract.Ensures(Contract.Result<int>() >= 0); Contract.Ensures(Contract.Result<int>() <= count); @@ -524,7 +524,7 @@ namespace System.IO { if (count < 0) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } Contract.Ensures(Contract.Result<char[]>() != null); Contract.Ensures(Contract.Result<char[]>().Length <= count); @@ -555,13 +555,13 @@ namespace System.IO public virtual int Read(byte[] buffer, int index, int count) { if (buffer == null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0) - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.Ensures(Contract.Result<int>() >= 0); Contract.Ensures(Contract.Result<int>() <= count); Contract.EndContractBlock(); @@ -572,7 +572,7 @@ namespace System.IO public virtual byte[] ReadBytes(int count) { - if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.Ensures(Contract.Result<byte[]>() != null); Contract.Ensures(Contract.Result<byte[]>().Length <= Contract.OldValue(count)); Contract.EndContractBlock(); @@ -610,7 +610,7 @@ namespace System.IO { if (m_buffer != null && (numBytes < 0 || numBytes > m_buffer.Length)) { - throw new ArgumentOutOfRangeException(nameof(numBytes), SR.ArgumentOutOfRange_BinaryReaderFillBuffer); + throw new ArgumentOutOfRangeException(nameof(numBytes), Environment.GetResourceString("ArgumentOutOfRange_BinaryReaderFillBuffer")); } int bytesRead = 0; int n = 0; @@ -652,7 +652,7 @@ namespace System.IO // Check for a corrupted stream. Read a max of 5 bytes. // In a future version, add a DataFormatException. if (shift == 5 * 7) // 5 bytes max per Int32, shift += 7 - throw new FormatException(SR.Format_Bad7BitInt32); + throw new FormatException(Environment.GetResourceString("Format_Bad7BitInt32")); // ReadByte handles end of stream cases for us. b = ReadByte(); diff --git a/src/mscorlib/src/System/IO/BinaryWriter.cs b/src/mscorlib/src/System/IO/BinaryWriter.cs index 3d9839f46e..ffa5f6edaf 100644 --- a/src/mscorlib/src/System/IO/BinaryWriter.cs +++ b/src/mscorlib/src/System/IO/BinaryWriter.cs @@ -71,7 +71,7 @@ namespace System.IO if (encoding == null) throw new ArgumentNullException(nameof(encoding)); if (!output.CanWrite) - throw new ArgumentException(SR.Argument_StreamNotWritable); + throw new ArgumentException(Environment.GetResourceString("Argument_StreamNotWritable")); Contract.EndContractBlock(); OutStream = output; @@ -188,7 +188,7 @@ namespace System.IO public unsafe virtual void Write(char ch) { if (Char.IsSurrogate(ch)) - throw new ArgumentException(SR.Arg_SurrogatesNotAllowedAsSingleChar); + throw new ArgumentException(Environment.GetResourceString("Arg_SurrogatesNotAllowedAsSingleChar")); Contract.EndContractBlock(); Debug.Assert(_encoding.GetMaxByteCount(1) <= 16, "_encoding.GetMaxByteCount(1) <= 16)"); diff --git a/src/mscorlib/src/System/IO/Directory.cs b/src/mscorlib/src/System/IO/Directory.cs index c472cdf374..c8c0142363 100644 --- a/src/mscorlib/src/System/IO/Directory.cs +++ b/src/mscorlib/src/System/IO/Directory.cs @@ -55,7 +55,7 @@ namespace System.IO if (searchPattern == null) throw new ArgumentNullException(nameof(searchPattern)); if ((searchOption != SearchOption.TopDirectoryOnly) && (searchOption != SearchOption.AllDirectories)) - throw new ArgumentOutOfRangeException(nameof(searchOption), SR.ArgumentOutOfRange_Enum); + throw new ArgumentOutOfRangeException(nameof(searchOption), Environment.GetResourceString("ArgumentOutOfRange_Enum")); Contract.Ensures(Contract.Result<IEnumerable<String>>() != null); Contract.EndContractBlock(); @@ -135,9 +135,9 @@ namespace System.IO if (path == null) throw new ArgumentNullException(nameof(path)); if (path.Length == 0) - throw new ArgumentException(SR.Argument_PathEmpty); + throw new ArgumentException(Environment.GetResourceString("Argument_PathEmpty")); if (path.Length >= Path.MaxPath) - throw new PathTooLongException(SR.IO_PathTooLong); + throw new PathTooLongException(Environment.GetResourceString("IO.PathTooLong")); String fulldestDirName = Path.GetFullPath(path); diff --git a/src/mscorlib/src/System/IO/DirectoryNotFoundException.cs b/src/mscorlib/src/System/IO/DirectoryNotFoundException.cs index 1cc6cc4e58..31b1eba6d5 100644 --- a/src/mscorlib/src/System/IO/DirectoryNotFoundException.cs +++ b/src/mscorlib/src/System/IO/DirectoryNotFoundException.cs @@ -28,7 +28,7 @@ namespace System.IO public class DirectoryNotFoundException : IOException { public DirectoryNotFoundException() - : base(SR.Arg_DirectoryNotFoundException) + : base(Environment.GetResourceString("Arg_DirectoryNotFoundException")) { SetErrorCode(__HResults.COR_E_DIRECTORYNOTFOUND); } diff --git a/src/mscorlib/src/System/IO/DriveNotFoundException.cs b/src/mscorlib/src/System/IO/DriveNotFoundException.cs index c48d7ac359..6c5bb765b2 100644 --- a/src/mscorlib/src/System/IO/DriveNotFoundException.cs +++ b/src/mscorlib/src/System/IO/DriveNotFoundException.cs @@ -21,7 +21,7 @@ namespace System.IO internal class DriveNotFoundException : IOException { public DriveNotFoundException() - : base(SR.Arg_DriveNotFoundException) + : base(Environment.GetResourceString("Arg_DriveNotFoundException")) { SetErrorCode(__HResults.COR_E_DIRECTORYNOTFOUND); } diff --git a/src/mscorlib/src/System/IO/EndOfStreamException.cs b/src/mscorlib/src/System/IO/EndOfStreamException.cs index 1eb1664e7f..3b73dff7fb 100644 --- a/src/mscorlib/src/System/IO/EndOfStreamException.cs +++ b/src/mscorlib/src/System/IO/EndOfStreamException.cs @@ -22,7 +22,7 @@ namespace System.IO public class EndOfStreamException : IOException { public EndOfStreamException() - : base(SR.Arg_EndOfStreamException) + : base(Environment.GetResourceString("Arg_EndOfStreamException")) { SetErrorCode(__HResults.COR_E_ENDOFSTREAM); } diff --git a/src/mscorlib/src/System/IO/File.cs b/src/mscorlib/src/System/IO/File.cs index 4aba1488ec..5c6b5fcf01 100644 --- a/src/mscorlib/src/System/IO/File.cs +++ b/src/mscorlib/src/System/IO/File.cs @@ -93,7 +93,7 @@ namespace System.IO int index = 0; long fileLength = fs.Length; if (fileLength > Int32.MaxValue) - throw new IOException(SR.IO_FileTooLong2GB); + throw new IOException(Environment.GetResourceString("IO.IO_FileTooLong2GB")); int count = (int)fileLength; bytes = new byte[count]; while (count > 0) @@ -114,7 +114,7 @@ namespace System.IO if (path == null) throw new ArgumentNullException(nameof(path)); if (path.Length == 0) - throw new ArgumentException(SR.Argument_EmptyPath); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyPath")); Contract.EndContractBlock(); return InternalReadAllLines(path, Encoding.UTF8); diff --git a/src/mscorlib/src/System/IO/FileLoadException.cs b/src/mscorlib/src/System/IO/FileLoadException.cs index 6c5b26871b..e55fdbb118 100644 --- a/src/mscorlib/src/System/IO/FileLoadException.cs +++ b/src/mscorlib/src/System/IO/FileLoadException.cs @@ -32,7 +32,7 @@ namespace System.IO private String _fusionLog; // fusion log (when applicable) public FileLoadException() - : base(SR.IO_FileLoad) + : base(Environment.GetResourceString("IO.FileLoad")) { SetErrorCode(__HResults.COR_E_FILELOAD); } @@ -87,7 +87,7 @@ namespace System.IO String s = GetType().FullName + ": " + Message; if (_fileName != null && _fileName.Length != 0) - s += Environment.NewLine + SR.Format(SR.IO_FileName_Name, _fileName); + s += Environment.NewLine + Environment.GetResourceString("IO.FileName_Name", _fileName); if (InnerException != null) s = s + " ---> " + InnerException.ToString(); diff --git a/src/mscorlib/src/System/IO/FileNotFoundException.cs b/src/mscorlib/src/System/IO/FileNotFoundException.cs index 987aaa9150..e25667e302 100644 --- a/src/mscorlib/src/System/IO/FileNotFoundException.cs +++ b/src/mscorlib/src/System/IO/FileNotFoundException.cs @@ -29,7 +29,7 @@ namespace System.IO private String _fusionLog; // fusion log (when applicable) public FileNotFoundException() - : base(SR.IO_FileNotFound) + : base(Environment.GetResourceString("IO.FileNotFound")) { SetErrorCode(__HResults.COR_E_FILENOTFOUND); } @@ -74,7 +74,7 @@ namespace System.IO { if ((_fileName == null) && (HResult == System.__HResults.COR_E_EXCEPTION)) - _message = SR.IO_FileNotFound; + _message = Environment.GetResourceString("IO.FileNotFound"); else if (_fileName != null) _message = FileLoadException.FormatFileLoadExceptionMessage(_fileName, HResult); @@ -91,7 +91,7 @@ namespace System.IO String s = GetType().FullName + ": " + Message; if (_fileName != null && _fileName.Length != 0) - s += Environment.NewLine + SR.Format(SR.IO_FileName_Name, _fileName); + s += Environment.NewLine + Environment.GetResourceString("IO.FileName_Name", _fileName); if (InnerException != null) s = s + " ---> " + InnerException.ToString(); diff --git a/src/mscorlib/src/System/IO/IOException.cs b/src/mscorlib/src/System/IO/IOException.cs index a91d891d8f..c2603e6fab 100644 --- a/src/mscorlib/src/System/IO/IOException.cs +++ b/src/mscorlib/src/System/IO/IOException.cs @@ -33,7 +33,7 @@ namespace System.IO private String _maybeFullPath; // For debuggers on partial trust code public IOException() - : base(SR.Arg_IOException) + : base(Environment.GetResourceString("Arg_IOException")) { SetErrorCode(__HResults.COR_E_IO); } diff --git a/src/mscorlib/src/System/IO/MemoryStream.cs b/src/mscorlib/src/System/IO/MemoryStream.cs index 80b3af0aee..920157723e 100644 --- a/src/mscorlib/src/System/IO/MemoryStream.cs +++ b/src/mscorlib/src/System/IO/MemoryStream.cs @@ -64,7 +64,7 @@ namespace System.IO { if (capacity < 0) { - throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_NegativeCapacity); + throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_NegativeCapacity")); } Contract.EndContractBlock(); @@ -84,7 +84,7 @@ namespace System.IO public MemoryStream(byte[] buffer, bool writable) { - if (buffer == null) throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + if (buffer == null) throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); Contract.EndContractBlock(); _buffer = buffer; _length = _capacity = buffer.Length; @@ -107,13 +107,13 @@ namespace System.IO public MemoryStream(byte[] buffer, int index, int count, bool writable, bool publiclyVisible) { if (buffer == null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0) - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); _buffer = buffer; @@ -173,7 +173,7 @@ namespace System.IO { // Check for overflow if (value < 0) - throw new IOException(SR.IO_StreamTooLong); + throw new IOException(Environment.GetResourceString("IO.IO_StreamTooLong")); if (value > _capacity) { int newCapacity = value; @@ -218,7 +218,7 @@ namespace System.IO public virtual byte[] GetBuffer() { if (!_exposable) - throw new UnauthorizedAccessException(SR.UnauthorizedAccess_MemStreamBuffer); + throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_MemStreamBuffer")); return _buffer; } @@ -302,7 +302,7 @@ namespace System.IO { // Only update the capacity if the MS is expandable and the value is different than the current capacity. // Special behavior if the MS isn't expandable: we don't throw if value is the same as the current capacity - if (value < Length) throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_SmallCapacity); + if (value < Length) throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity")); Contract.Ensures(_capacity - _origin == value); Contract.EndContractBlock(); @@ -346,14 +346,14 @@ namespace System.IO set { if (value < 0) - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.Ensures(Position == value); Contract.EndContractBlock(); if (!_isOpen) __Error.StreamIsClosed(); if (value > MemStreamMaxLength) - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_StreamLength); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_StreamLength")); _position = _origin + (int)value; } } @@ -361,13 +361,13 @@ namespace System.IO public override int Read([In, Out] byte[] buffer, int offset, int count) { if (buffer == null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - offset < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); if (!_isOpen) __Error.StreamIsClosed(); @@ -395,13 +395,13 @@ namespace System.IO public override Task<int> ReadAsync(Byte[] buffer, int offset, int count, CancellationToken cancellationToken) { if (buffer == null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - offset < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); // contract validation copied from Read(...) // If cancellation was requested, bail early @@ -513,14 +513,14 @@ namespace System.IO if (!_isOpen) __Error.StreamIsClosed(); if (offset > MemStreamMaxLength) - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_StreamLength); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_StreamLength")); switch (loc) { case SeekOrigin.Begin: { int tempPosition = unchecked(_origin + (int)offset); if (offset < 0 || tempPosition < _origin) - throw new IOException(SR.IO_SeekBeforeBegin); + throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin")); _position = tempPosition; break; } @@ -528,7 +528,7 @@ namespace System.IO { int tempPosition = unchecked(_position + (int)offset); if (unchecked(_position + offset) < _origin || tempPosition < _origin) - throw new IOException(SR.IO_SeekBeforeBegin); + throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin")); _position = tempPosition; break; } @@ -536,12 +536,12 @@ namespace System.IO { int tempPosition = unchecked(_length + (int)offset); if (unchecked(_length + offset) < _origin || tempPosition < _origin) - throw new IOException(SR.IO_SeekBeforeBegin); + throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin")); _position = tempPosition; break; } default: - throw new ArgumentException(SR.Argument_InvalidSeekOrigin); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidSeekOrigin")); } Debug.Assert(_position >= 0, "_position >= 0"); @@ -562,7 +562,7 @@ namespace System.IO { if (value < 0 || value > Int32.MaxValue) { - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_StreamLength); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_StreamLength")); } Contract.Ensures(_length - _origin == value); Contract.EndContractBlock(); @@ -572,7 +572,7 @@ namespace System.IO Debug.Assert(MemStreamMaxLength == Int32.MaxValue); // Check parameter validation logic in this method if this fails. if (value > (Int32.MaxValue - _origin)) { - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_StreamLength); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_StreamLength")); } int newLength = _origin + (int)value; @@ -594,13 +594,13 @@ namespace System.IO public override void Write(byte[] buffer, int offset, int count) { if (buffer == null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - offset < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); if (!_isOpen) __Error.StreamIsClosed(); @@ -609,7 +609,7 @@ namespace System.IO int i = _position + count; // Check for overflow if (i < 0) - throw new IOException(SR.IO_StreamTooLong); + throw new IOException(Environment.GetResourceString("IO.IO_StreamTooLong")); if (i > _length) { @@ -638,13 +638,13 @@ namespace System.IO public override Task WriteAsync(Byte[] buffer, int offset, int count, CancellationToken cancellationToken) { if (buffer == null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - offset < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); // contract validation copied from Write(...) // If cancellation is already requested, bail early @@ -692,7 +692,7 @@ namespace System.IO public virtual void WriteTo(Stream stream) { if (stream == null) - throw new ArgumentNullException(nameof(stream), SR.ArgumentNull_Stream); + throw new ArgumentNullException(nameof(stream), Environment.GetResourceString("ArgumentNull_Stream")); Contract.EndContractBlock(); if (!_isOpen) __Error.StreamIsClosed(); diff --git a/src/mscorlib/src/System/IO/PathTooLongException.cs b/src/mscorlib/src/System/IO/PathTooLongException.cs index a0f176c182..07ecb38db4 100644 --- a/src/mscorlib/src/System/IO/PathTooLongException.cs +++ b/src/mscorlib/src/System/IO/PathTooLongException.cs @@ -23,7 +23,7 @@ namespace System.IO public class PathTooLongException : IOException { public PathTooLongException() - : base(SR.IO_PathTooLong) + : base(Environment.GetResourceString("IO.PathTooLong")) { SetErrorCode(__HResults.COR_E_PATHTOOLONG); } diff --git a/src/mscorlib/src/System/IO/Stream.cs b/src/mscorlib/src/System/IO/Stream.cs index 92fe374f19..585f5999a3 100644 --- a/src/mscorlib/src/System/IO/Stream.cs +++ b/src/mscorlib/src/System/IO/Stream.cs @@ -98,11 +98,11 @@ namespace System.IO get { Contract.Ensures(Contract.Result<int>() >= 0); - throw new InvalidOperationException(SR.InvalidOperation_TimeoutsNotSupported); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TimeoutsNotSupported")); } set { - throw new InvalidOperationException(SR.InvalidOperation_TimeoutsNotSupported); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TimeoutsNotSupported")); } } @@ -111,11 +111,11 @@ namespace System.IO get { Contract.Ensures(Contract.Result<int>() >= 0); - throw new InvalidOperationException(SR.InvalidOperation_TimeoutsNotSupported); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TimeoutsNotSupported")); } set { - throw new InvalidOperationException(SR.InvalidOperation_TimeoutsNotSupported); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TimeoutsNotSupported")); } } @@ -382,15 +382,15 @@ namespace System.IO if (readTask == null) { - throw new ArgumentException(SR.InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple); + throw new ArgumentException(Environment.GetResourceString("InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple")); } else if (readTask != asyncResult) { - throw new InvalidOperationException(SR.InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple")); } else if (!readTask._isRead) { - throw new ArgumentException(SR.InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple); + throw new ArgumentException(Environment.GetResourceString("InvalidOperation_WrongAsyncResultOrEndReadCalledMultiple")); } try @@ -566,15 +566,15 @@ namespace System.IO var writeTask = _activeReadWriteTask; if (writeTask == null) { - throw new ArgumentException(SR.InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple); + throw new ArgumentException(Environment.GetResourceString("InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple")); } else if (writeTask != asyncResult) { - throw new InvalidOperationException(SR.InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple")); } else if (writeTask._isRead) { - throw new ArgumentException(SR.InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple); + throw new ArgumentException(Environment.GetResourceString("InvalidOperation_WrongAsyncResultOrEndWriteCalledMultiple")); } try diff --git a/src/mscorlib/src/System/IO/StreamHelpers.CopyValidation.cs b/src/mscorlib/src/System/IO/StreamHelpers.CopyValidation.cs index 45bbd816df..8ff0e045ca 100644 --- a/src/mscorlib/src/System/IO/StreamHelpers.CopyValidation.cs +++ b/src/mscorlib/src/System/IO/StreamHelpers.CopyValidation.cs @@ -17,29 +17,29 @@ namespace System.IO if (bufferSize <= 0) { - throw new ArgumentOutOfRangeException(nameof(bufferSize), bufferSize, SR.ArgumentOutOfRange_NeedPosNum); + throw new ArgumentOutOfRangeException(nameof(bufferSize), bufferSize, Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum")); } bool sourceCanRead = source.CanRead; if (!sourceCanRead && !source.CanWrite) { - throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_StreamClosed")); } bool destinationCanWrite = destination.CanWrite; if (!destinationCanWrite && !destination.CanRead) { - throw new ObjectDisposedException(nameof(destination), SR.ObjectDisposed_StreamClosed); + throw new ObjectDisposedException(nameof(destination), Environment.GetResourceString("ObjectDisposed_StreamClosed")); } if (!sourceCanRead) { - throw new NotSupportedException(SR.NotSupported_UnreadableStream); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnreadableStream")); } if (!destinationCanWrite) { - throw new NotSupportedException(SR.NotSupported_UnwritableStream); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnwritableStream")); } } } diff --git a/src/mscorlib/src/System/IO/StreamReader.cs b/src/mscorlib/src/System/IO/StreamReader.cs index eedf6e7289..c86e974307 100644 --- a/src/mscorlib/src/System/IO/StreamReader.cs +++ b/src/mscorlib/src/System/IO/StreamReader.cs @@ -103,7 +103,7 @@ namespace System.IO Task t = _asyncReadTask; if (t != null && !t.IsCompleted) - throw new InvalidOperationException(SR.InvalidOperation_AsyncIOInProgress); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_AsyncIOInProgress")); } // StreamReader by default will ignore illegal UTF8 characters. We don't want to @@ -149,9 +149,9 @@ namespace System.IO if (stream == null || encoding == null) throw new ArgumentNullException((stream == null ? nameof(stream) : nameof(encoding))); if (!stream.CanRead) - throw new ArgumentException(SR.Argument_StreamNotReadable); + throw new ArgumentException(Environment.GetResourceString("Argument_StreamNotReadable")); if (bufferSize <= 0) - throw new ArgumentOutOfRangeException(nameof(bufferSize), SR.ArgumentOutOfRange_NeedPosNum); + throw new ArgumentOutOfRangeException(nameof(bufferSize), Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum")); Contract.EndContractBlock(); Init(stream, encoding, detectEncodingFromByteOrderMarks, bufferSize, leaveOpen); @@ -181,9 +181,9 @@ namespace System.IO if (path==null || encoding==null) throw new ArgumentNullException((path==null ? nameof(path) : nameof(encoding))); if (path.Length==0) - throw new ArgumentException(SR.Argument_EmptyPath); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyPath")); if (bufferSize <= 0) - throw new ArgumentOutOfRangeException(nameof(bufferSize), SR.ArgumentOutOfRange_NeedPosNum); + throw new ArgumentOutOfRangeException(nameof(bufferSize), Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum")); Contract.EndContractBlock(); Stream stream = new FileStream(path, FileMode.Open, FileAccess.Read, FileShare.Read, DefaultFileStreamBufferSize, FileOptions.SequentialScan); @@ -338,11 +338,11 @@ namespace System.IO public override int Read([In, Out] char[] buffer, int index, int count) { if (buffer==null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0 || count < 0) - throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); if (stream == null) @@ -396,11 +396,11 @@ namespace System.IO public override int ReadBlock([In, Out] char[] buffer, int index, int count) { if (buffer==null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0 || count < 0) - throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); if (stream == null) @@ -872,11 +872,11 @@ namespace System.IO public override Task<int> ReadAsync(char[] buffer, int index, int count) { if (buffer==null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0 || count < 0) - throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); // If we have been inherited into a subclass, the following implementation could be incorrect @@ -1058,11 +1058,11 @@ namespace System.IO public override Task<int> ReadBlockAsync(char[] buffer, int index, int count) { if (buffer==null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0 || count < 0) - throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); // If we have been inherited into a subclass, the following implementation could be incorrect diff --git a/src/mscorlib/src/System/IO/TextReader.cs b/src/mscorlib/src/System/IO/TextReader.cs index 3da68591b0..15ba8fba7d 100644 --- a/src/mscorlib/src/System/IO/TextReader.cs +++ b/src/mscorlib/src/System/IO/TextReader.cs @@ -93,13 +93,13 @@ namespace System.IO { public virtual int Read([In, Out] char[] buffer, int index, int count) { if (buffer==null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0) - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.Ensures(Contract.Result<int>() >= 0); Contract.Ensures(Contract.Result<int>() <= Contract.OldValue(count)); Contract.EndContractBlock(); @@ -192,11 +192,11 @@ namespace System.IO { public virtual Task<int> ReadAsync(char[] buffer, int index, int count) { if (buffer==null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0 || count < 0) - throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); return ReadAsyncInternal(buffer, index, count); @@ -221,11 +221,11 @@ namespace System.IO { public virtual Task<int> ReadBlockAsync(char[] buffer, int index, int count) { if (buffer==null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0 || count < 0) - throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); @@ -362,11 +362,11 @@ namespace System.IO { public override Task<int> ReadBlockAsync(char[] buffer, int index, int count) { if (buffer==null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0 || count < 0) - throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); @@ -377,11 +377,11 @@ namespace System.IO { public override Task<int> ReadAsync(char[] buffer, int index, int count) { if (buffer==null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0 || count < 0) - throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); return Task.FromResult(Read(buffer, index, count)); diff --git a/src/mscorlib/src/System/IO/UnmanagedMemoryAccessor.cs b/src/mscorlib/src/System/IO/UnmanagedMemoryAccessor.cs index 5f6f588cbe..731df60bba 100644 --- a/src/mscorlib/src/System/IO/UnmanagedMemoryAccessor.cs +++ b/src/mscorlib/src/System/IO/UnmanagedMemoryAccessor.cs @@ -65,15 +65,15 @@ namespace System.IO } if (offset < 0) { - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (capacity < 0) { - throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (buffer.ByteLength < (UInt64)(offset + capacity)) { - throw new ArgumentException(SR.Argument_OffsetAndCapacityOutOfBounds); + throw new ArgumentException(Environment.GetResourceString("Argument_OffsetAndCapacityOutOfBounds")); } if (access < FileAccess.Read || access > FileAccess.ReadWrite) { @@ -83,7 +83,7 @@ namespace System.IO if (_isOpen) { - throw new InvalidOperationException(SR.InvalidOperation_CalledTwice); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CalledTwice")); } unsafe @@ -95,7 +95,7 @@ namespace System.IO buffer.AcquirePointer(ref pointer); if (((byte*)((Int64)pointer + offset + capacity)) < pointer) { - throw new ArgumentException(SR.Argument_UnmanagedMemAccessorWrapAround); + throw new ArgumentException(Environment.GetResourceString("Argument_UnmanagedMemAccessorWrapAround")); } } finally @@ -314,7 +314,7 @@ namespace System.IO // Check for invalid Decimal values if (!((flags & ~(SignMask | ScaleMask)) == 0 && (flags & ScaleMask) <= (28 << 16))) { - throw new ArgumentException(SR.Arg_BadDecimal); // Throw same Exception type as Decimal(int[]) ctor for compat + throw new ArgumentException(Environment.GetResourceString("Arg_BadDecimal")); // Throw same Exception type as Decimal(int[]) ctor for compat } bool isNegative = (flags & SignMask) != 0; @@ -502,17 +502,17 @@ namespace System.IO { if (position < 0) { - throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } Contract.EndContractBlock(); if (!_isOpen) { - throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed); + throw new ObjectDisposedException("UnmanagedMemoryAccessor", Environment.GetResourceString("ObjectDisposed_ViewAccessorClosed")); } if (!CanRead) { - throw new NotSupportedException(SR.NotSupported_Reading); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_Reading")); } UInt32 sizeOfT = Marshal.SizeOfType(typeof(T)); @@ -520,11 +520,11 @@ namespace System.IO { if (position >= _capacity) { - throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_PositionLessThanCapacityRequired); + throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_PositionLessThanCapacityRequired")); } else { - throw new ArgumentException(SR.Format(SR.Argument_NotEnoughBytesToRead, typeof (T).FullName), nameof(position)); + throw new ArgumentException(Environment.GetResourceString("Argument_NotEnoughBytesToRead", typeof(T).FullName), nameof(position)); } } @@ -545,31 +545,31 @@ namespace System.IO } if (offset < 0) { - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (count < 0) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (array.Length - offset < count) { - throw new ArgumentException(SR.Argument_OffsetAndLengthOutOfBounds); + throw new ArgumentException(Environment.GetResourceString("Argument_OffsetAndLengthOutOfBounds")); } Contract.EndContractBlock(); if (!CanRead) { if (!_isOpen) { - throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed); + throw new ObjectDisposedException("UnmanagedMemoryAccessor", Environment.GetResourceString("ObjectDisposed_ViewAccessorClosed")); } else { - throw new NotSupportedException(SR.NotSupported_Reading); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_Reading")); } } if (position < 0) { - throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } UInt32 sizeOfT = Marshal.AlignedSizeOf<T>(); @@ -577,7 +577,7 @@ namespace System.IO // only check position and ask for fewer Ts if count is too big if (position >= _capacity) { - throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_PositionLessThanCapacityRequired); + throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_PositionLessThanCapacityRequired")); } int n = count; @@ -903,17 +903,17 @@ namespace System.IO { if (position < 0) { - throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } Contract.EndContractBlock(); if (!_isOpen) { - throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed); + throw new ObjectDisposedException("UnmanagedMemoryAccessor", Environment.GetResourceString("ObjectDisposed_ViewAccessorClosed")); } if (!CanWrite) { - throw new NotSupportedException(SR.NotSupported_Writing); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_Writing")); } UInt32 sizeOfT = Marshal.SizeOfType(typeof(T)); @@ -921,11 +921,11 @@ namespace System.IO { if (position >= _capacity) { - throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_PositionLessThanCapacityRequired); + throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_PositionLessThanCapacityRequired")); } else { - throw new ArgumentException(SR.Format(SR.Argument_NotEnoughBytesToWrite, typeof (T).FullName), nameof(position)); + throw new ArgumentException(Environment.GetResourceString("Argument_NotEnoughBytesToWrite", typeof(T).FullName), nameof(position)); } } @@ -943,33 +943,33 @@ namespace System.IO } if (offset < 0) { - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (count < 0) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (array.Length - offset < count) { - throw new ArgumentException(SR.Argument_OffsetAndLengthOutOfBounds); + throw new ArgumentException(Environment.GetResourceString("Argument_OffsetAndLengthOutOfBounds")); } if (position < 0) { - throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (position >= Capacity) { - throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_PositionLessThanCapacityRequired); + throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_PositionLessThanCapacityRequired")); } Contract.EndContractBlock(); if (!_isOpen) { - throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed); + throw new ObjectDisposedException("UnmanagedMemoryAccessor", Environment.GetResourceString("ObjectDisposed_ViewAccessorClosed")); } if (!CanWrite) { - throw new NotSupportedException(SR.NotSupported_Writing); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_Writing")); } _buffer.WriteArray<T>((UInt64)(_offset + position), array, offset, count); @@ -1031,26 +1031,26 @@ namespace System.IO { if (!_isOpen) { - throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed); + throw new ObjectDisposedException("UnmanagedMemoryAccessor", Environment.GetResourceString("ObjectDisposed_ViewAccessorClosed")); } if (!CanRead) { - throw new NotSupportedException(SR.NotSupported_Reading); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_Reading")); } if (position < 0) { - throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } Contract.EndContractBlock(); if (position > _capacity - sizeOfType) { if (position >= _capacity) { - throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_PositionLessThanCapacityRequired); + throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_PositionLessThanCapacityRequired")); } else { - throw new ArgumentException(SR.Argument_NotEnoughBytesToRead, nameof(position)); + throw new ArgumentException(Environment.GetResourceString("Argument_NotEnoughBytesToRead"), nameof(position)); } } } @@ -1059,26 +1059,26 @@ namespace System.IO { if (!_isOpen) { - throw new ObjectDisposedException("UnmanagedMemoryAccessor", SR.ObjectDisposed_ViewAccessorClosed); + throw new ObjectDisposedException("UnmanagedMemoryAccessor", Environment.GetResourceString("ObjectDisposed_ViewAccessorClosed")); } if (!CanWrite) { - throw new NotSupportedException(SR.NotSupported_Writing); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_Writing")); } if (position < 0) { - throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } Contract.EndContractBlock(); if (position > _capacity - sizeOfType) { if (position >= _capacity) { - throw new ArgumentOutOfRangeException(nameof(position), SR.ArgumentOutOfRange_PositionLessThanCapacityRequired); + throw new ArgumentOutOfRangeException(nameof(position), Environment.GetResourceString("ArgumentOutOfRange_PositionLessThanCapacityRequired")); } else { - throw new ArgumentException(SR.Format(SR.Argument_NotEnoughBytesToWrite, nameof(Byte)), nameof(position)); + throw new ArgumentException(Environment.GetResourceString("Argument_NotEnoughBytesToWrite", nameof(Byte)), nameof(position)); } } } diff --git a/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs b/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs index f21fe47371..086c19bafa 100644 --- a/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs +++ b/src/mscorlib/src/System/IO/UnmanagedMemoryStream.cs @@ -126,15 +126,15 @@ namespace System.IO } if (offset < 0) { - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (length < 0) { - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (buffer.ByteLength < (ulong)(offset + length)) { - throw new ArgumentException(SR.Argument_InvalidSafeBufferOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidSafeBufferOffLen")); } if (access < FileAccess.Read || access > FileAccess.ReadWrite) { @@ -144,7 +144,7 @@ namespace System.IO if (_isOpen) { - throw new InvalidOperationException(SR.InvalidOperation_CalledTwice); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CalledTwice")); } // check for wraparound @@ -157,7 +157,7 @@ namespace System.IO buffer.AcquirePointer(ref pointer); if ((pointer + offset + length) < pointer) { - throw new ArgumentException(SR.ArgumentOutOfRange_UnmanagedMemStreamWrapAround); + throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_UnmanagedMemStreamWrapAround")); } } finally @@ -195,17 +195,17 @@ namespace System.IO if (pointer == null) throw new ArgumentNullException(nameof(pointer)); if (length < 0 || capacity < 0) - throw new ArgumentOutOfRangeException((length < 0) ? nameof(length) : nameof(capacity), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException((length < 0) ? nameof(length) : nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (length > capacity) - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_LengthGreaterThanCapacity); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_LengthGreaterThanCapacity")); Contract.EndContractBlock(); // Check for wraparound. if (((byte*)((long)pointer + capacity)) < pointer) - throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_UnmanagedMemStreamWrapAround); + throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_UnmanagedMemStreamWrapAround")); if (access < FileAccess.Read || access > FileAccess.ReadWrite) - throw new ArgumentOutOfRangeException(nameof(access), SR.ArgumentOutOfRange_Enum); + throw new ArgumentOutOfRangeException(nameof(access), Environment.GetResourceString("ArgumentOutOfRange_Enum")); if (_isOpen) - throw new InvalidOperationException(SR.InvalidOperation_CalledTwice); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CalledTwice")); _mem = pointer; _offset = 0; @@ -295,7 +295,7 @@ namespace System.IO set { if (value < 0) - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); if (!CanSeek) __Error.StreamIsClosed(); @@ -303,7 +303,7 @@ namespace System.IO unsafe { // On 32 bit machines, ensure we don't wrap around. if (value > (long) Int32.MaxValue || _mem + value < _mem) - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_StreamLength); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_StreamLength")); } #endif Interlocked.Exchange(ref _position, value); @@ -317,13 +317,13 @@ namespace System.IO { if (_buffer != null) { - throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_UmsSafeBuffer")); } // Use a temp to avoid a race long pos = Interlocked.Read(ref _position); if (pos > _capacity) - throw new IndexOutOfRangeException(SR.IndexOutOfRange_UMSPosition); + throw new IndexOutOfRangeException(Environment.GetResourceString("IndexOutOfRange_UMSPosition")); byte* ptr = _mem + pos; if (!_isOpen) __Error.StreamIsClosed(); return ptr; @@ -331,15 +331,15 @@ namespace System.IO set { if (_buffer != null) - throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_UmsSafeBuffer")); if (!_isOpen) __Error.StreamIsClosed(); // Note: subtracting pointers returns an Int64. Working around // to avoid hitting compiler warning CS0652 on this line. if (new IntPtr(value - _mem).ToInt64() > UnmanagedMemStreamMaxLength) - throw new ArgumentOutOfRangeException("offset", SR.ArgumentOutOfRange_UnmanagedMemStreamLength); + throw new ArgumentOutOfRangeException("offset", Environment.GetResourceString("ArgumentOutOfRange_UnmanagedMemStreamLength")); if (value < _mem) - throw new IOException(SR.IO_SeekBeforeBegin); + throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin")); Interlocked.Exchange(ref _position, value - _mem); } @@ -350,7 +350,7 @@ namespace System.IO get { if (_buffer != null) - throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_UmsSafeBuffer")); return _mem; } @@ -359,13 +359,13 @@ namespace System.IO public override int Read([In, Out] byte[] buffer, int offset, int count) { if (buffer == null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - offset < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); // Keep this in sync with contract validation in ReadAsync if (!_isOpen) __Error.StreamIsClosed(); @@ -421,13 +421,13 @@ namespace System.IO public override Task<Int32> ReadAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) { if (buffer == null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - offset < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); // contract validation copied from Read(...) if (cancellationToken.IsCancellationRequested) @@ -491,31 +491,31 @@ namespace System.IO { if (!_isOpen) __Error.StreamIsClosed(); if (offset > UnmanagedMemStreamMaxLength) - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_UnmanagedMemStreamLength); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_UnmanagedMemStreamLength")); switch (loc) { case SeekOrigin.Begin: if (offset < 0) - throw new IOException(SR.IO_SeekBeforeBegin); + throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin")); Interlocked.Exchange(ref _position, offset); break; case SeekOrigin.Current: long pos = Interlocked.Read(ref _position); if (offset + pos < 0) - throw new IOException(SR.IO_SeekBeforeBegin); + throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin")); Interlocked.Exchange(ref _position, offset + pos); break; case SeekOrigin.End: long len = Interlocked.Read(ref _length); if (len + offset < 0) - throw new IOException(SR.IO_SeekBeforeBegin); + throw new IOException(Environment.GetResourceString("IO.IO_SeekBeforeBegin")); Interlocked.Exchange(ref _position, len + offset); break; default: - throw new ArgumentException(SR.Argument_InvalidSeekOrigin); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidSeekOrigin")); } long finalPos = Interlocked.Read(ref _position); @@ -526,15 +526,15 @@ namespace System.IO public override void SetLength(long value) { if (value < 0) - throw new ArgumentOutOfRangeException("length", SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException("length", Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); if (_buffer != null) - throw new NotSupportedException(SR.NotSupported_UmsSafeBuffer); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_UmsSafeBuffer")); if (!_isOpen) __Error.StreamIsClosed(); if (!CanWrite) __Error.WriteNotSupported(); if (value > _capacity) - throw new IOException(SR.IO_FixedCapacity); + throw new IOException(Environment.GetResourceString("IO.IO_FixedCapacity")); long pos = Interlocked.Read(ref _position); long len = Interlocked.Read(ref _length); @@ -555,13 +555,13 @@ namespace System.IO public override void Write(byte[] buffer, int offset, int count) { if (buffer == null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - offset < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); // Keep contract validation in sync with WriteAsync(..) if (!_isOpen) __Error.StreamIsClosed(); @@ -572,11 +572,11 @@ namespace System.IO long n = pos + count; // Check for overflow if (n < 0) - throw new IOException(SR.IO_StreamTooLong); + throw new IOException(Environment.GetResourceString("IO.IO_StreamTooLong")); if (n > _capacity) { - throw new NotSupportedException(SR.IO_FixedCapacity); + throw new NotSupportedException(Environment.GetResourceString("IO.IO_FixedCapacity")); } if (_buffer == null) @@ -607,7 +607,7 @@ namespace System.IO long bytesLeft = _capacity - pos; if (bytesLeft < count) { - throw new ArgumentException(SR.Arg_BufferTooSmall); + throw new ArgumentException(Environment.GetResourceString("Arg_BufferTooSmall")); } byte* pointer = null; @@ -638,13 +638,13 @@ namespace System.IO public override Task WriteAsync(Byte[] buffer, Int32 offset, Int32 count, CancellationToken cancellationToken) { if (buffer == null) - throw new ArgumentNullException(nameof(buffer), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(buffer), Environment.GetResourceString("ArgumentNull_Buffer")); if (offset < 0) - throw new ArgumentOutOfRangeException(nameof(offset), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(offset), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (buffer.Length - offset < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); // contract validation copied from Write(..) if (cancellationToken.IsCancellationRequested) @@ -675,10 +675,10 @@ namespace System.IO { // Check for overflow if (n < 0) - throw new IOException(SR.IO_StreamTooLong); + throw new IOException(Environment.GetResourceString("IO.IO_StreamTooLong")); if (n > _capacity) - throw new NotSupportedException(SR.IO_FixedCapacity); + throw new NotSupportedException(Environment.GetResourceString("IO.IO_FixedCapacity")); // Check to see whether we are now expanding the stream and must // zero any memory in the middle. diff --git a/src/mscorlib/src/System/IO/UnmanagedMemoryStreamWrapper.cs b/src/mscorlib/src/System/IO/UnmanagedMemoryStreamWrapper.cs index 86e4707dfd..04d5be3c5e 100644 --- a/src/mscorlib/src/System/IO/UnmanagedMemoryStreamWrapper.cs +++ b/src/mscorlib/src/System/IO/UnmanagedMemoryStreamWrapper.cs @@ -70,7 +70,7 @@ namespace System.IO public override byte[] GetBuffer() { - throw new UnauthorizedAccessException(SR.UnauthorizedAccess_MemStreamBuffer); + throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_MemStreamBuffer")); } public override bool TryGetBuffer(out ArraySegment<byte> buffer) @@ -88,7 +88,7 @@ namespace System.IO [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems. set { - throw new IOException(SR.IO_FixedCapacity); + throw new IOException(Environment.GetResourceString("IO.IO_FixedCapacity")); } } @@ -151,7 +151,7 @@ namespace System.IO public unsafe override void WriteTo(Stream stream) { if (stream == null) - throw new ArgumentNullException(nameof(stream), SR.ArgumentNull_Stream); + throw new ArgumentNullException(nameof(stream), Environment.GetResourceString("ArgumentNull_Stream")); Contract.EndContractBlock(); if (!_unmanagedStream._isOpen) __Error.StreamIsClosed(); @@ -178,19 +178,19 @@ namespace System.IO throw new ArgumentNullException(nameof(destination)); if (bufferSize <= 0) - throw new ArgumentOutOfRangeException(nameof(bufferSize), SR.ArgumentOutOfRange_NeedPosNum); + throw new ArgumentOutOfRangeException(nameof(bufferSize), Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum")); if (!CanRead && !CanWrite) - throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_StreamClosed")); if (!destination.CanRead && !destination.CanWrite) - throw new ObjectDisposedException(nameof(destination), SR.ObjectDisposed_StreamClosed); + throw new ObjectDisposedException(nameof(destination), Environment.GetResourceString("ObjectDisposed_StreamClosed")); if (!CanRead) - throw new NotSupportedException(SR.NotSupported_UnreadableStream); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnreadableStream")); if (!destination.CanWrite) - throw new NotSupportedException(SR.NotSupported_UnwritableStream); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnwritableStream")); Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/IO/__Error.cs b/src/mscorlib/src/System/IO/__Error.cs index 70f83261ed..14c8eb9f3b 100644 --- a/src/mscorlib/src/System/IO/__Error.cs +++ b/src/mscorlib/src/System/IO/__Error.cs @@ -30,49 +30,49 @@ namespace System.IO { internal static void EndOfFile() { - throw new EndOfStreamException(SR.IO_EOF_ReadBeyondEOF); + throw new EndOfStreamException(Environment.GetResourceString("IO.EOF_ReadBeyondEOF")); } internal static void FileNotOpen() { - throw new ObjectDisposedException(null, SR.ObjectDisposed_FileClosed); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_FileClosed")); } internal static void StreamIsClosed() { - throw new ObjectDisposedException(null, SR.ObjectDisposed_StreamClosed); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_StreamClosed")); } internal static void MemoryStreamNotExpandable() { - throw new NotSupportedException(SR.NotSupported_MemStreamNotExpandable); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_MemStreamNotExpandable")); } internal static void ReaderClosed() { - throw new ObjectDisposedException(null, SR.ObjectDisposed_ReaderClosed); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ReaderClosed")); } internal static void ReadNotSupported() { - throw new NotSupportedException(SR.NotSupported_UnreadableStream); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnreadableStream")); } internal static void WrongAsyncResult() { - throw new ArgumentException(SR.Arg_WrongAsyncResult); + throw new ArgumentException(Environment.GetResourceString("Arg_WrongAsyncResult")); } internal static void EndReadCalledTwice() { // Should ideally be InvalidOperationExc but we can't maitain parity with Stream and FileStream without some work - throw new ArgumentException(SR.InvalidOperation_EndReadCalledMultiple); + throw new ArgumentException(Environment.GetResourceString("InvalidOperation_EndReadCalledMultiple")); } internal static void EndWriteCalledTwice() { // Should ideally be InvalidOperationExc but we can't maintain parity with Stream and FileStream without some work - throw new ArgumentException(SR.InvalidOperation_EndWriteCalledMultiple); + throw new ArgumentException(Environment.GetResourceString("InvalidOperation_EndWriteCalledMultiple")); } // Given a possible fully qualified path, ensure that we have path @@ -124,7 +124,7 @@ namespace System.IO if (!safeToReturn) { if (PathInternal.IsDirectorySeparator(path[path.Length - 1])) - path = SR.IO_NoPermissionToDirectoryName; + path = Environment.GetResourceString("IO.IO_NoPermissionToDirectoryName"); else path = Path.GetFileName(path); } @@ -153,46 +153,46 @@ namespace System.IO { case Win32Native.ERROR_FILE_NOT_FOUND: if (str.Length == 0) - throw new FileNotFoundException(SR.IO_FileNotFound); + throw new FileNotFoundException(Environment.GetResourceString("IO.FileNotFound")); else - throw new FileNotFoundException(SR.Format(SR.IO_FileNotFound_FileName, str), str); + throw new FileNotFoundException(Environment.GetResourceString("IO.FileNotFound_FileName", str), str); case Win32Native.ERROR_PATH_NOT_FOUND: if (str.Length == 0) - throw new DirectoryNotFoundException(SR.IO_PathNotFound_NoPathName); + throw new DirectoryNotFoundException(Environment.GetResourceString("IO.PathNotFound_NoPathName")); else - throw new DirectoryNotFoundException(SR.Format(SR.IO_PathNotFound_Path, str)); + throw new DirectoryNotFoundException(Environment.GetResourceString("IO.PathNotFound_Path", str)); case Win32Native.ERROR_ACCESS_DENIED: if (str.Length == 0) - throw new UnauthorizedAccessException(SR.UnauthorizedAccess_IODenied_NoPathName); + throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_IODenied_NoPathName")); else - throw new UnauthorizedAccessException(SR.Format(SR.UnauthorizedAccess_IODenied_Path, str)); + throw new UnauthorizedAccessException(Environment.GetResourceString("UnauthorizedAccess_IODenied_Path", str)); case Win32Native.ERROR_ALREADY_EXISTS: if (str.Length == 0) goto default; - throw new IOException(SR.Format(SR.IO_AlreadyExists_Name, str), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath); + throw new IOException(Environment.GetResourceString("IO.IO_AlreadyExists_Name", str), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath); case Win32Native.ERROR_FILENAME_EXCED_RANGE: - throw new PathTooLongException(SR.IO_PathTooLong); + throw new PathTooLongException(Environment.GetResourceString("IO.PathTooLong")); case Win32Native.ERROR_INVALID_DRIVE: - throw new DriveNotFoundException(SR.Format(SR.IO_DriveNotFound_Drive, str)); + throw new DriveNotFoundException(Environment.GetResourceString("IO.DriveNotFound_Drive", str)); case Win32Native.ERROR_INVALID_PARAMETER: throw new IOException(Win32Native.GetMessage(errorCode), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath); case Win32Native.ERROR_SHARING_VIOLATION: if (str.Length == 0) - throw new IOException(SR.IO_SharingViolation_NoFileName, Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath); + throw new IOException(Environment.GetResourceString("IO.IO_SharingViolation_NoFileName"), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath); else - throw new IOException(SR.Format(SR.IO_SharingViolation_File, str), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath); + throw new IOException(Environment.GetResourceString("IO.IO_SharingViolation_File", str), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath); case Win32Native.ERROR_FILE_EXISTS: if (str.Length == 0) goto default; - throw new IOException(SR.Format(SR.IO_FileExists_Name, str), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath); + throw new IOException(Environment.GetResourceString("IO.IO_FileExists_Name", str), Win32Native.MakeHRFromErrorCode(errorCode), maybeFullPath); case Win32Native.ERROR_OPERATION_ABORTED: throw new OperationCanceledException(); @@ -204,7 +204,7 @@ namespace System.IO internal static void WriteNotSupported() { - throw new NotSupportedException(SR.NotSupported_UnwritableStream); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnwritableStream")); } // From WinError.h diff --git a/src/mscorlib/src/System/Int16.cs b/src/mscorlib/src/System/Int16.cs index e05ce442bb..89b081b55b 100644 --- a/src/mscorlib/src/System/Int16.cs +++ b/src/mscorlib/src/System/Int16.cs @@ -48,7 +48,7 @@ namespace System return m_value - ((Int16)value).m_value; } - throw new ArgumentException(SR.Arg_MustBeInt16); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt16")); } public int CompareTo(Int16 value) @@ -145,7 +145,7 @@ namespace System } catch (OverflowException e) { - throw new OverflowException(SR.Overflow_Int16, e); + throw new OverflowException(Environment.GetResourceString("Overflow_Int16"), e); } // We need this check here since we don't allow signs to specified in hex numbers. So we fixup the result @@ -154,12 +154,12 @@ namespace System { // We are parsing a hexadecimal number if ((i < 0) || (i > UInt16.MaxValue)) { - throw new OverflowException(SR.Overflow_Int16); + throw new OverflowException(Environment.GetResourceString("Overflow_Int16")); } return (short)i; } - if (i < MinValue || i > MaxValue) throw new OverflowException(SR.Overflow_Int16); + if (i < MinValue || i > MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_Int16")); return (short)i; } @@ -294,7 +294,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int16", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Int16", "DateTime")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/Int32.cs b/src/mscorlib/src/System/Int32.cs index 70a2a07306..cbbd5f912b 100644 --- a/src/mscorlib/src/System/Int32.cs +++ b/src/mscorlib/src/System/Int32.cs @@ -51,7 +51,7 @@ namespace System if (m_value > i) return 1; return 0; } - throw new ArgumentException(SR.Arg_MustBeInt32); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt32")); } public int CompareTo(int value) @@ -256,7 +256,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int32", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Int32", "DateTime")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/Int64.cs b/src/mscorlib/src/System/Int64.cs index 56d01a5933..9e68c423cf 100644 --- a/src/mscorlib/src/System/Int64.cs +++ b/src/mscorlib/src/System/Int64.cs @@ -50,7 +50,7 @@ namespace System if (m_value > i) return 1; return 0; } - throw new ArgumentException(SR.Arg_MustBeInt64); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt64")); } public int CompareTo(Int64 value) @@ -235,7 +235,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Int64", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Int64", "DateTime")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/IntPtr.cs b/src/mscorlib/src/System/IntPtr.cs index 28f1b1baa8..17a2d3864c 100644 --- a/src/mscorlib/src/System/IntPtr.cs +++ b/src/mscorlib/src/System/IntPtr.cs @@ -69,7 +69,7 @@ namespace System if (Size == 4 && (l > Int32.MaxValue || l < Int32.MinValue)) { - throw new ArgumentException(SR.Serialization_InvalidPtrValue); + throw new ArgumentException(Environment.GetResourceString("Serialization_InvalidPtrValue")); } m_value = (void*)l; diff --git a/src/mscorlib/src/System/Math.cs b/src/mscorlib/src/System/Math.cs index 6f7d731ab1..4cdb7944b2 100644 --- a/src/mscorlib/src/System/Math.cs +++ b/src/mscorlib/src/System/Math.cs @@ -113,7 +113,7 @@ namespace System public static double Round(double value, int digits) { if ((digits < 0) || (digits > maxRoundingDigits)) - throw new ArgumentOutOfRangeException(nameof(digits), SR.ArgumentOutOfRange_RoundingDigits); + throw new ArgumentOutOfRangeException(nameof(digits), Environment.GetResourceString("ArgumentOutOfRange_RoundingDigits")); Contract.EndContractBlock(); return InternalRound(value, digits, MidpointRounding.ToEven); } @@ -126,10 +126,10 @@ namespace System public static double Round(double value, int digits, MidpointRounding mode) { if ((digits < 0) || (digits > maxRoundingDigits)) - throw new ArgumentOutOfRangeException(nameof(digits), SR.ArgumentOutOfRange_RoundingDigits); + throw new ArgumentOutOfRangeException(nameof(digits), Environment.GetResourceString("ArgumentOutOfRange_RoundingDigits")); if (mode < MidpointRounding.ToEven || mode > MidpointRounding.AwayFromZero) { - throw new ArgumentException(SR.Format(SR.Argument_InvalidEnumValue, mode, nameof(MidpointRounding)), nameof(mode)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidEnumValue", mode, nameof(MidpointRounding)), nameof(mode)); } Contract.EndContractBlock(); return InternalRound(value, digits, mode); @@ -243,7 +243,7 @@ namespace System { Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (workaround for JIT inlining)"); if (value == SByte.MinValue) - throw new OverflowException(SR.Overflow_NegateTwosCompNum); + throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum")); Contract.EndContractBlock(); return ((sbyte)(-value)); } @@ -260,7 +260,7 @@ namespace System { Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (workaround for JIT inlining)"); if (value == Int16.MinValue) - throw new OverflowException(SR.Overflow_NegateTwosCompNum); + throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum")); Contract.EndContractBlock(); return (short)-value; } @@ -277,7 +277,7 @@ namespace System { Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (workaround for JIT inlining)"); if (value == Int32.MinValue) - throw new OverflowException(SR.Overflow_NegateTwosCompNum); + throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum")); Contract.EndContractBlock(); return -value; } @@ -294,7 +294,7 @@ namespace System { Contract.Requires(value < 0, "AbsHelper should only be called for negative values! (workaround for JIT inlining)"); if (value == Int64.MinValue) - throw new OverflowException(SR.Overflow_NegateTwosCompNum); + throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum")); Contract.EndContractBlock(); return -value; } @@ -631,7 +631,7 @@ namespace System private static void ThrowMinMaxException<T>(T min, T max) { - throw new ArgumentException(SR.Format(SR.Argument_MinMaxValue, min, max)); + throw new ArgumentException(Environment.GetResourceString("Argument_MinMaxValue", min, max)); } /*=====================================Log====================================== @@ -713,7 +713,7 @@ namespace System return 1; else if (value == 0) return 0; - throw new ArithmeticException(SR.Arithmetic_NaN); + throw new ArithmeticException(Environment.GetResourceString("Arithmetic_NaN")); } public static int Sign(double value) @@ -724,7 +724,7 @@ namespace System return 1; else if (value == 0) return 0; - throw new ArithmeticException(SR.Arithmetic_NaN); + throw new ArithmeticException(Environment.GetResourceString("Arithmetic_NaN")); } public static int Sign(Decimal value) diff --git a/src/mscorlib/src/System/MathF.cs b/src/mscorlib/src/System/MathF.cs index 60669a4561..2abac7b5db 100644 --- a/src/mscorlib/src/System/MathF.cs +++ b/src/mscorlib/src/System/MathF.cs @@ -159,7 +159,7 @@ namespace System { if ((digits < 0) || (digits > maxRoundingDigits)) { - throw new ArgumentOutOfRangeException(nameof(digits), SR.ArgumentOutOfRange_RoundingDigits); + throw new ArgumentOutOfRangeException(nameof(digits), Environment.GetResourceString("ArgumentOutOfRange_RoundingDigits")); } Contract.EndContractBlock(); @@ -170,12 +170,12 @@ namespace System { if ((digits < 0) || (digits > maxRoundingDigits)) { - throw new ArgumentOutOfRangeException(nameof(digits), SR.ArgumentOutOfRange_RoundingDigits); + throw new ArgumentOutOfRangeException(nameof(digits), Environment.GetResourceString("ArgumentOutOfRange_RoundingDigits")); } if (mode < MidpointRounding.ToEven || mode > MidpointRounding.AwayFromZero) { - throw new ArgumentException(SR.Format(SR.Argument_InvalidEnum, mode, nameof(MidpointRounding)), nameof(mode)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidEnumx", mode, nameof(MidpointRounding)), nameof(mode)); } Contract.EndContractBlock(); @@ -186,7 +186,7 @@ namespace System { if (mode < MidpointRounding.ToEven || mode > MidpointRounding.AwayFromZero) { - throw new ArgumentException(SR.Format(SR.Argument_InvalidEnum, mode, nameof(MidpointRounding)), nameof(mode)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidEnumx", mode, nameof(MidpointRounding)), nameof(mode)); } Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/MissingFieldException.cs b/src/mscorlib/src/System/MissingFieldException.cs index 65a97262ea..15d1a684bc 100644 --- a/src/mscorlib/src/System/MissingFieldException.cs +++ b/src/mscorlib/src/System/MissingFieldException.cs @@ -22,7 +22,7 @@ namespace System public class MissingFieldException : MissingMemberException, ISerializable { public MissingFieldException() - : base(SR.Arg_MissingFieldException) + : base(Environment.GetResourceString("Arg_MissingFieldException")) { SetErrorCode(__HResults.COR_E_MISSINGFIELD); } @@ -54,7 +54,9 @@ namespace System else { // do any desired fixups to classname here. - return SR.Format(SR.MissingField_Name, (Signature != null ? FormatSignature(Signature) + " " : "") + ClassName + "." + MemberName); + return Environment.GetResourceString("MissingField_Name", + (Signature != null ? FormatSignature(Signature) + " " : "") + + ClassName + "." + MemberName); } } } diff --git a/src/mscorlib/src/System/MissingMemberException.cs b/src/mscorlib/src/System/MissingMemberException.cs index d40aa53f96..be5ac83743 100644 --- a/src/mscorlib/src/System/MissingMemberException.cs +++ b/src/mscorlib/src/System/MissingMemberException.cs @@ -26,7 +26,7 @@ namespace System public class MissingMemberException : MemberAccessException, ISerializable { public MissingMemberException() - : base(SR.Arg_MissingMemberException) + : base(Environment.GetResourceString("Arg_MissingMemberException")) { SetErrorCode(__HResults.COR_E_MISSINGMEMBER); } @@ -61,7 +61,9 @@ namespace System else { // do any desired fixups to classname here. - return SR.Format(SR.MissingMember_Name, ClassName + "." + MemberName + (Signature != null ? " " + FormatSignature(Signature) : "")); + return Environment.GetResourceString("MissingMember_Name", + ClassName + "." + MemberName + + (Signature != null ? " " + FormatSignature(Signature) : "")); } } } diff --git a/src/mscorlib/src/System/MissingMethodException.cs b/src/mscorlib/src/System/MissingMethodException.cs index c17ab8ed9b..81b2f61205 100644 --- a/src/mscorlib/src/System/MissingMethodException.cs +++ b/src/mscorlib/src/System/MissingMethodException.cs @@ -24,7 +24,7 @@ namespace System public class MissingMethodException : MissingMemberException, ISerializable { public MissingMethodException() - : base(SR.Arg_MissingMethodException) + : base(Environment.GetResourceString("Arg_MissingMethodException")) { SetErrorCode(__HResults.COR_E_MISSINGMETHOD); } @@ -56,7 +56,9 @@ namespace System else { // do any desired fixups to classname here. - return SR.Format(SR.MissingMethod_Name, ClassName + "." + MemberName + (Signature != null ? " " + FormatSignature(Signature) : "")); + return Environment.GetResourceString("MissingMethod_Name", + ClassName + "." + MemberName + + (Signature != null ? " " + FormatSignature(Signature) : "")); } } } diff --git a/src/mscorlib/src/System/MulticastDelegate.cs b/src/mscorlib/src/System/MulticastDelegate.cs index 440c9a60bc..6d4d28891f 100644 --- a/src/mscorlib/src/System/MulticastDelegate.cs +++ b/src/mscorlib/src/System/MulticastDelegate.cs @@ -59,11 +59,11 @@ namespace System // One can only create delegates on RuntimeMethodInfo and DynamicMethod. // If it is not a RuntimeMethodInfo (must be a DynamicMethod) or if it is an unmanaged function pointer, throw if (!(method is RuntimeMethodInfo) || IsUnmanagedFunctionPtr()) - throw new SerializationException(SR.Serialization_InvalidDelegateType); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidDelegateType")); // We can't deal with secure delegates either. if (!InvocationListLogicallyNull() && !_invocationCount.IsNull() && !_methodPtrAux.IsNull()) - throw new SerializationException(SR.Serialization_InvalidDelegateType); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidDelegateType")); DelegateSerializationHolder.GetDelegateSerializationInfo(info, this.GetType(), Target, method, targetIndex); } @@ -91,7 +91,7 @@ namespace System } // if nothing was serialized it is a delegate over a DynamicMethod, so just throw if (nextDe == null) - throw new SerializationException(SR.Serialization_InvalidDelegateType); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidDelegateType")); } } @@ -266,7 +266,7 @@ namespace System // Verify that the types are the same... if (!InternalEqualTypes(this, follow)) - throw new ArgumentException(SR.Arg_DlgtTypeMis); + throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTypeMis")); MulticastDelegate dFollow = (MulticastDelegate)follow; Object[] resultList; @@ -592,7 +592,7 @@ namespace System [System.Diagnostics.DebuggerNonUserCode] private void ThrowNullThisInDelegateToInstance() { - throw new ArgumentException(SR.Arg_DlgtNullInst); + throw new ArgumentException(Environment.GetResourceString("Arg_DlgtNullInst")); } [System.Diagnostics.DebuggerNonUserCode] diff --git a/src/mscorlib/src/System/Number.cs b/src/mscorlib/src/System/Number.cs index b30d4e643f..d7a1bc12e1 100644 --- a/src/mscorlib/src/System/Number.cs +++ b/src/mscorlib/src/System/Number.cs @@ -676,7 +676,7 @@ namespace System if (!NumberBufferToDecimal(number.PackForNative(), ref result)) { - throw new OverflowException(SR.Overflow_Decimal); + throw new OverflowException(Environment.GetResourceString("Overflow_Decimal")); } return result; } @@ -710,12 +710,12 @@ namespace System { return Double.NaN; } - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } if (!NumberBufferToDouble(number.PackForNative(), ref d)) { - throw new OverflowException(SR.Overflow_Double); + throw new OverflowException(Environment.GetResourceString("Overflow_Double")); } return d; @@ -733,14 +733,14 @@ namespace System { if (!HexNumberToInt32(ref number, ref i)) { - throw new OverflowException(SR.Overflow_Int32); + throw new OverflowException(Environment.GetResourceString("Overflow_Int32")); } } else { if (!NumberToInt32(ref number, ref i)) { - throw new OverflowException(SR.Overflow_Int32); + throw new OverflowException(Environment.GetResourceString("Overflow_Int32")); } } return i; @@ -758,14 +758,14 @@ namespace System { if (!HexNumberToInt64(ref number, ref i)) { - throw new OverflowException(SR.Overflow_Int64); + throw new OverflowException(Environment.GetResourceString("Overflow_Int64")); } } else { if (!NumberToInt64(ref number, ref i)) { - throw new OverflowException(SR.Overflow_Int64); + throw new OverflowException(Environment.GetResourceString("Overflow_Int64")); } } return i; @@ -1014,17 +1014,17 @@ namespace System { return Single.NaN; } - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } if (!NumberBufferToDouble(number.PackForNative(), ref d)) { - throw new OverflowException(SR.Overflow_Single); + throw new OverflowException(Environment.GetResourceString("Overflow_Single")); } Single castSingle = (Single)d; if (Single.IsInfinity(castSingle)) { - throw new OverflowException(SR.Overflow_Single); + throw new OverflowException(Environment.GetResourceString("Overflow_Single")); } return castSingle; } @@ -1041,14 +1041,14 @@ namespace System { if (!HexNumberToUInt32(ref number, ref i)) { - throw new OverflowException(SR.Overflow_UInt32); + throw new OverflowException(Environment.GetResourceString("Overflow_UInt32")); } } else { if (!NumberToUInt32(ref number, ref i)) { - throw new OverflowException(SR.Overflow_UInt32); + throw new OverflowException(Environment.GetResourceString("Overflow_UInt32")); } } @@ -1066,14 +1066,14 @@ namespace System { if (!HexNumberToUInt64(ref number, ref i)) { - throw new OverflowException(SR.Overflow_UInt64); + throw new OverflowException(Environment.GetResourceString("Overflow_UInt64")); } } else { if (!NumberToUInt64(ref number, ref i)) { - throw new OverflowException(SR.Overflow_UInt64); + throw new OverflowException(Environment.GetResourceString("Overflow_UInt64")); } } return i; @@ -1093,7 +1093,7 @@ namespace System if (!ParseNumber(ref p, options, ref number, null, info, parseDecimal) || (p - stringPointer < str.Length && !TrailingZeros(str, (int)(p - stringPointer)))) { - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } } } diff --git a/src/mscorlib/src/System/Object.cs b/src/mscorlib/src/System/Object.cs index 3c304422ac..643e1d933e 100644 --- a/src/mscorlib/src/System/Object.cs +++ b/src/mscorlib/src/System/Object.cs @@ -127,7 +127,7 @@ namespace System FieldInfo fldInfo = GetFieldInfo(typeName, fieldName); if (fldInfo.IsInitOnly) - throw new FieldAccessException(SR.FieldAccess_InitOnly); + throw new FieldAccessException(Environment.GetResourceString("FieldAccess_InitOnly")); // Make sure that the value is compatible with the type // of field diff --git a/src/mscorlib/src/System/OleAutBinder.cs b/src/mscorlib/src/System/OleAutBinder.cs index 1db61bb30e..fafaa8d6ee 100644 --- a/src/mscorlib/src/System/OleAutBinder.cs +++ b/src/mscorlib/src/System/OleAutBinder.cs @@ -85,7 +85,7 @@ namespace System Console.Write("Exception thrown: "); Console.WriteLine(e); #endif - throw new COMException(SR.Interop_COM_TypeMismatch, unchecked((int)0x80020005)); + throw new COMException(Environment.GetResourceString("Interop.COM_TypeMismatch"), unchecked((int)0x80020005)); } } } diff --git a/src/mscorlib/src/System/OperatingSystem.cs b/src/mscorlib/src/System/OperatingSystem.cs index 5eb1253fa5..d8f78d73c9 100644 --- a/src/mscorlib/src/System/OperatingSystem.cs +++ b/src/mscorlib/src/System/OperatingSystem.cs @@ -35,7 +35,7 @@ namespace System if (platform < PlatformID.Win32S || platform > PlatformID.MacOSX) { throw new ArgumentException( - SR.Format(SR.Arg_EnumIllegalVal, (int)platform), + Environment.GetResourceString("Arg_EnumIllegalVal", (int)platform), nameof(platform)); } @@ -69,7 +69,7 @@ namespace System if (_version == null) { - throw new SerializationException(SR.Format(SR.Serialization_MissField, "_version")); + throw new SerializationException(Environment.GetResourceString("Serialization_MissField", "_version")); } } diff --git a/src/mscorlib/src/System/OperationCanceledException.cs b/src/mscorlib/src/System/OperationCanceledException.cs index 1afd59b251..371e1c04ce 100644 --- a/src/mscorlib/src/System/OperationCanceledException.cs +++ b/src/mscorlib/src/System/OperationCanceledException.cs @@ -30,7 +30,7 @@ namespace System } public OperationCanceledException() - : base(SR.OperationCanceled) + : base(Environment.GetResourceString("OperationCanceled")) { SetErrorCode(__HResults.COR_E_OPERATIONCANCELED); } diff --git a/src/mscorlib/src/System/Random.cs b/src/mscorlib/src/System/Random.cs index a81a4f4cc7..507c2336c5 100644 --- a/src/mscorlib/src/System/Random.cs +++ b/src/mscorlib/src/System/Random.cs @@ -212,7 +212,7 @@ namespace System { if (minValue > maxValue) { - throw new ArgumentOutOfRangeException(nameof(minValue), SR.Format(SR.Argument_MinMaxValue, nameof(minValue), nameof(maxValue))); + throw new ArgumentOutOfRangeException(nameof(minValue), Environment.GetResourceString("Argument_MinMaxValue", nameof(minValue), nameof(maxValue))); } Contract.EndContractBlock(); @@ -237,7 +237,7 @@ namespace System { if (maxValue < 0) { - throw new ArgumentOutOfRangeException(nameof(maxValue), SR.Format(SR.ArgumentOutOfRange_MustBePositive, nameof(maxValue))); + throw new ArgumentOutOfRangeException(nameof(maxValue), Environment.GetResourceString("ArgumentOutOfRange_MustBePositive", nameof(maxValue))); } Contract.EndContractBlock(); return (int)(Sample() * maxValue); diff --git a/src/mscorlib/src/System/Reflection/AmbiguousMatchException.cs b/src/mscorlib/src/System/Reflection/AmbiguousMatchException.cs index 11abf8ddda..36091d0296 100644 --- a/src/mscorlib/src/System/Reflection/AmbiguousMatchException.cs +++ b/src/mscorlib/src/System/Reflection/AmbiguousMatchException.cs @@ -23,7 +23,7 @@ namespace System.Reflection public sealed class AmbiguousMatchException : SystemException { public AmbiguousMatchException() - : base(SR.RFLCT_Ambiguous) + : base(Environment.GetResourceString("RFLCT.Ambiguous")) { SetErrorCode(__HResults.COR_E_AMBIGUOUSMATCH); } diff --git a/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs b/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs index 82966dba60..86f7f42512 100644 --- a/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs +++ b/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs @@ -47,7 +47,7 @@ namespace System.Reflection byte[] hashValue, AssemblyHashAlgorithm hashAlgorithm) { - throw new NotSupportedException(SR.NotSupported_AssemblyLoadFromHash); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_AssemblyLoadFromHash")); } // Locate an assembly by the long form of the assembly name. @@ -104,7 +104,7 @@ namespace System.Reflection if (assemblyRef != null && assemblyRef.CodeBase != null) { - throw new NotSupportedException(SR.NotSupported_AssemblyLoadCodeBase); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_AssemblyLoadCodeBase")); } StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; @@ -121,7 +121,7 @@ namespace System.Reflection if (assemblyRef != null && assemblyRef.CodeBase != null) { - throw new NotSupportedException(SR.NotSupported_AssemblyLoadCodeBase); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_AssemblyLoadCodeBase")); } StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; @@ -164,7 +164,7 @@ namespace System.Reflection if (PathInternal.IsPartiallyQualified(path)) { - throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(path)); + throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"), nameof(path)); } string normalizedPath = Path.GetFullPath(path); diff --git a/src/mscorlib/src/System/Reflection/AssemblyName.cs b/src/mscorlib/src/System/Reflection/AssemblyName.cs index a1b9034391..202bd07655 100644 --- a/src/mscorlib/src/System/Reflection/AssemblyName.cs +++ b/src/mscorlib/src/System/Reflection/AssemblyName.cs @@ -366,7 +366,7 @@ namespace System.Reflection Contract.EndContractBlock(); if ((assemblyName.Length == 0) || (assemblyName[0] == '\0')) - throw new ArgumentException(SR.Format_StringZeroLength); + throw new ArgumentException(Environment.GetResourceString("Format_StringZeroLength")); _Name = assemblyName; nInit(); @@ -545,7 +545,7 @@ namespace System.Reflection { // Should be a rare case where the app tries to feed an invalid Unicode surrogates pair if (count == 1 || count == end - i) - throw new FormatException(SR.Arg_FormatException); + throw new FormatException(Environment.GetResourceString("Arg_FormatException")); // need to grab one more char as a Surrogate except when it's a bogus input ++count; } @@ -561,7 +561,7 @@ namespace System.Reflection // This is the only exception that built in UriParser can throw after a Uri ctor. // Should not happen unless the app tries to feed an invalid Unicode String if (numberOfBytes == 0) - throw new FormatException(SR.Arg_FormatException); + throw new FormatException(Environment.GetResourceString("Arg_FormatException")); i += (count - 1); diff --git a/src/mscorlib/src/System/Reflection/CustomAttribute.cs b/src/mscorlib/src/System/Reflection/CustomAttribute.cs index 0c8271b9a9..c12187d7c8 100644 --- a/src/mscorlib/src/System/Reflection/CustomAttribute.cs +++ b/src/mscorlib/src/System/Reflection/CustomAttribute.cs @@ -268,7 +268,7 @@ namespace System.Reflection if (type.IsValueType) return CustomAttributeEncoding.Undefined; - throw new ArgumentException(SR.Argument_InvalidKindOfTypeForCA, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidKindOfTypeForCA"), nameof(type)); } private static CustomAttributeType InitCustomAttributeType(RuntimeType parameterType) { @@ -604,7 +604,7 @@ namespace System.Reflection else if (property != null) type = property.PropertyType; else - throw new ArgumentException(SR.Argument_InvalidMemberForNamedArgument); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidMemberForNamedArgument")); m_memberInfo = memberInfo; m_value = new CustomAttributeTypedArgument(type, value); @@ -730,7 +730,7 @@ namespace System.Reflection return typeof(object); default: - throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)encodedType), nameof(encodedType)); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)encodedType), nameof(encodedType)); } } @@ -775,7 +775,7 @@ namespace System.Reflection unsafe { return *(double*)&val; } default: - throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)val), nameof(val)); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)val), nameof(val)); } } private static RuntimeType ResolveType(RuntimeModule scope, string typeName) @@ -784,7 +784,7 @@ namespace System.Reflection if (type == null) throw new InvalidOperationException( - String.Format(CultureInfo.CurrentUICulture, SR.Arg_CATypeResolutionFailed, typeName)); + String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Arg_CATypeResolutionFailed"), typeName)); return type; } @@ -1524,7 +1524,7 @@ namespace System.Reflection RuntimeModule decoratedModule, int decoratedMetadataToken, RuntimeType attributeFilterType, int attributeCtorToken, bool mustBeInheritable) { if (decoratedModule.Assembly.ReflectionOnly) - throw new InvalidOperationException(SR.Arg_ReflectionOnlyCA); + throw new InvalidOperationException(Environment.GetResourceString("Arg_ReflectionOnlyCA")); Contract.EndContractBlock(); CustomAttributeRecord[] car = CustomAttributeData.GetCustomAttributeRecords(decoratedModule, decoratedMetadataToken); @@ -1580,7 +1580,7 @@ namespace System.Reflection RuntimeType attributeFilterType, bool mustBeInheritable, IList derivedAttributes, bool isDecoratedTargetSecurityTransparent) { if (decoratedModule.Assembly.ReflectionOnly) - throw new InvalidOperationException(SR.Arg_ReflectionOnlyCA); + throw new InvalidOperationException(Environment.GetResourceString("Arg_ReflectionOnlyCA")); Contract.EndContractBlock(); MetadataImport scope = decoratedModule.MetadataImport; @@ -1700,8 +1700,8 @@ namespace System.Reflection if (property == null) { throw new CustomAttributeFormatException( - String.Format(CultureInfo.CurrentUICulture, - isProperty ? SR.RFLCT_InvalidPropFail : SR.RFLCT_InvalidFieldFail, name)); + String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString( + isProperty ? "RFLCT.InvalidPropFail" : "RFLCT.InvalidFieldFail"), name)); } RuntimeMethodInfo setMethod = property.GetSetMethod(true) as RuntimeMethodInfo; @@ -1731,8 +1731,8 @@ namespace System.Reflection catch (Exception e) { throw new CustomAttributeFormatException( - String.Format(CultureInfo.CurrentUICulture, - isProperty ? SR.RFLCT_InvalidPropFail : SR.RFLCT_InvalidFieldFail, name), e); + String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString( + isProperty ? "RFLCT.InvalidPropFail" : "RFLCT.InvalidFieldFail"), name), e); } #endregion } @@ -1905,7 +1905,7 @@ namespace System.Reflection if (attributeUsageAttribute != null) throw new FormatException(String.Format( - CultureInfo.CurrentUICulture, SR.Format_AttributeUsage, attributeType)); + CultureInfo.CurrentUICulture, Environment.GetResourceString("Format_AttributeUsage"), attributeType)); AttributeTargets targets; bool inherited, allowMultiple; diff --git a/src/mscorlib/src/System/Reflection/CustomAttributeFormatException.cs b/src/mscorlib/src/System/Reflection/CustomAttributeFormatException.cs index 7f88e0c286..83ef54138e 100644 --- a/src/mscorlib/src/System/Reflection/CustomAttributeFormatException.cs +++ b/src/mscorlib/src/System/Reflection/CustomAttributeFormatException.cs @@ -20,7 +20,7 @@ namespace System.Reflection public class CustomAttributeFormatException : FormatException { public CustomAttributeFormatException() - : base(SR.Arg_CustomAttributeFormatException) + : base(Environment.GetResourceString("Arg_CustomAttributeFormatException")) { SetErrorCode(__HResults.COR_E_CUSTOMATTRIBUTEFORMAT); } diff --git a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs index 6d9cb0db2f..2ff87a02ac 100644 --- a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilder.cs @@ -94,39 +94,39 @@ namespace System.Reflection.Emit #region Methods inherited from Assembly public override String[] GetManifestResourceNames() { - throw new NotSupportedException(SR.NotSupported_DynamicAssembly); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly")); } public override FileStream GetFile(String name) { - throw new NotSupportedException(SR.NotSupported_DynamicAssembly); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly")); } public override FileStream[] GetFiles(bool getResourceModules) { - throw new NotSupportedException(SR.NotSupported_DynamicAssembly); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly")); } public override Stream GetManifestResourceStream(Type type, String name) { - throw new NotSupportedException(SR.NotSupported_DynamicAssembly); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly")); } public override Stream GetManifestResourceStream(String name) { - throw new NotSupportedException(SR.NotSupported_DynamicAssembly); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly")); } public override ManifestResourceInfo GetManifestResourceInfo(String resourceName) { - throw new NotSupportedException(SR.NotSupported_DynamicAssembly); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly")); } public override String Location { get { - throw new NotSupportedException(SR.NotSupported_DynamicAssembly); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly")); } } @@ -134,13 +134,13 @@ namespace System.Reflection.Emit { get { - throw new NotSupportedException(SR.NotSupported_DynamicAssembly); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly")); } } public override Type[] GetExportedTypes() { - throw new NotSupportedException(SR.NotSupported_DynamicAssembly); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicAssembly")); } public override String ImageRuntimeVersion @@ -231,7 +231,7 @@ namespace System.Reflection.Emit && access != AssemblyBuilderAccess.RunAndCollect ) { - throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)access), nameof(access)); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)access), nameof(access)); } if (securityContextSource < SecurityContextSource.CurrentAppDomain || @@ -441,9 +441,9 @@ namespace System.Reflection.Emit if (name == null) throw new ArgumentNullException(nameof(name)); if (name.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name)); if (name[0] == '\0') - throw new ArgumentException(SR.Argument_InvalidName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidName"), nameof(name)); Contract.Ensures(Contract.Result<ModuleBuilder>() != null); Contract.EndContractBlock(); @@ -457,7 +457,7 @@ namespace System.Reflection.Emit // create the dynamic module- only one ModuleBuilder per AssemblyBuilder can be created if (m_fManifestModuleUsedAsDefinedModule == true) - throw new InvalidOperationException(SR.InvalidOperation_NoMultiModuleAssembly); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NoMultiModuleAssembly")); // Init(...) has already been called on m_manifestModuleBuilder in InitManifestModule() dynModule = m_manifestModuleBuilder; @@ -511,16 +511,16 @@ namespace System.Reflection.Emit continue; if (type.Module == null || type.Module.Assembly == null) - throw new ArgumentException(SR.Argument_TypeNotValid); + throw new ArgumentException(Environment.GetResourceString("Argument_TypeNotValid")); if (type.Module.Assembly == typeof(object).Module.Assembly) continue; if (type.Module.Assembly.ReflectionOnly && !ReflectionOnly) - throw new InvalidOperationException(SR.Format(SR.Arugment_EmitMixedContext1, type.AssemblyQualifiedName)); + throw new InvalidOperationException(Environment.GetResourceString("Arugment_EmitMixedContext1", type.AssemblyQualifiedName)); if (!type.Module.Assembly.ReflectionOnly && ReflectionOnly) - throw new InvalidOperationException(SR.Format(SR.Arugment_EmitMixedContext2, type.AssemblyQualifiedName)); + throw new InvalidOperationException(Environment.GetResourceString("Arugment_EmitMixedContext2", type.AssemblyQualifiedName)); } } @@ -742,7 +742,7 @@ namespace System.Reflection.Emit if (name == null) throw new ArgumentNullException(nameof(name)); if (name.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name)); Contract.EndContractBlock(); BCLDebug.Log("DYNIL", "## DYNIL LOGGING: AssemblyBuilder.GetDynamicModule( " + name + " )"); diff --git a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs index 529ba54514..a2fb2b602c 100644 --- a/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs +++ b/src/mscorlib/src/System/Reflection/Emit/AssemblyBuilderData.cs @@ -120,7 +120,7 @@ namespace System.Reflection.Emit // if (enclosingType == null && m_assembly.GetType(strTypeName, false, false) != null) // { // // Cannot have two types with the same name - // throw new ArgumentException(SR.Argument_DuplicateTypeName); + // throw new ArgumentException(Environment.GetResourceString("Argument_DuplicateTypeName")); // } } diff --git a/src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs index 3ca9b2eb9d..185d2041a2 100644 --- a/src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/ConstructorBuilder.cs @@ -102,7 +102,7 @@ namespace System.Reflection.Emit #region MethodBase Overrides public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } [Pure] @@ -132,7 +132,7 @@ namespace System.Reflection.Emit #region ConstructorInfo Overrides public override Object Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } #endregion @@ -175,7 +175,7 @@ namespace System.Reflection.Emit public ILGenerator GetILGenerator() { if (m_isDefaultConstructor) - throw new InvalidOperationException(SR.InvalidOperation_DefaultConstructorILGen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_DefaultConstructorILGen")); return m_methodBuilder.GetILGenerator(); } @@ -183,7 +183,7 @@ namespace System.Reflection.Emit public ILGenerator GetILGenerator(int streamSize) { if (m_isDefaultConstructor) - throw new InvalidOperationException(SR.InvalidOperation_DefaultConstructorILGen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_DefaultConstructorILGen")); return m_methodBuilder.GetILGenerator(streamSize); } diff --git a/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs index cf5bd11de6..cbc73455ed 100644 --- a/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/CustomAttributeBuilder.cs @@ -118,17 +118,17 @@ namespace System.Reflection.Emit if (fieldValues == null) throw new ArgumentNullException(nameof(fieldValues)); if (namedProperties.Length != propertyValues.Length) - throw new ArgumentException(SR.Arg_ArrayLengthsDiffer, "namedProperties, propertyValues"); + throw new ArgumentException(Environment.GetResourceString("Arg_ArrayLengthsDiffer"), "namedProperties, propertyValues"); if (namedFields.Length != fieldValues.Length) - throw new ArgumentException(SR.Arg_ArrayLengthsDiffer, "namedFields, fieldValues"); + throw new ArgumentException(Environment.GetResourceString("Arg_ArrayLengthsDiffer"), "namedFields, fieldValues"); Contract.EndContractBlock(); if ((con.Attributes & MethodAttributes.Static) == MethodAttributes.Static || (con.Attributes & MethodAttributes.MemberAccessMask) == MethodAttributes.Private) - throw new ArgumentException(SR.Argument_BadConstructor); + throw new ArgumentException(Environment.GetResourceString("Argument_BadConstructor")); if ((con.CallingConvention & CallingConventions.Standard) != CallingConventions.Standard) - throw new ArgumentException(SR.Argument_BadConstructorCallConv); + throw new ArgumentException(Environment.GetResourceString("Argument_BadConstructorCallConv")); // Cache information used elsewhere. m_con = con; @@ -143,12 +143,12 @@ namespace System.Reflection.Emit // Since we're guaranteed a non-var calling convention, the number of arguments must equal the number of parameters. if (paramTypes.Length != constructorArgs.Length) - throw new ArgumentException(SR.Argument_BadParameterCountsForConstructor); + throw new ArgumentException(Environment.GetResourceString("Argument_BadParameterCountsForConstructor")); // Verify that the constructor has a valid signature (custom attributes only support a subset of our type system). for (i = 0; i < paramTypes.Length; i++) if (!ValidateType(paramTypes[i])) - throw new ArgumentException(SR.Argument_BadTypeInCustomAttribute); + throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeInCustomAttribute")); // Now verify that the types of the actual parameters are compatible with the types of the formal parameters. for (i = 0; i < paramTypes.Length; i++) @@ -195,11 +195,11 @@ namespace System.Reflection.Emit // Validate property type. if (!ValidateType(propType)) - throw new ArgumentException(SR.Argument_BadTypeInCustomAttribute); + throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeInCustomAttribute")); // Property has to be writable. if (!property.CanWrite) - throw new ArgumentException(SR.Argument_NotAWritableProperty); + throw new ArgumentException(Environment.GetResourceString("Argument_NotAWritableProperty")); // Property has to be from the same class or base class as ConstructorInfo. if (property.DeclaringType != con.DeclaringType @@ -217,7 +217,7 @@ namespace System.Reflection.Emit // type is one. if (!(property.DeclaringType is TypeBuilder) || !con.DeclaringType.IsSubclassOf(((TypeBuilder)property.DeclaringType).BakedRuntimeType)) - throw new ArgumentException(SR.Argument_BadPropertyForConstructorBuilder); + throw new ArgumentException(Environment.GetResourceString("Argument_BadPropertyForConstructorBuilder")); } } @@ -253,7 +253,7 @@ namespace System.Reflection.Emit // Validate field type. if (!ValidateType(fldType)) - throw new ArgumentException(SR.Argument_BadTypeInCustomAttribute); + throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeInCustomAttribute")); // Field has to be from the same class or base class as ConstructorInfo. if (namedField.DeclaringType != con.DeclaringType @@ -271,7 +271,7 @@ namespace System.Reflection.Emit // type is one. if (!(namedField.DeclaringType is TypeBuilder) || !con.DeclaringType.IsSubclassOf(((TypeBuilder)namedFields[i].DeclaringType).BakedRuntimeType)) - throw new ArgumentException(SR.Argument_BadFieldForConstructorBuilder); + throw new ArgumentException(Environment.GetResourceString("Argument_BadFieldForConstructorBuilder")); } } @@ -299,11 +299,11 @@ namespace System.Reflection.Emit { if (type != typeof(object) && Type.GetTypeCode(passedType) != Type.GetTypeCode(type)) { - throw new ArgumentException(SR.Argument_ConstantDoesntMatch); + throw new ArgumentException(Environment.GetResourceString("Argument_ConstantDoesntMatch")); } if (passedType == typeof(IntPtr) || passedType == typeof(UIntPtr)) { - throw new ArgumentException(SR.Argument_BadParameterTypeForCAB, paramName); + throw new ArgumentException(Environment.GetResourceString("Argument_BadParameterTypeForCAB"), paramName); } } @@ -453,7 +453,8 @@ namespace System.Reflection.Emit { String typeName = TypeNameBuilder.ToString((Type)value, TypeNameBuilder.Format.AssemblyQualifiedName); if (typeName == null) - throw new ArgumentException(SR.Format(SR.Argument_InvalidTypeForCA, value.GetType())); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidTypeForCA", + value.GetType())); EmitString(writer, typeName); } } @@ -526,7 +527,7 @@ namespace System.Reflection.Emit // value cannot be a "System.Object" object. // If we allow this we will get into an infinite recursion if (ot == typeof(object)) - throw new ArgumentException(SR.Format(SR.Argument_BadParameterTypeForCAB, ot.ToString())); + throw new ArgumentException(Environment.GetResourceString("Argument_BadParameterTypeForCAB", ot.ToString())); EmitType(writer, ot); EmitValue(writer, ot, value); @@ -538,7 +539,7 @@ namespace System.Reflection.Emit if (value != null) typename = value.GetType().ToString(); - throw new ArgumentException(SR.Format(SR.Argument_BadParameterTypeForCAB, typename)); + throw new ArgumentException(Environment.GetResourceString("Argument_BadParameterTypeForCAB", typename)); } } diff --git a/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs b/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs index b592053f9f..ec725acad7 100644 --- a/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs +++ b/src/mscorlib/src/System/Reflection/Emit/DynamicILGenerator.cs @@ -54,7 +54,7 @@ namespace System.Reflection.Emit RuntimeType rtType = localType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType")); localBuilder = new LocalBuilder(m_localCount, localType, m_methodBuilder); // add the localType to local signature @@ -81,7 +81,7 @@ namespace System.Reflection.Emit { RuntimeMethodInfo rtMeth = meth as RuntimeMethodInfo; if (rtMeth == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(meth)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), nameof(meth)); RuntimeType declaringType = rtMeth.GetRuntimeType(); if (declaringType != null && (declaringType.IsGenericType || declaringType.IsArray)) @@ -94,7 +94,7 @@ namespace System.Reflection.Emit // rule out not allowed operations on DynamicMethods if (opcode.Equals(OpCodes.Ldtoken) || opcode.Equals(OpCodes.Ldftn) || opcode.Equals(OpCodes.Ldvirtftn)) { - throw new ArgumentException(SR.Argument_InvalidOpCodeOnDynamicMethod); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOpCodeOnDynamicMethod")); } token = GetTokenFor(dynMeth); } @@ -132,7 +132,7 @@ namespace System.Reflection.Emit RuntimeConstructorInfo rtConstructor = con as RuntimeConstructorInfo; if (rtConstructor == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(con)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), nameof(con)); RuntimeType declaringType = rtConstructor.GetRuntimeType(); int token; @@ -161,7 +161,7 @@ namespace System.Reflection.Emit RuntimeType rtType = type as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType")); int token = GetTokenFor(rtType); EnsureCapacity(7); @@ -177,7 +177,7 @@ namespace System.Reflection.Emit RuntimeFieldInfo runtimeField = field as RuntimeFieldInfo; if (runtimeField == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeFieldInfo, nameof(field)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeFieldInfo"), nameof(field)); int token; if (field.DeclaringType == null) @@ -218,7 +218,7 @@ namespace System.Reflection.Emit if (optionalParameterTypes != null) if ((callingConvention & CallingConventions.VarArgs) == 0) - throw new InvalidOperationException(SR.InvalidOperation_NotAVarArgCallingConvention); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAVarArgCallingConvention")); sig = GetMemberRefSignature(callingConvention, returnType, @@ -254,13 +254,13 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(methodInfo)); if (!(opcode.Equals(OpCodes.Call) || opcode.Equals(OpCodes.Callvirt) || opcode.Equals(OpCodes.Newobj))) - throw new ArgumentException(SR.Argument_NotMethodCallOpcode, nameof(opcode)); + throw new ArgumentException(Environment.GetResourceString("Argument_NotMethodCallOpcode"), nameof(opcode)); if (methodInfo.ContainsGenericParameters) - throw new ArgumentException(SR.Argument_GenericsInvalid, nameof(methodInfo)); + throw new ArgumentException(Environment.GetResourceString("Argument_GenericsInvalid"), nameof(methodInfo)); if (methodInfo.DeclaringType != null && methodInfo.DeclaringType.ContainsGenericParameters) - throw new ArgumentException(SR.Argument_GenericsInvalid, nameof(methodInfo)); + throw new ArgumentException(Environment.GetResourceString("Argument_GenericsInvalid"), nameof(methodInfo)); Contract.EndContractBlock(); int tk; @@ -328,7 +328,7 @@ namespace System.Reflection.Emit // Begins an exception filter block. Emits a branch instruction to the end of the current exception block. if (CurrExcStackCount == 0) - throw new NotSupportedException(SR.Argument_NotInExceptionBlock); + throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock")); __ExceptionInfo current = CurrExcStack[CurrExcStackCount - 1]; @@ -342,7 +342,7 @@ namespace System.Reflection.Emit public override void BeginCatchBlock(Type exceptionType) { if (CurrExcStackCount == 0) - throw new NotSupportedException(SR.Argument_NotInExceptionBlock); + throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock")); Contract.EndContractBlock(); __ExceptionInfo current = CurrExcStack[CurrExcStackCount - 1]; @@ -353,7 +353,7 @@ namespace System.Reflection.Emit { if (exceptionType != null) { - throw new ArgumentException(SR.Argument_ShouldNotSpecifyExceptionType); + throw new ArgumentException(Environment.GetResourceString("Argument_ShouldNotSpecifyExceptionType")); } this.Emit(OpCodes.Endfilter); @@ -367,7 +367,7 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(exceptionType)); if (rtType == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType")); Label endLabel = current.GetEndLabel(); this.Emit(OpCodes.Leave, endLabel); @@ -392,7 +392,7 @@ namespace System.Reflection.Emit [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems. public override void UsingNamespace(String ns) { - throw new NotSupportedException(SR.InvalidOperation_NotAllowedInDynamicMethod); + throw new NotSupportedException(Environment.GetResourceString("InvalidOperation_NotAllowedInDynamicMethod")); } [SuppressMessage("Microsoft.Contracts", "CC1055")] // Skip extra error checking to avoid *potential* AppCompat problems. @@ -402,17 +402,17 @@ namespace System.Reflection.Emit int endLine, int endColumn) { - throw new NotSupportedException(SR.InvalidOperation_NotAllowedInDynamicMethod); + throw new NotSupportedException(Environment.GetResourceString("InvalidOperation_NotAllowedInDynamicMethod")); } public override void BeginScope() { - throw new NotSupportedException(SR.InvalidOperation_NotAllowedInDynamicMethod); + throw new NotSupportedException(Environment.GetResourceString("InvalidOperation_NotAllowedInDynamicMethod")); } public override void EndScope() { - throw new NotSupportedException(SR.InvalidOperation_NotAllowedInDynamicMethod); + throw new NotSupportedException(Environment.GetResourceString("InvalidOperation_NotAllowedInDynamicMethod")); } private int GetMemberRefToken(MethodBase methodInfo, Type[] optionalParameterTypes) @@ -420,13 +420,13 @@ namespace System.Reflection.Emit Type[] parameterTypes; if (optionalParameterTypes != null && (methodInfo.CallingConvention & CallingConventions.VarArgs) == 0) - throw new InvalidOperationException(SR.InvalidOperation_NotAVarArgCallingConvention); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAVarArgCallingConvention")); RuntimeMethodInfo rtMeth = methodInfo as RuntimeMethodInfo; DynamicMethod dm = methodInfo as DynamicMethod; if (rtMeth == null && dm == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, nameof(methodInfo)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), nameof(methodInfo)); ParameterInfo[] paramInfo = methodInfo.GetParametersNoCopy(); if (paramInfo != null && paramInfo.Length != 0) @@ -953,7 +953,7 @@ namespace System.Reflection.Emit Type t = m.DeclaringType.GetGenericTypeDefinition(); throw new ArgumentException(String.Format( - CultureInfo.CurrentCulture, SR.Argument_MethodDeclaringTypeGenericLcg, m, t)); + CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_MethodDeclaringTypeGenericLcg"), m, t)); } } diff --git a/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs b/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs index ef4d1ca833..953b39a5ae 100644 --- a/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs +++ b/src/mscorlib/src/System/Reflection/Emit/DynamicMethod.cs @@ -217,18 +217,18 @@ namespace System.Reflection.Emit { // only static public for method attributes if ((attributes & ~MethodAttributes.MemberAccessMask) != MethodAttributes.Static) - throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicMethodFlags")); if ((attributes & MethodAttributes.MemberAccessMask) != MethodAttributes.Public) - throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicMethodFlags")); Contract.EndContractBlock(); // only standard or varargs supported if (callingConvention != CallingConventions.Standard && callingConvention != CallingConventions.VarArgs) - throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicMethodFlags")); // vararg is not supported at the moment if (callingConvention == CallingConventions.VarArgs) - throw new NotSupportedException(SR.NotSupported_DynamicMethodFlags); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicMethodFlags")); } // We create a transparent assembly to host DynamicMethods. Since the assembly does not have any @@ -288,10 +288,10 @@ namespace System.Reflection.Emit for (int i = 0; i < signature.Length; i++) { if (signature[i] == null) - throw new ArgumentException(SR.Arg_InvalidTypeInSignature); + throw new ArgumentException(Environment.GetResourceString("Arg_InvalidTypeInSignature")); m_parameterTypes[i] = signature[i].UnderlyingSystemType as RuntimeType; if (m_parameterTypes[i] == null || !(m_parameterTypes[i] is RuntimeType) || m_parameterTypes[i] == (RuntimeType)typeof(void)) - throw new ArgumentException(SR.Arg_InvalidTypeInSignature); + throw new ArgumentException(Environment.GetResourceString("Arg_InvalidTypeInSignature")); } } else @@ -302,7 +302,7 @@ namespace System.Reflection.Emit // check and store the return value m_returnType = (returnType == null) ? (RuntimeType)typeof(void) : returnType.UnderlyingSystemType as RuntimeType; if ((m_returnType == null) || !(m_returnType is RuntimeType) || m_returnType.IsByRef) - throw new NotSupportedException(SR.Arg_InvalidTypeInRetType); + throw new NotSupportedException(Environment.GetResourceString("Arg_InvalidTypeInRetType")); if (transparentMethod) { @@ -331,7 +331,7 @@ namespace System.Reflection.Emit { if (rtOwner.HasElementType || rtOwner.ContainsGenericParameters || rtOwner.IsGenericParameter || rtOwner.IsInterface) - throw new ArgumentException(SR.Argument_InvalidTypeForDynamicMethod); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidTypeForDynamicMethod")); m_typeOwner = rtOwner; m_module = rtOwner.GetRuntimeModule(); @@ -400,7 +400,7 @@ namespace System.Reflection.Emit else { if (m_ilGenerator == null || m_ilGenerator.ILOffset == 0) - throw new InvalidOperationException(SR.Format(SR.InvalidOperation_BadEmptyMethodBody, Name)); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadEmptyMethodBody", Name)); m_ilGenerator.GetCallableMethod(m_module, this); } @@ -425,7 +425,7 @@ namespace System.Reflection.Emit public override Module Module { get { return m_dynMethod.Module; } } // we cannot return a MethodHandle because we cannot track it via GC so this method is off limits - public override RuntimeMethodHandle MethodHandle { get { throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInDynamicMethod); } } + public override RuntimeMethodHandle MethodHandle { get { throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInDynamicMethod")); } } public override MethodAttributes Attributes { get { return m_dynMethod.Attributes; } } @@ -465,7 +465,7 @@ namespace System.Reflection.Emit public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) { if ((CallingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs) - throw new NotSupportedException(SR.NotSupported_CallToVarArg); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_CallToVarArg")); Contract.EndContractBlock(); // @@ -486,7 +486,7 @@ namespace System.Reflection.Emit int formalCount = sig.Arguments.Length; int actualCount = (parameters != null) ? parameters.Length : 0; if (formalCount != actualCount) - throw new TargetParameterCountException(SR.Arg_ParmCnt); + throw new TargetParameterCountException(Environment.GetResourceString("Arg_ParmCnt")); // if we are here we passed all the previous checks. Time to look at the arguments Object retValue = null; @@ -529,7 +529,7 @@ namespace System.Reflection.Emit public ParameterBuilder DefineParameter(int position, ParameterAttributes attributes, String parameterName) { if (position < 0 || position > m_parameterTypes.Length) - throw new ArgumentOutOfRangeException(SR.ArgumentOutOfRange_ParamSequence); + throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_ParamSequence")); position--; // it's 1 based. 0 is the return value if (position >= 0) @@ -631,7 +631,7 @@ namespace System.Reflection.Emit public override RuntimeMethodHandle MethodHandle { - get { throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInDynamicMethod); } + get { throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInDynamicMethod")); } } public override MethodAttributes Attributes @@ -671,7 +671,7 @@ namespace System.Reflection.Emit // If we allowed use of RTDynamicMethod, the creator of the DynamicMethod would // not be able to bound access to the DynamicMethod. Hence, we do not allow // direct use of RTDynamicMethod. - throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo, "this"); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo"), "this"); } public override Object[] GetCustomAttributes(Type attributeType, bool inherit) diff --git a/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs index 55aa5c5a8f..aae90c2ed4 100644 --- a/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/EnumBuilder.cs @@ -199,7 +199,7 @@ namespace System.Reflection.Emit protected override PropertyInfo GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override PropertyInfo[] GetProperties(BindingFlags bindingAttr) @@ -410,7 +410,7 @@ namespace System.Reflection.Emit { // Client should not set any bits other than the visibility bits. if ((visibility & ~TypeAttributes.VisibilityMask) != 0) - throw new ArgumentException(SR.Argument_ShouldOnlySetVisibilityFlags, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_ShouldOnlySetVisibilityFlags"), nameof(name)); m_typeBuilder = new TypeBuilder(name, visibility | TypeAttributes.Sealed, typeof(System.Enum), null, module, PackingSize.Unspecified, TypeBuilder.UnspecifiedTypeSize, null); // Define the underlying field for the enum. It will be a non-static, private field with special name bit set. diff --git a/src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs index d0e9d3483c..ae28212732 100644 --- a/src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/FieldBuilder.cs @@ -31,16 +31,16 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(fieldName)); if (fieldName.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(fieldName)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(fieldName)); if (fieldName[0] == '\0') - throw new ArgumentException(SR.Argument_IllegalName, nameof(fieldName)); + throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), nameof(fieldName)); if (type == null) throw new ArgumentNullException(nameof(type)); if (type == typeof(void)) - throw new ArgumentException(SR.Argument_BadFieldType); + throw new ArgumentException(Environment.GetResourceString("Argument_BadFieldType")); Contract.EndContractBlock(); m_fieldName = fieldName; @@ -121,7 +121,7 @@ namespace System.Reflection.Emit // a NotSupportedException for Save-only dynamic assemblies. // Otherwise, it could cause the .cctor to be executed. - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override void SetValue(Object obj, Object val, BindingFlags invokeAttr, Binder binder, CultureInfo culture) @@ -130,12 +130,12 @@ namespace System.Reflection.Emit // a NotSupportedException for Save-only dynamic assemblies. // Otherwise, it could cause the .cctor to be executed. - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override RuntimeFieldHandle FieldHandle { - get { throw new NotSupportedException(SR.NotSupported_DynamicModule); } + get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } } public override FieldAttributes Attributes @@ -148,17 +148,17 @@ namespace System.Reflection.Emit #region ICustomAttributeProvider Implementation public override Object[] GetCustomAttributes(bool inherit) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override Object[] GetCustomAttributes(Type attributeType, bool inherit) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override bool IsDefined(Type attributeType, bool inherit) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } #endregion diff --git a/src/mscorlib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs index dd5ffa92a9..4538988c28 100644 --- a/src/mscorlib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/GenericTypeParameterBuilder.cs @@ -192,7 +192,7 @@ namespace System.Reflection.Emit public override Type GetGenericTypeDefinition() { throw new InvalidOperationException(); } - public override Type MakeGenericType(params Type[] typeArguments) { throw new InvalidOperationException(SR.Arg_NotGenericTypeDefinition); } + public override Type MakeGenericType(params Type[] typeArguments) { throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericTypeDefinition")); } protected override bool IsValueTypeImpl() { return false; } diff --git a/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs b/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs index 4021410a33..fe32417b2e 100644 --- a/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs +++ b/src/mscorlib/src/System/Reflection/Emit/ILGenerator.cs @@ -233,7 +233,7 @@ namespace System.Reflection.Emit if (m_currExcStackCount != 0) { - throw new ArgumentException(SR.Argument_UnclosedExceptionBlock); + throw new ArgumentException(Environment.GetResourceString("Argument_UnclosedExceptionBlock")); } if (m_length == 0) return null; @@ -261,7 +261,7 @@ namespace System.Reflection.Emit //Verify that our one-byte arg will fit into a Signed Byte. if (updateAddr < SByte.MinValue || updateAddr > SByte.MaxValue) { - throw new NotSupportedException(SR.Format(SR.NotSupported_IllegalOneByteBranch, m_fixupData[i].m_fixupPos, updateAddr)); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_IllegalOneByteBranch", m_fixupData[i].m_fixupPos, updateAddr)); } //Place the one-byte arg @@ -288,7 +288,7 @@ namespace System.Reflection.Emit __ExceptionInfo[] temp; if (m_currExcStackCount != 0) { - throw new NotSupportedException(SR.GetResourceString(ResId.Argument_UnclosedExceptionBlock)); + throw new NotSupportedException(Environment.GetResourceString(ResId.Argument_UnclosedExceptionBlock)); } if (m_exceptionCount == 0) @@ -342,10 +342,10 @@ namespace System.Reflection.Emit int index = lbl.GetLabelValue(); if (index < 0 || index >= m_labelCount) - throw new ArgumentException(SR.Argument_BadLabel); + throw new ArgumentException(Environment.GetResourceString("Argument_BadLabel")); if (m_labelList[index] < 0) - throw new ArgumentException(SR.Argument_BadLabelContent); + throw new ArgumentException(Environment.GetResourceString("Argument_BadLabelContent")); return m_labelList[index]; } @@ -503,7 +503,7 @@ namespace System.Reflection.Emit if ((callingConvention & CallingConventions.VarArgs) == 0) { // Client should not supply optional parameter in default calling convention - throw new InvalidOperationException(SR.InvalidOperation_NotAVarArgCallingConvention); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAVarArgCallingConvention")); } } @@ -542,7 +542,7 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(methodInfo)); if (!(opcode.Equals(OpCodes.Call) || opcode.Equals(OpCodes.Callvirt) || opcode.Equals(OpCodes.Newobj))) - throw new ArgumentException(SR.Argument_NotMethodCallOpcode, nameof(opcode)); + throw new ArgumentException(Environment.GetResourceString("Argument_NotMethodCallOpcode"), nameof(opcode)); Contract.EndContractBlock(); @@ -804,7 +804,7 @@ namespace System.Reflection.Emit int tempVal = local.GetLocalIndex(); if (local.GetMethodBuilder() != m_methodBuilder) { - throw new ArgumentException(SR.Argument_UnmatchedMethodForLocal, nameof(local)); + throw new ArgumentException(Environment.GetResourceString("Argument_UnmatchedMethodForLocal"), nameof(local)); } // If the instruction is a ldloc, ldloca a stloc, morph it to the optimal form. if (opcode.Equals(OpCodes.Ldloc)) @@ -872,7 +872,7 @@ namespace System.Reflection.Emit //Handle stloc_1, ldloc_1 if (tempVal > Byte.MaxValue) { - throw new InvalidOperationException(SR.InvalidOperation_BadInstructionOrIndexOutOfBound); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadInstructionOrIndexOutOfBound")); } m_ILStream[m_length++] = (byte)tempVal; } @@ -930,7 +930,7 @@ namespace System.Reflection.Emit { if (m_currExcStackCount == 0) { - throw new NotSupportedException(SR.Argument_NotInExceptionBlock); + throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock")); } // Pop the current exception block @@ -944,7 +944,7 @@ namespace System.Reflection.Emit if (state == __ExceptionInfo.State_Filter || state == __ExceptionInfo.State_Try) { - throw new InvalidOperationException(SR.Argument_BadExceptionCodeGen); + throw new InvalidOperationException(Environment.GetResourceString("Argument_BadExceptionCodeGen")); } if (state == __ExceptionInfo.State_Catch) @@ -975,7 +975,7 @@ namespace System.Reflection.Emit // Begins an exception filter block. Emits a branch instruction to the end of the current exception block. if (m_currExcStackCount == 0) - throw new NotSupportedException(SR.Argument_NotInExceptionBlock); + throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock")); __ExceptionInfo current = m_currExcStack[m_currExcStackCount - 1]; @@ -991,7 +991,7 @@ namespace System.Reflection.Emit if (m_currExcStackCount == 0) { - throw new NotSupportedException(SR.Argument_NotInExceptionBlock); + throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock")); } __ExceptionInfo current = m_currExcStack[m_currExcStackCount - 1]; @@ -999,7 +999,7 @@ namespace System.Reflection.Emit { if (exceptionType != null) { - throw new ArgumentException(SR.Argument_ShouldNotSpecifyExceptionType); + throw new ArgumentException(Environment.GetResourceString("Argument_ShouldNotSpecifyExceptionType")); } this.Emit(OpCodes.Endfilter); @@ -1023,7 +1023,7 @@ namespace System.Reflection.Emit { if (m_currExcStackCount == 0) { - throw new NotSupportedException(SR.Argument_NotInExceptionBlock); + throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock")); } __ExceptionInfo current = m_currExcStack[m_currExcStackCount - 1]; @@ -1038,7 +1038,7 @@ namespace System.Reflection.Emit { if (m_currExcStackCount == 0) { - throw new NotSupportedException(SR.Argument_NotInExceptionBlock); + throw new NotSupportedException(Environment.GetResourceString("Argument_NotInExceptionBlock")); } __ExceptionInfo current = m_currExcStack[m_currExcStackCount - 1]; int state = current.GetCurrentState(); @@ -1097,12 +1097,12 @@ namespace System.Reflection.Emit //This should never happen. if (labelIndex < 0 || labelIndex >= m_labelList.Length) { - throw new ArgumentException(SR.Argument_InvalidLabel); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidLabel")); } if (m_labelList[labelIndex] != -1) { - throw new ArgumentException(SR.Argument_RedefinedLabel); + throw new ArgumentException(Environment.GetResourceString("Argument_RedefinedLabel")); } m_labelList[labelIndex] = m_length; @@ -1122,13 +1122,13 @@ namespace System.Reflection.Emit if (!excType.IsSubclassOf(typeof(Exception)) && excType != typeof(Exception)) { - throw new ArgumentException(SR.Argument_NotExceptionType); + throw new ArgumentException(Environment.GetResourceString("Argument_NotExceptionType")); } Contract.EndContractBlock(); ConstructorInfo con = excType.GetConstructor(Type.EmptyTypes); if (con == null) { - throw new ArgumentException(SR.Argument_MissingDefaultConstructor); + throw new ArgumentException(Environment.GetResourceString("Argument_MissingDefaultConstructor")); } this.Emit(OpCodes.Newobj, con); this.Emit(OpCodes.Throw); @@ -1162,7 +1162,7 @@ namespace System.Reflection.Emit Object cls; if (m_methodBuilder == null) { - throw new ArgumentException(SR.InvalidOperation_BadILGeneratorUsage); + throw new ArgumentException(Environment.GetResourceString("InvalidOperation_BadILGeneratorUsage")); } MethodInfo prop = GetConsoleType().GetMethod("get_Out"); @@ -1172,13 +1172,13 @@ namespace System.Reflection.Emit cls = localBuilder.LocalType; if (cls is TypeBuilder || cls is EnumBuilder) { - throw new ArgumentException(SR.NotSupported_OutputStreamUsingTypeBuilder); + throw new ArgumentException(Environment.GetResourceString("NotSupported_OutputStreamUsingTypeBuilder")); } parameterTypes[0] = (Type)cls; MethodInfo mi = prop.ReturnType.GetMethod("WriteLine", parameterTypes); if (mi == null) { - throw new ArgumentException(SR.Argument_EmitWriteLineType, nameof(localBuilder)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmitWriteLineType"), nameof(localBuilder)); } Emit(OpCodes.Callvirt, mi); @@ -1215,13 +1215,13 @@ namespace System.Reflection.Emit cls = fld.FieldType; if (cls is TypeBuilder || cls is EnumBuilder) { - throw new NotSupportedException(SR.NotSupported_OutputStreamUsingTypeBuilder); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_OutputStreamUsingTypeBuilder")); } parameterTypes[0] = (Type)cls; MethodInfo mi = prop.ReturnType.GetMethod("WriteLine", parameterTypes); if (mi == null) { - throw new ArgumentException(SR.Argument_EmitWriteLineType, nameof(fld)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmitWriteLineType"), nameof(fld)); } Emit(OpCodes.Callvirt, mi); } @@ -1248,7 +1248,7 @@ namespace System.Reflection.Emit if (methodBuilder.IsTypeCreated()) { // cannot change method after its containing type has been created - throw new InvalidOperationException(SR.InvalidOperation_TypeHasBeenCreated); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TypeHasBeenCreated")); } if (localType == null) @@ -1258,7 +1258,7 @@ namespace System.Reflection.Emit if (methodBuilder.m_bIsBaked) { - throw new InvalidOperationException(SR.InvalidOperation_MethodBaked); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_MethodBaked")); } // add the localType to local signature @@ -1278,7 +1278,7 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(usingNamespace)); if (usingNamespace.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(usingNamespace)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(usingNamespace)); Contract.EndContractBlock(); int index; @@ -1477,7 +1477,7 @@ namespace System.Reflection.Emit { if (m_endFinally != -1) { - throw new ArgumentException(SR.Argument_TooManyFinallyClause); + throw new ArgumentException(Environment.GetResourceString("Argument_TooManyFinallyClause")); } else { @@ -1680,7 +1680,7 @@ namespace System.Reflection.Emit { if (sa == ScopeAction.Close && m_iOpenScopeCount <= 0) { - throw new ArgumentException(SR.Argument_UnmatchingSymScope); + throw new ArgumentException(Environment.GetResourceString("Argument_UnmatchingSymScope")); } Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/Reflection/Emit/LocalBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/LocalBuilder.cs index c04c3c8434..42165075b4 100644 --- a/src/mscorlib/src/System/Reflection/Emit/LocalBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/LocalBuilder.cs @@ -76,14 +76,14 @@ namespace System.Reflection.Emit if (methodBuilder.IsTypeCreated()) { // cannot change method after its containing type has been created - throw new InvalidOperationException(SR.InvalidOperation_TypeHasBeenCreated); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TypeHasBeenCreated")); } // set the name and range of offset for the local if (dynMod.GetSymWriter() == null) { // cannot set local name if not debug module - throw new InvalidOperationException(SR.InvalidOperation_NotADebugModule); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotADebugModule")); } sigHelp = SignatureHelper.GetFieldSigHelper(dynMod); diff --git a/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs index 73882584a5..ee4c68ebf4 100644 --- a/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/MethodBuilder.cs @@ -84,10 +84,10 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(name)); if (name.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name)); if (name[0] == '\0') - throw new ArgumentException(SR.Argument_IllegalName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), nameof(name)); if (mod == null) throw new ArgumentNullException(nameof(mod)); @@ -124,7 +124,7 @@ namespace System.Reflection.Emit else if ((attributes & MethodAttributes.Virtual) != 0) { // A method can't be both static and virtual - throw new ArgumentException(SR.Arg_NoStaticVirtual); + throw new ArgumentException(Environment.GetResourceString("Arg_NoStaticVirtual")); } if ((attributes & MethodAttributes.SpecialName) != MethodAttributes.SpecialName) @@ -135,7 +135,7 @@ namespace System.Reflection.Emit if ((attributes & (MethodAttributes.Abstract | MethodAttributes.Virtual)) != (MethodAttributes.Abstract | MethodAttributes.Virtual) && (attributes & MethodAttributes.Static) == 0) - throw new ArgumentException(SR.Argument_BadAttributeOnInterfaceMethod); + throw new ArgumentException(Environment.GetResourceString("Argument_BadAttributeOnInterfaceMethod")); } } @@ -212,7 +212,7 @@ namespace System.Reflection.Emit if (m_bIsBaked) { - throw new InvalidOperationException(SR.InvalidOperation_MethodHasBody); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_MethodHasBody")); } if (il.m_methodBuilder != this && il.m_methodBuilder != null) @@ -221,7 +221,7 @@ namespace System.Reflection.Emit // through MethodBuilder::GetILGenerator. // - throw new InvalidOperationException(SR.InvalidOperation_BadILGeneratorUsage); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadILGeneratorUsage")); } ThrowIfShouldNotHaveBody(); @@ -229,7 +229,7 @@ namespace System.Reflection.Emit if (il.m_ScopeTree.m_iOpenScopeCount != 0) { // There are still unclosed local scope - throw new InvalidOperationException(SR.InvalidOperation_OpenLocalVariableScope); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_OpenLocalVariableScope")); } @@ -559,7 +559,7 @@ namespace System.Reflection.Emit #region MethodBase Overrides public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override MethodImplAttributes GetMethodImplementationFlags() @@ -579,7 +579,7 @@ namespace System.Reflection.Emit public override RuntimeMethodHandle MethodHandle { - get { throw new NotSupportedException(SR.NotSupported_DynamicModule); } + get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } } public override bool IsSecurityCritical @@ -616,7 +616,7 @@ namespace System.Reflection.Emit public override ParameterInfo[] GetParameters() { if (!m_bIsBaked || m_containingType == null || m_containingType.BakedRuntimeType == null) - throw new NotSupportedException(SR.InvalidOperation_TypeNotCreated); + throw new NotSupportedException(Environment.GetResourceString("InvalidOperation_TypeNotCreated")); MethodInfo rmi = m_containingType.GetMethod(m_strName, m_parameterTypes); @@ -628,7 +628,7 @@ namespace System.Reflection.Emit get { if (!m_bIsBaked || m_containingType == null || m_containingType.BakedRuntimeType == null) - throw new InvalidOperationException(SR.InvalidOperation_TypeNotCreated); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TypeNotCreated")); MethodInfo rmi = m_containingType.GetMethod(m_strName, m_parameterTypes); @@ -640,17 +640,17 @@ namespace System.Reflection.Emit #region ICustomAttributeProvider Implementation public override Object[] GetCustomAttributes(bool inherit) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override Object[] GetCustomAttributes(Type attributeType, bool inherit) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override bool IsDefined(Type attributeType, bool inherit) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } #endregion @@ -678,18 +678,18 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(names)); if (names.Length == 0) - throw new ArgumentException(SR.Arg_EmptyArray, nameof(names)); + throw new ArgumentException(Environment.GetResourceString("Arg_EmptyArray"), nameof(names)); Contract.EndContractBlock(); if (m_inst != null) - throw new InvalidOperationException(SR.InvalidOperation_GenericParametersAlreadySet); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_GenericParametersAlreadySet")); for (int i = 0; i < names.Length; i++) if (names[i] == null) throw new ArgumentNullException(nameof(names)); if (m_tkMethod.Token != 0) - throw new InvalidOperationException(SR.InvalidOperation_MethodBuilderBaked); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_MethodBuilderBaked")); m_bIsGenMethDef = true; m_inst = new GenericTypeParameterBuilder[names.Length]; @@ -824,14 +824,14 @@ namespace System.Reflection.Emit public ParameterBuilder DefineParameter(int position, ParameterAttributes attributes, String strParamName) { if (position < 0) - throw new ArgumentOutOfRangeException(SR.ArgumentOutOfRange_ParamSequence); + throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_ParamSequence")); Contract.EndContractBlock(); ThrowIfGeneric(); m_containingType.ThrowIfCreated(); if (position > 0 && (m_parameterTypes == null || position > m_parameterTypes.Length)) - throw new ArgumentOutOfRangeException(SR.ArgumentOutOfRange_ParamSequence); + throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_ParamSequence")); attributes = attributes & ~ParameterAttributes.ReservedMask; return new ParameterBuilder(this, position, attributes, strParamName); @@ -890,7 +890,7 @@ namespace System.Reflection.Emit { // cannot attach method body if methodimpl is marked not marked as managed IL // - throw new InvalidOperationException(SR.InvalidOperation_ShouldNotHaveMethodBody); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ShouldNotHaveMethodBody")); } } diff --git a/src/mscorlib/src/System/Reflection/Emit/MethodBuilderInstantiation.cs b/src/mscorlib/src/System/Reflection/Emit/MethodBuilderInstantiation.cs index 2d0a9b41dd..ad5cc70a30 100644 --- a/src/mscorlib/src/System/Reflection/Emit/MethodBuilderInstantiation.cs +++ b/src/mscorlib/src/System/Reflection/Emit/MethodBuilderInstantiation.cs @@ -59,7 +59,7 @@ namespace System.Reflection.Emit [Pure] public override ParameterInfo[] GetParameters() { throw new NotSupportedException(); } public override MethodImplAttributes GetMethodImplementationFlags() { return m_method.GetMethodImplementationFlags(); } - public override RuntimeMethodHandle MethodHandle { get { throw new NotSupportedException(SR.NotSupported_DynamicModule); } } + public override RuntimeMethodHandle MethodHandle { get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } } public override MethodAttributes Attributes { get { return m_method.Attributes; } } public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) { @@ -88,7 +88,7 @@ namespace System.Reflection.Emit public override MethodInfo MakeGenericMethod(params Type[] arguments) { - throw new InvalidOperationException(SR.Arg_NotGenericMethodDefinition); + throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericMethodDefinition")); } public override bool IsGenericMethod { get { return true; } } diff --git a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs index d92d8220b8..13ae4ee9ec 100644 --- a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilder.cs @@ -120,7 +120,7 @@ namespace System.Reflection.Emit object.ReferenceEquals(foundType.DeclaringType, enclosingType)) { // Cannot have two types with the same name - throw new ArgumentException(SR.Argument_DuplicateTypeName); + throw new ArgumentException(Environment.GetResourceString("Argument_DuplicateTypeName")); } } @@ -308,7 +308,7 @@ namespace System.Reflection.Emit // go through the slower code path, i.e. retrieve parameters and form signature helper. ParameterInfo[] parameters = con.GetParameters(); if (parameters == null) - throw new ArgumentException(SR.Argument_InvalidConstructorInfo); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidConstructorInfo")); Type[] parameterTypes = new Type[parameters.Length]; Type[][] requiredCustomModifiers = new Type[parameters.Length][]; @@ -317,7 +317,7 @@ namespace System.Reflection.Emit for (int i = 0; i < parameters.Length; i++) { if (parameters[i] == null) - throw new ArgumentException(SR.Argument_InvalidConstructorInfo); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidConstructorInfo")); parameterTypes[i] = parameters[i].ParameterType; requiredCustomModifiers[i] = parameters[i].GetRequiredCustomModifiers(); @@ -409,7 +409,7 @@ namespace System.Reflection.Emit if ((method.CallingConvention & CallingConventions.VarArgs) == 0) { // Client should not supply optional parameter in default calling convention - throw new InvalidOperationException(SR.InvalidOperation_NotAVarArgCallingConvention); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAVarArgCallingConvention")); } } @@ -1010,16 +1010,16 @@ namespace System.Reflection.Emit Type[] parameterTypes, Type[][] requiredParameterTypeCustomModifiers, Type[][] optionalParameterTypeCustomModifiers) { if (m_moduleData.m_fGlobalBeenCreated == true) - throw new InvalidOperationException(SR.InvalidOperation_GlobalsHaveBeenCreated); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_GlobalsHaveBeenCreated")); if (name == null) throw new ArgumentNullException(nameof(name)); if (name.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name)); if ((attributes & MethodAttributes.Static) == 0) - throw new ArgumentException(SR.Argument_GlobalFunctionHasToBeStatic); + throw new ArgumentException(Environment.GetResourceString("Argument_GlobalFunctionHasToBeStatic")); Contract.Ensures(Contract.Result<MethodBuilder>() != null); Contract.EndContractBlock(); @@ -1048,7 +1048,7 @@ namespace System.Reflection.Emit if (m_moduleData.m_fGlobalBeenCreated) { // cannot create globals twice - throw new InvalidOperationException(SR.InvalidOperation_NotADebugModule); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotADebugModule")); } m_moduleData.m_globalTypeBuilder.CreateType(); m_moduleData.m_fGlobalBeenCreated = true; @@ -1078,7 +1078,7 @@ namespace System.Reflection.Emit // will be the signature for the Field. if (m_moduleData.m_fGlobalBeenCreated == true) { - throw new InvalidOperationException(SR.InvalidOperation_GlobalsHaveBeenCreated); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_GlobalsHaveBeenCreated")); } Contract.Ensures(Contract.Result<FieldBuilder>() != null); Contract.EndContractBlock(); @@ -1105,7 +1105,7 @@ namespace System.Reflection.Emit if (m_moduleData.m_fGlobalBeenCreated == true) { - throw new InvalidOperationException(SR.InvalidOperation_GlobalsHaveBeenCreated); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_GlobalsHaveBeenCreated")); } Contract.Ensures(Contract.Result<FieldBuilder>() != null); Contract.EndContractBlock(); @@ -1158,7 +1158,7 @@ namespace System.Reflection.Emit // We should also be aware of multiple dynamic modules and multiple implementation of Type!!! if (type.IsByRef) - throw new ArgumentException(SR.Argument_CannotGetTypeTokenForByRef); + throw new ArgumentException(Environment.GetResourceString("Argument_CannotGetTypeTokenForByRef")); if ((type.IsGenericType && (!type.IsGenericTypeDefinition || !getGenericDefinition)) || type.IsGenericParameter || @@ -1275,7 +1275,7 @@ namespace System.Reflection.Emit return new MethodToken(methodToken); if (method.DeclaringType == null) - throw new InvalidOperationException(SR.InvalidOperation_CannotImportGlobalFromDifferentModule); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotImportGlobalFromDifferentModule")); // method is defined in a different module tr = getGenericTypeDefinition ? GetTypeToken(method.DeclaringType).Token : GetTypeTokenInternal(method.DeclaringType).Token; @@ -1299,7 +1299,7 @@ namespace System.Reflection.Emit // We need to get the TypeRef tokens if (declaringType == null) - throw new InvalidOperationException(SR.InvalidOperation_CannotImportGlobalFromDifferentModule); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotImportGlobalFromDifferentModule")); RuntimeMethodInfo rtMeth = null; @@ -1448,10 +1448,10 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(methodName)); if (methodName.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(methodName)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(methodName)); if (arrayClass.IsArray == false) - throw new ArgumentException(SR.Argument_HasToBeArrayClass); + throw new ArgumentException(Environment.GetResourceString("Argument_HasToBeArrayClass")); Contract.EndContractBlock(); CheckContext(returnType, arrayClass); @@ -1537,7 +1537,7 @@ namespace System.Reflection.Emit // field is defined in a different module if (field.DeclaringType == null) { - throw new InvalidOperationException(SR.InvalidOperation_CannotImportGlobalFromDifferentModule); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotImportGlobalFromDifferentModule")); } tr = GetTypeTokenInternal(field.DeclaringType).Token; mr = GetMemberRef(field.ReflectedType.Module, tr, fdBuilder.GetToken().Token); @@ -1550,7 +1550,7 @@ namespace System.Reflection.Emit // We need to get the TypeRef tokens if (field.DeclaringType == null) { - throw new InvalidOperationException(SR.InvalidOperation_CannotImportGlobalFromDifferentModule); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotImportGlobalFromDifferentModule")); } if (field.DeclaringType != null && field.DeclaringType.IsGenericType) @@ -1718,7 +1718,7 @@ namespace System.Reflection.Emit if (m_iSymWriter == null) { // Cannot DefineDocument when it is not a debug module - throw new InvalidOperationException(SR.InvalidOperation_NotADebugModule); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotADebugModule")); } return m_iSymWriter.DefineDocument(url, language, languageVendor, documentType); diff --git a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs index 4f1b8eb713..c0af6ba7db 100644 --- a/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs +++ b/src/mscorlib/src/System/Reflection/Emit/ModuleBuilderData.cs @@ -46,7 +46,7 @@ namespace System.Reflection.Emit if (strExtension == null || strExtension == String.Empty) { // This is required by our loader. It cannot load module file that does not have file extension. - throw new ArgumentException(SR.Format(SR.Argument_NoModuleFileExtension, strFileName)); + throw new ArgumentException(Environment.GetResourceString("Argument_NoModuleFileExtension", strFileName)); } m_strFileName = strFileName; } diff --git a/src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs index 6dbcba251f..da087dcea7 100644 --- a/src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/PropertyBuilder.cs @@ -44,9 +44,9 @@ namespace System.Reflection.Emit if (name == null) throw new ArgumentNullException(nameof(name)); if (name.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name)); if (name[0] == '\0') - throw new ArgumentException(SR.Argument_IllegalName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), nameof(name)); Contract.EndContractBlock(); m_name = name; @@ -153,27 +153,27 @@ namespace System.Reflection.Emit // Not supported functions in dynamic module. public override Object GetValue(Object obj, Object[] index) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override Object GetValue(Object obj, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override void SetValue(Object obj, Object value, Object[] index) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override void SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, Object[] index, CultureInfo culture) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override MethodInfo[] GetAccessors(bool nonPublic) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override MethodInfo GetGetMethod(bool nonPublic) @@ -198,7 +198,7 @@ namespace System.Reflection.Emit public override ParameterInfo[] GetIndexParameters() { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override Type PropertyType @@ -223,17 +223,17 @@ namespace System.Reflection.Emit public override Object[] GetCustomAttributes(bool inherit) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override Object[] GetCustomAttributes(Type attributeType, bool inherit) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override bool IsDefined(Type attributeType, bool inherit) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override String Name diff --git a/src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs b/src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs index fd1a8e70fe..eb5df8c8db 100644 --- a/src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs +++ b/src/mscorlib/src/System/Reflection/Emit/SignatureHelper.cs @@ -114,7 +114,7 @@ namespace System.Reflection.Emit } else { - throw new ArgumentException(SR.Argument_UnknownUnmanagedCallConv, nameof(unmanagedCallConv)); + throw new ArgumentException(Environment.GetResourceString("Argument_UnknownUnmanagedCallConv"), nameof(unmanagedCallConv)); } sigHelp = new SignatureHelper(mod, intCall, returnType, null, null); @@ -217,7 +217,7 @@ namespace System.Reflection.Emit Init(mod, callingConvention, cGenericParameters); if (callingConvention == MdSigCallingConvention.Field) - throw new ArgumentException(SR.Argument_BadFieldSig); + throw new ArgumentException(Environment.GetResourceString("Argument_BadFieldSig")); AddOneArgTypeHelper(returnType, requiredCustomModifiers, optionalCustomModifiers); } @@ -245,7 +245,7 @@ namespace System.Reflection.Emit m_sizeLoc = NO_SIZE_IN_SIG; if (m_module == null && mod != null) - throw new ArgumentException(SR.NotSupported_MustBeModuleBuilder); + throw new ArgumentException(Environment.GetResourceString("NotSupported_MustBeModuleBuilder")); } private void Init(Module mod, MdSigCallingConvention callingConvention) @@ -302,10 +302,10 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(optionalCustomModifiers)); if (t.HasElementType) - throw new ArgumentException(SR.Argument_ArraysInvalid, nameof(optionalCustomModifiers)); + throw new ArgumentException(Environment.GetResourceString("Argument_ArraysInvalid"), nameof(optionalCustomModifiers)); if (t.ContainsGenericParameters) - throw new ArgumentException(SR.Argument_GenericsInvalid, nameof(optionalCustomModifiers)); + throw new ArgumentException(Environment.GetResourceString("Argument_GenericsInvalid"), nameof(optionalCustomModifiers)); AddElementType(CorElementType.CModOpt); @@ -325,10 +325,10 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(requiredCustomModifiers)); if (t.HasElementType) - throw new ArgumentException(SR.Argument_ArraysInvalid, nameof(requiredCustomModifiers)); + throw new ArgumentException(Environment.GetResourceString("Argument_ArraysInvalid"), nameof(requiredCustomModifiers)); if (t.ContainsGenericParameters) - throw new ArgumentException(SR.Argument_GenericsInvalid, nameof(requiredCustomModifiers)); + throw new ArgumentException(Environment.GetResourceString("Argument_GenericsInvalid"), nameof(requiredCustomModifiers)); AddElementType(CorElementType.CModReqd); @@ -510,7 +510,7 @@ namespace System.Reflection.Emit } else { - throw new ArgumentException(SR.Argument_LargeInteger); + throw new ArgumentException(Environment.GetResourceString("Argument_LargeInteger")); } } @@ -535,7 +535,7 @@ namespace System.Reflection.Emit if (rid > 0x3FFFFFF) { // token is too big to be compressed - throw new ArgumentException(SR.Argument_LargeInteger); + throw new ArgumentException(Environment.GetResourceString("Argument_LargeInteger")); } rid = (rid << 2); @@ -755,7 +755,7 @@ namespace System.Reflection.Emit temp[sigCopyIndex++] = (byte)((argCount) & 0xFF); } else - throw new ArgumentException(SR.Argument_LargeInteger); + throw new ArgumentException(Environment.GetResourceString("Argument_LargeInteger")); // copy the sig part of the sig Buffer.BlockCopy(m_signature, 2, temp, sigCopyIndex, currSigLength - 2); // mark the end of sig @@ -784,10 +784,10 @@ namespace System.Reflection.Emit public void AddArguments(Type[] arguments, Type[][] requiredCustomModifiers, Type[][] optionalCustomModifiers) { if (requiredCustomModifiers != null && (arguments == null || requiredCustomModifiers.Length != arguments.Length)) - throw new ArgumentException(SR.Format(SR.Argument_MismatchedArrays, nameof(requiredCustomModifiers), nameof(arguments))); + throw new ArgumentException(Environment.GetResourceString("Argument_MismatchedArrays", nameof(requiredCustomModifiers), nameof(arguments))); if (optionalCustomModifiers != null && (arguments == null || optionalCustomModifiers.Length != arguments.Length)) - throw new ArgumentException(SR.Format(SR.Argument_MismatchedArrays, nameof(optionalCustomModifiers), nameof(arguments))); + throw new ArgumentException(Environment.GetResourceString("Argument_MismatchedArrays", nameof(optionalCustomModifiers), nameof(arguments))); if (arguments != null) { @@ -803,7 +803,7 @@ namespace System.Reflection.Emit public void AddArgument(Type argument, Type[] requiredCustomModifiers, Type[] optionalCustomModifiers) { if (m_sigDone) - throw new ArgumentException(SR.Argument_SigIsFinalized); + throw new ArgumentException(Environment.GetResourceString("Argument_SigIsFinalized")); if (argument == null) throw new ArgumentNullException(nameof(argument)); diff --git a/src/mscorlib/src/System/Reflection/Emit/SymbolMethod.cs b/src/mscorlib/src/System/Reflection/Emit/SymbolMethod.cs index 4c4cd15922..d82e271672 100644 --- a/src/mscorlib/src/System/Reflection/Emit/SymbolMethod.cs +++ b/src/mscorlib/src/System/Reflection/Emit/SymbolMethod.cs @@ -99,17 +99,17 @@ namespace System.Reflection.Emit [Pure] public override ParameterInfo[] GetParameters() { - throw new NotSupportedException(SR.NotSupported_SymbolMethod); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod")); } public override MethodImplAttributes GetMethodImplementationFlags() { - throw new NotSupportedException(SR.NotSupported_SymbolMethod); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod")); } public override MethodAttributes Attributes { - get { throw new NotSupportedException(SR.NotSupported_SymbolMethod); } + get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod")); } } public override CallingConventions CallingConvention @@ -119,7 +119,7 @@ namespace System.Reflection.Emit public override RuntimeMethodHandle MethodHandle { - get { throw new NotSupportedException(SR.NotSupported_SymbolMethod); } + get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod")); } } #endregion @@ -140,7 +140,7 @@ namespace System.Reflection.Emit public override Object Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) { - throw new NotSupportedException(SR.NotSupported_SymbolMethod); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod")); } public override MethodInfo GetBaseDefinition() @@ -152,17 +152,17 @@ namespace System.Reflection.Emit #region ICustomAttributeProvider Implementation public override Object[] GetCustomAttributes(bool inherit) { - throw new NotSupportedException(SR.NotSupported_SymbolMethod); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod")); } public override Object[] GetCustomAttributes(Type attributeType, bool inherit) { - throw new NotSupportedException(SR.NotSupported_SymbolMethod); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod")); } public override bool IsDefined(Type attributeType, bool inherit) { - throw new NotSupportedException(SR.NotSupported_SymbolMethod); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_SymbolMethod")); } #endregion diff --git a/src/mscorlib/src/System/Reflection/Emit/SymbolType.cs b/src/mscorlib/src/System/Reflection/Emit/SymbolType.cs index 16848b43dd..bfe9ce0fe5 100644 --- a/src/mscorlib/src/System/Reflection/Emit/SymbolType.cs +++ b/src/mscorlib/src/System/Reflection/Emit/SymbolType.cs @@ -66,7 +66,7 @@ namespace System.Reflection.Emit if (curIndex != format.Length) // ByRef has to be the last char!! - throw new ArgumentException(SR.Argument_BadSigFormat); + throw new ArgumentException(Environment.GetResourceString("Argument_BadSigFormat")); symbolType.SetElementType(baseType); return symbolType; @@ -128,7 +128,7 @@ namespace System.Reflection.Emit if (format[curIndex] != '.') { // bad format!! Throw exception - throw new ArgumentException(SR.Argument_BadSigFormat); + throw new ArgumentException(Environment.GetResourceString("Argument_BadSigFormat")); } curIndex++; @@ -158,7 +158,7 @@ namespace System.Reflection.Emit { // User specified upper bound less than lower bound, this is an error. // Throw error exception. - throw new ArgumentException(SR.Argument_BadSigFormat); + throw new ArgumentException(Environment.GetResourceString("Argument_BadSigFormat")); } } } @@ -176,7 +176,7 @@ namespace System.Reflection.Emit } else if (format[curIndex] != ']') { - throw new ArgumentException(SR.Argument_BadSigFormat); + throw new ArgumentException(Environment.GetResourceString("Argument_BadSigFormat")); } } @@ -313,7 +313,7 @@ namespace System.Reflection.Emit public override int GetArrayRank() { if (!IsArray) - throw new NotSupportedException(SR.NotSupported_SubclassOverride); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_SubclassOverride")); Contract.EndContractBlock(); return m_cRank; @@ -321,13 +321,13 @@ namespace System.Reflection.Emit public override Guid GUID { - get { throw new NotSupportedException(SR.NotSupported_NonReflectedType); } + get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } } public override Object InvokeMember(String name, BindingFlags invokeAttr, Binder binder, Object target, Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override Module Module @@ -355,7 +355,7 @@ namespace System.Reflection.Emit public override RuntimeTypeHandle TypeHandle { - get { throw new NotSupportedException(SR.NotSupported_NonReflectedType); } + get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } } public override String Name @@ -406,94 +406,94 @@ namespace System.Reflection.Emit protected override ConstructorInfo GetConstructorImpl(BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } protected override MethodInfo GetMethodImpl(String name, BindingFlags bindingAttr, Binder binder, CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override MethodInfo[] GetMethods(BindingFlags bindingAttr) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override FieldInfo GetField(String name, BindingFlags bindingAttr) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override FieldInfo[] GetFields(BindingFlags bindingAttr) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override Type GetInterface(String name, bool ignoreCase) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override Type[] GetInterfaces() { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override EventInfo GetEvent(String name, BindingFlags bindingAttr) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override EventInfo[] GetEvents() { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } protected override PropertyInfo GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override PropertyInfo[] GetProperties(BindingFlags bindingAttr) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override Type[] GetNestedTypes(BindingFlags bindingAttr) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override Type GetNestedType(String name, BindingFlags bindingAttr) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override MemberInfo[] GetMember(String name, MemberTypes type, BindingFlags bindingAttr) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override MemberInfo[] GetMembers(BindingFlags bindingAttr) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override InterfaceMapping GetInterfaceMap(Type interfaceType) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override EventInfo[] GetEvents(BindingFlags bindingAttr) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } protected override TypeAttributes GetAttributeFlagsImpl() @@ -559,17 +559,17 @@ namespace System.Reflection.Emit public override Object[] GetCustomAttributes(bool inherit) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override Object[] GetCustomAttributes(Type attributeType, bool inherit) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } public override bool IsDefined(Type attributeType, bool inherit) { - throw new NotSupportedException(SR.NotSupported_NonReflectedType); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NonReflectedType")); } #endregion } diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs index bfd2c96064..b4cba17668 100644 --- a/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs +++ b/src/mscorlib/src/System/Reflection/Emit/TypeBuilder.cs @@ -90,7 +90,7 @@ namespace System.Reflection.Emit public static MethodInfo GetMethod(Type type, MethodInfo method) { if (!(type is TypeBuilder) && !(type is TypeBuilderInstantiation)) - throw new ArgumentException(SR.Argument_MustBeTypeBuilder); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeTypeBuilder")); // The following checks establishes invariants that more simply put require type to be generic and // method to be a generic method definition declared on the generic type definition of type. @@ -100,13 +100,13 @@ namespace System.Reflection.Emit // if we wanted to but that just complicates things so these checks are designed to prevent that scenario. if (method.IsGenericMethod && !method.IsGenericMethodDefinition) - throw new ArgumentException(SR.Argument_NeedGenericMethodDefinition, nameof(method)); + throw new ArgumentException(Environment.GetResourceString("Argument_NeedGenericMethodDefinition"), nameof(method)); if (method.DeclaringType == null || !method.DeclaringType.IsGenericTypeDefinition) - throw new ArgumentException(SR.Argument_MethodNeedGenericDeclaringType, nameof(method)); + throw new ArgumentException(Environment.GetResourceString("Argument_MethodNeedGenericDeclaringType"), nameof(method)); if (type.GetGenericTypeDefinition() != method.DeclaringType) - throw new ArgumentException(SR.Argument_InvalidMethodDeclaringType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidMethodDeclaringType"), nameof(type)); Contract.EndContractBlock(); // The following converts from Type or TypeBuilder of G<T> to TypeBuilderInstantiation G<T>. These types @@ -116,49 +116,49 @@ namespace System.Reflection.Emit type = type.MakeGenericType(type.GetGenericArguments()); if (!(type is TypeBuilderInstantiation)) - throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(type)); return MethodOnTypeBuilderInstantiation.GetMethod(method, type as TypeBuilderInstantiation); } public static ConstructorInfo GetConstructor(Type type, ConstructorInfo constructor) { if (!(type is TypeBuilder) && !(type is TypeBuilderInstantiation)) - throw new ArgumentException(SR.Argument_MustBeTypeBuilder); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeTypeBuilder")); if (!constructor.DeclaringType.IsGenericTypeDefinition) - throw new ArgumentException(SR.Argument_ConstructorNeedGenericDeclaringType, nameof(constructor)); + throw new ArgumentException(Environment.GetResourceString("Argument_ConstructorNeedGenericDeclaringType"), nameof(constructor)); Contract.EndContractBlock(); if (!(type is TypeBuilderInstantiation)) - throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(type)); // TypeBuilder G<T> ==> TypeBuilderInstantiation G<T> if (type is TypeBuilder && type.IsGenericTypeDefinition) type = type.MakeGenericType(type.GetGenericArguments()); if (type.GetGenericTypeDefinition() != constructor.DeclaringType) - throw new ArgumentException(SR.Argument_InvalidConstructorDeclaringType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidConstructorDeclaringType"), nameof(type)); return ConstructorOnTypeBuilderInstantiation.GetConstructor(constructor, type as TypeBuilderInstantiation); } public static FieldInfo GetField(Type type, FieldInfo field) { if (!(type is TypeBuilder) && !(type is TypeBuilderInstantiation)) - throw new ArgumentException(SR.Argument_MustBeTypeBuilder); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeTypeBuilder")); if (!field.DeclaringType.IsGenericTypeDefinition) - throw new ArgumentException(SR.Argument_FieldNeedGenericDeclaringType, nameof(field)); + throw new ArgumentException(Environment.GetResourceString("Argument_FieldNeedGenericDeclaringType"), nameof(field)); Contract.EndContractBlock(); if (!(type is TypeBuilderInstantiation)) - throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(type)); // TypeBuilder G<T> ==> TypeBuilderInstantiation G<T> if (type is TypeBuilder && type.IsGenericTypeDefinition) type = type.MakeGenericType(type.GetGenericArguments()); if (type.GetGenericTypeDefinition() != field.DeclaringType) - throw new ArgumentException(SR.Argument_InvalidFieldDeclaringType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFieldDeclaringType"), nameof(type)); return FieldOnTypeBuilderInstantiation.GetField(field, type as TypeBuilderInstantiation); } @@ -351,7 +351,7 @@ namespace System.Reflection.Emit // The constant value supplied should match either the baked enum type or its underlying type // we don't need to compare it with the EnumBuilder itself because you can never have an object of that type if (type != enumBldr.m_typeBuilder.m_bakedRuntimeType && type != underlyingType) - throw new ArgumentException(SR.Argument_ConstantDoesntMatch); + throw new ArgumentException(Environment.GetResourceString("Argument_ConstantDoesntMatch")); } else if ((typeBldr = destType as TypeBuilder) != null) { @@ -360,7 +360,7 @@ namespace System.Reflection.Emit // The constant value supplied should match either the baked enum type or its underlying type // typeBldr.m_enumUnderlyingType is null if the user hasn't created a "value__" field on the enum if (underlyingType == null || (type != typeBldr.UnderlyingSystemType && type != underlyingType)) - throw new ArgumentException(SR.Argument_ConstantDoesntMatch); + throw new ArgumentException(Environment.GetResourceString("Argument_ConstantDoesntMatch")); } else // must be a runtime Enum Type { @@ -370,7 +370,7 @@ namespace System.Reflection.Emit // The constant value supplied should match either the enum itself or its underlying type if (type != destType && type != underlyingType) - throw new ArgumentException(SR.Argument_ConstantDoesntMatch); + throw new ArgumentException(Environment.GetResourceString("Argument_ConstantDoesntMatch")); } type = underlyingType; @@ -379,7 +379,7 @@ namespace System.Reflection.Emit { // Note that it is non CLS compliant if destType != type. But RefEmit never guarantees CLS-Compliance. if (!destType.IsAssignableFrom(type)) - throw new ArgumentException(SR.Argument_ConstantDoesntMatch); + throw new ArgumentException(Environment.GetResourceString("Argument_ConstantDoesntMatch")); } CorElementType corType = RuntimeTypeHandle.GetCorElementType((RuntimeType)type); @@ -416,7 +416,7 @@ namespace System.Reflection.Emit } else { - throw new ArgumentException(SR.Format(SR.Argument_ConstantNotSupported, type.ToString())); + throw new ArgumentException(Environment.GetResourceString("Argument_ConstantNotSupported", type.ToString())); } break; } @@ -427,7 +427,7 @@ namespace System.Reflection.Emit { // nullable types can hold null value. if (!(destType.IsGenericType && destType.GetGenericTypeDefinition() == typeof(Nullable<>))) - throw new ArgumentException(SR.Argument_ConstantNull); + throw new ArgumentException(Environment.GetResourceString("Argument_ConstantNull")); } SetConstantValue(module.GetNativeHandle(), tk, (int)CorElementType.Class, null); @@ -527,14 +527,14 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(fullname)); if (fullname.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(fullname)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(fullname)); if (fullname[0] == '\0') - throw new ArgumentException(SR.Argument_IllegalName, nameof(fullname)); + throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), nameof(fullname)); if (fullname.Length > 1023) - throw new ArgumentException(SR.Argument_TypeNameTooLong, nameof(fullname)); + throw new ArgumentException(Environment.GetResourceString("Argument_TypeNameTooLong"), nameof(fullname)); Contract.EndContractBlock(); int i; @@ -550,7 +550,7 @@ namespace System.Reflection.Emit // Nested Type should have nested attribute set. // If we are renumbering TypeAttributes' bit, we need to change the logic here. if (((attr & TypeAttributes.VisibilityMask) == TypeAttributes.Public) || ((attr & TypeAttributes.VisibilityMask) == TypeAttributes.NotPublic)) - throw new ArgumentException(SR.Argument_BadNestedTypeFlags, nameof(attr)); + throw new ArgumentException(Environment.GetResourceString("Argument_BadNestedTypeFlags"), nameof(attr)); } int[] interfaceTokens = null; @@ -631,10 +631,10 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(name)); if (name.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name)); if (size <= 0 || size >= 0x003f0000) - throw new ArgumentException(SR.Argument_BadSizeForData); + throw new ArgumentException(Environment.GetResourceString("Argument_BadSizeForData")); Contract.EndContractBlock(); ThrowIfCreated(); @@ -670,7 +670,7 @@ namespace System.Reflection.Emit // Not a nested class. if (((attr & TypeAttributes.VisibilityMask) != TypeAttributes.NotPublic) && ((attr & TypeAttributes.VisibilityMask) != TypeAttributes.Public)) { - throw new ArgumentException(SR.Argument_BadTypeAttrNestedVisibilityOnNonNestedType); + throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeAttrNestedVisibilityOnNonNestedType")); } } else @@ -678,20 +678,20 @@ namespace System.Reflection.Emit // Nested class. if (((attr & TypeAttributes.VisibilityMask) == TypeAttributes.NotPublic) || ((attr & TypeAttributes.VisibilityMask) == TypeAttributes.Public)) { - throw new ArgumentException(SR.Argument_BadTypeAttrNonNestedVisibilityNestedType); + throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeAttrNonNestedVisibilityNestedType")); } } // Verify that the layout mask is valid. if (((attr & TypeAttributes.LayoutMask) != TypeAttributes.AutoLayout) && ((attr & TypeAttributes.LayoutMask) != TypeAttributes.SequentialLayout) && ((attr & TypeAttributes.LayoutMask) != TypeAttributes.ExplicitLayout)) { - throw new ArgumentException(SR.Argument_BadTypeAttrInvalidLayout); + throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeAttrInvalidLayout")); } // Check if the user attempted to set any reserved bits. if ((attr & TypeAttributes.ReservedMask) != 0) { - throw new ArgumentException(SR.Argument_BadTypeAttrReservedBitsSet); + throw new ArgumentException(Environment.GetResourceString("Argument_BadTypeAttrReservedBitsSet")); } } @@ -723,7 +723,7 @@ namespace System.Reflection.Emit internal void ThrowIfCreated() { if (IsCreated()) - throw new InvalidOperationException(SR.InvalidOperation_TypeHasBeenCreated); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_TypeHasBeenCreated")); } internal object SyncRoot @@ -825,7 +825,7 @@ namespace System.Reflection.Emit get { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GUID; @@ -836,7 +836,7 @@ namespace System.Reflection.Emit Object[] args, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParameters) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.InvokeMember(name, invokeAttr, binder, target, args, modifiers, culture, namedParameters); @@ -849,7 +849,7 @@ namespace System.Reflection.Emit public override RuntimeTypeHandle TypeHandle { - get { throw new NotSupportedException(SR.NotSupported_DynamicModule); } + get { throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } } public override String FullName @@ -885,7 +885,7 @@ namespace System.Reflection.Emit CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetConstructor(bindingAttr, binder, callConvention, types, modifiers); @@ -894,7 +894,7 @@ namespace System.Reflection.Emit public override ConstructorInfo[] GetConstructors(BindingFlags bindingAttr) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetConstructors(bindingAttr); @@ -904,7 +904,7 @@ namespace System.Reflection.Emit CallingConventions callConvention, Type[] types, ParameterModifier[] modifiers) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); if (types == null) @@ -920,7 +920,7 @@ namespace System.Reflection.Emit public override MethodInfo[] GetMethods(BindingFlags bindingAttr) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetMethods(bindingAttr); @@ -929,7 +929,7 @@ namespace System.Reflection.Emit public override FieldInfo GetField(String name, BindingFlags bindingAttr) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetField(name, bindingAttr); @@ -938,7 +938,7 @@ namespace System.Reflection.Emit public override FieldInfo[] GetFields(BindingFlags bindingAttr) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetFields(bindingAttr); @@ -947,7 +947,7 @@ namespace System.Reflection.Emit public override Type GetInterface(String name, bool ignoreCase) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetInterface(name, ignoreCase); @@ -971,7 +971,7 @@ namespace System.Reflection.Emit public override EventInfo GetEvent(String name, BindingFlags bindingAttr) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetEvent(name, bindingAttr); @@ -980,7 +980,7 @@ namespace System.Reflection.Emit public override EventInfo[] GetEvents() { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetEvents(); @@ -989,13 +989,13 @@ namespace System.Reflection.Emit protected override PropertyInfo GetPropertyImpl(String name, BindingFlags bindingAttr, Binder binder, Type returnType, Type[] types, ParameterModifier[] modifiers) { - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } public override PropertyInfo[] GetProperties(BindingFlags bindingAttr) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetProperties(bindingAttr); @@ -1004,7 +1004,7 @@ namespace System.Reflection.Emit public override Type[] GetNestedTypes(BindingFlags bindingAttr) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetNestedTypes(bindingAttr); @@ -1013,7 +1013,7 @@ namespace System.Reflection.Emit public override Type GetNestedType(String name, BindingFlags bindingAttr) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetNestedType(name, bindingAttr); @@ -1022,7 +1022,7 @@ namespace System.Reflection.Emit public override MemberInfo[] GetMember(String name, MemberTypes type, BindingFlags bindingAttr) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetMember(name, type, bindingAttr); @@ -1031,7 +1031,7 @@ namespace System.Reflection.Emit public override InterfaceMapping GetInterfaceMap(Type interfaceType) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetInterfaceMap(interfaceType); @@ -1040,7 +1040,7 @@ namespace System.Reflection.Emit public override EventInfo[] GetEvents(BindingFlags bindingAttr) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetEvents(bindingAttr); @@ -1049,7 +1049,7 @@ namespace System.Reflection.Emit public override MemberInfo[] GetMembers(BindingFlags bindingAttr) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return m_bakedRuntimeType.GetMembers(bindingAttr); @@ -1136,7 +1136,7 @@ namespace System.Reflection.Emit public override Type GetElementType() { // You will never have to deal with a TypeBuilder if you are just referring to arrays. - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); } protected override bool HasElementTypeImpl() @@ -1190,7 +1190,7 @@ namespace System.Reflection.Emit if (IsEnum) { if (m_enumUnderlyingType == null) - throw new InvalidOperationException(SR.InvalidOperation_NoUnderlyingTypeOnEnum); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NoUnderlyingTypeOnEnum")); return m_enumUnderlyingType; } @@ -1243,7 +1243,7 @@ namespace System.Reflection.Emit public override Object[] GetCustomAttributes(bool inherit) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); Contract.EndContractBlock(); return CustomAttribute.GetCustomAttributes(m_bakedRuntimeType, typeof(object) as RuntimeType, inherit); @@ -1252,7 +1252,7 @@ namespace System.Reflection.Emit public override Object[] GetCustomAttributes(Type attributeType, bool inherit) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); if (attributeType == null) throw new ArgumentNullException(nameof(attributeType)); @@ -1261,7 +1261,7 @@ namespace System.Reflection.Emit RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.GetCustomAttributes(m_bakedRuntimeType, attributeRuntimeType, inherit); } @@ -1269,7 +1269,7 @@ namespace System.Reflection.Emit public override bool IsDefined(Type attributeType, bool inherit) { if (!IsCreated()) - throw new NotSupportedException(SR.NotSupported_TypeNotYetCreated); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_TypeNotYetCreated")); if (attributeType == null) throw new ArgumentNullException(nameof(attributeType)); @@ -1278,7 +1278,7 @@ namespace System.Reflection.Emit RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.IsDefined(m_bakedRuntimeType, attributeRuntimeType, inherit); } @@ -1368,7 +1368,7 @@ namespace System.Reflection.Emit if (!object.ReferenceEquals(methodInfoBody.DeclaringType, this)) // Loader restriction: body method has to be from this class - throw new ArgumentException(SR.ArgumentException_BadMethodImplBody); + throw new ArgumentException(Environment.GetResourceString("ArgumentException_BadMethodImplBody")); MethodToken tkBody; MethodToken tkDecl; @@ -1430,7 +1430,7 @@ namespace System.Reflection.Emit throw new ArgumentNullException(nameof(name)); if (name.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name)); Contract.Ensures(Contract.Result<MethodBuilder>() != null); Contract.EndContractBlock(); @@ -1442,10 +1442,10 @@ namespace System.Reflection.Emit if (parameterTypes != null) { if (parameterTypeOptionalCustomModifiers != null && parameterTypeOptionalCustomModifiers.Length != parameterTypes.Length) - throw new ArgumentException(SR.Format(SR.Argument_MismatchedArrays, nameof(parameterTypeOptionalCustomModifiers), nameof(parameterTypes))); + throw new ArgumentException(Environment.GetResourceString("Argument_MismatchedArrays", nameof(parameterTypeOptionalCustomModifiers), nameof(parameterTypes))); if (parameterTypeRequiredCustomModifiers != null && parameterTypeRequiredCustomModifiers.Length != parameterTypes.Length) - throw new ArgumentException(SR.Format(SR.Argument_MismatchedArrays, nameof(parameterTypeRequiredCustomModifiers), nameof(parameterTypes))); + throw new ArgumentException(Environment.GetResourceString("Argument_MismatchedArrays", nameof(parameterTypeRequiredCustomModifiers), nameof(parameterTypes))); } ThrowIfCreated(); @@ -1454,7 +1454,7 @@ namespace System.Reflection.Emit { if (((m_iAttr & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface) && (attributes & MethodAttributes.Abstract) == 0 && (attributes & MethodAttributes.Static) == 0) - throw new ArgumentException(SR.Argument_BadAttributeOnInterfaceMethod); + throw new ArgumentException(Environment.GetResourceString("Argument_BadAttributeOnInterfaceMethod")); } // pass in Method attributes @@ -1506,7 +1506,7 @@ namespace System.Reflection.Emit { if ((m_iAttr & TypeAttributes.Interface) == TypeAttributes.Interface) { - throw new InvalidOperationException(SR.InvalidOperation_ConstructorNotAllowedOnInterface); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ConstructorNotAllowedOnInterface")); } lock (SyncRoot) @@ -1535,7 +1535,7 @@ namespace System.Reflection.Emit genericTypeDefinition = ((TypeBuilder)genericTypeDefinition).m_bakedRuntimeType; if (genericTypeDefinition == null) - throw new NotSupportedException(SR.NotSupported_DynamicModule); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_DynamicModule")); Type inst = genericTypeDefinition.MakeGenericType(m_typeParent.GetGenericArguments()); @@ -1553,7 +1553,7 @@ namespace System.Reflection.Emit } if (con == null) - throw new NotSupportedException(SR.NotSupported_NoParentDefaultConstructor); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NoParentDefaultConstructor")); // Define the constructor Builder constBuilder = DefineConstructor(attributes, CallingConventions.Standard, null); @@ -1579,7 +1579,7 @@ namespace System.Reflection.Emit { if ((m_iAttr & TypeAttributes.Interface) == TypeAttributes.Interface && (attributes & MethodAttributes.Static) != MethodAttributes.Static) { - throw new InvalidOperationException(SR.InvalidOperation_ConstructorNotAllowedOnInterface); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ConstructorNotAllowedOnInterface")); } lock (SyncRoot) @@ -1802,7 +1802,7 @@ namespace System.Reflection.Emit if (name == null) throw new ArgumentNullException(nameof(name)); if (name.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name)); Contract.EndContractBlock(); CheckContext(returnType); @@ -1857,9 +1857,9 @@ namespace System.Reflection.Emit if (name == null) throw new ArgumentNullException(nameof(name)); if (name.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name)); if (name[0] == '\0') - throw new ArgumentException(SR.Argument_IllegalName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_IllegalName"), nameof(name)); Contract.EndContractBlock(); int tkType; @@ -2023,7 +2023,7 @@ namespace System.Reflection.Emit // Check that they haven't declared an abstract method on a non-abstract class if (((methodAttrs & MethodAttributes.Abstract) != 0) && ((m_iAttr & TypeAttributes.Abstract) == 0)) { - throw new InvalidOperationException(SR.InvalidOperation_BadTypeAttributesNotAbstract); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadTypeAttributesNotAbstract")); } body = meth.GetBody(); @@ -2038,7 +2038,7 @@ namespace System.Reflection.Emit //((m_iAttr & TypeAttributes.ClassSemanticsMask) == TypeAttributes.Interface)) if (body != null) - throw new InvalidOperationException(SR.InvalidOperation_BadMethodBody); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadMethodBody")); } else if (body == null || body.Length == 0) { @@ -2053,7 +2053,7 @@ namespace System.Reflection.Emit if ((body == null || body.Length == 0) && !meth.m_canBeRuntimeImpl) throw new InvalidOperationException( - SR.Format(SR.InvalidOperation_BadEmptyMethodBody, meth.Name)); + Environment.GetResourceString("InvalidOperation_BadEmptyMethodBody", meth.Name)); } int maxStack = meth.GetMaxStack(); @@ -2121,7 +2121,7 @@ namespace System.Reflection.Emit CheckContext(parent); if (parent.IsInterface) - throw new ArgumentException(SR.Argument_CannotSetParentToInterface); + throw new ArgumentException(Environment.GetResourceString("Argument_CannotSetParentToInterface")); m_typeParent = parent; } @@ -2134,7 +2134,7 @@ namespace System.Reflection.Emit else { if ((m_iAttr & TypeAttributes.Abstract) == 0) - throw new InvalidOperationException(SR.InvalidOperation_BadInterfaceNotAbstract); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_BadInterfaceNotAbstract")); // there is no extends for interface class m_typeParent = null; diff --git a/src/mscorlib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs b/src/mscorlib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs index 6d46362f91..06d8384c10 100644 --- a/src/mscorlib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs +++ b/src/mscorlib/src/System/Reflection/Emit/TypeBuilderInstantiation.cs @@ -221,7 +221,7 @@ namespace System.Reflection.Emit } public override MethodBase DeclaringMethod { get { return null; } } public override Type GetGenericTypeDefinition() { return m_type; } - public override Type MakeGenericType(params Type[] inst) { throw new InvalidOperationException(SR.Arg_NotGenericTypeDefinition); } + public override Type MakeGenericType(params Type[] inst) { throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericTypeDefinition")); } public override bool IsAssignableFrom(Type c) { throw new NotSupportedException(); } [Pure] diff --git a/src/mscorlib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs b/src/mscorlib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs index 78238c02b7..6c9bc81323 100644 --- a/src/mscorlib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs +++ b/src/mscorlib/src/System/Reflection/Emit/XXXOnTypeBuilderInstantiation.cs @@ -72,7 +72,7 @@ namespace System.Reflection.Emit public override MethodInfo MakeGenericMethod(params Type[] typeArgs) { if (!IsGenericMethodDefinition) - throw new InvalidOperationException(SR.Arg_NotGenericMethodDefinition); + throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericMethodDefinition")); Contract.EndContractBlock(); return MethodBuilderInstantiation.MakeGenericMethod(this, typeArgs); diff --git a/src/mscorlib/src/System/Reflection/FieldInfo.CoreCLR.cs b/src/mscorlib/src/System/Reflection/FieldInfo.CoreCLR.cs index bcda3418fa..e9515b171c 100644 --- a/src/mscorlib/src/System/Reflection/FieldInfo.CoreCLR.cs +++ b/src/mscorlib/src/System/Reflection/FieldInfo.CoreCLR.cs @@ -11,14 +11,14 @@ namespace System.Reflection public static FieldInfo GetFieldFromHandle(RuntimeFieldHandle handle) { if (handle.IsNullHandle()) - throw new ArgumentException(SR.Argument_InvalidHandle, nameof(handle)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHandle"), nameof(handle)); FieldInfo f = RuntimeType.GetFieldInfo(handle.GetRuntimeFieldInfo()); Type declaringType = f.DeclaringType; if (declaringType != null && declaringType.IsGenericType) throw new ArgumentException(String.Format( - CultureInfo.CurrentCulture, SR.Argument_FieldDeclaringTypeGeneric, + CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_FieldDeclaringTypeGeneric"), f.Name, declaringType.GetGenericTypeDefinition())); return f; @@ -27,7 +27,7 @@ namespace System.Reflection public static FieldInfo GetFieldFromHandle(RuntimeFieldHandle handle, RuntimeTypeHandle declaringType) { if (handle.IsNullHandle()) - throw new ArgumentException(SR.Argument_InvalidHandle); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHandle")); return RuntimeType.GetFieldInfo(declaringType.GetRuntimeType(), handle.GetRuntimeFieldInfo()); } diff --git a/src/mscorlib/src/System/Reflection/InvalidFilterCriteriaException.cs b/src/mscorlib/src/System/Reflection/InvalidFilterCriteriaException.cs index dc1d19b13d..d3333df8e1 100644 --- a/src/mscorlib/src/System/Reflection/InvalidFilterCriteriaException.cs +++ b/src/mscorlib/src/System/Reflection/InvalidFilterCriteriaException.cs @@ -22,7 +22,7 @@ namespace System.Reflection public class InvalidFilterCriteriaException : ApplicationException { public InvalidFilterCriteriaException() - : base(SR.Arg_InvalidFilterCriteriaException) + : base(Environment.GetResourceString("Arg_InvalidFilterCriteriaException")) { SetErrorCode(__HResults.COR_E_INVALIDFILTERCRITERIA); } diff --git a/src/mscorlib/src/System/Reflection/MdConstant.cs b/src/mscorlib/src/System/Reflection/MdConstant.cs index 8e5b65724d..43c5556ed8 100644 --- a/src/mscorlib/src/System/Reflection/MdConstant.cs +++ b/src/mscorlib/src/System/Reflection/MdConstant.cs @@ -69,7 +69,7 @@ namespace System.Reflection break; default: - throw new FormatException(SR.Arg_BadLiteralFormat); + throw new FormatException(Environment.GetResourceString("Arg_BadLiteralFormat")); #endregion } @@ -95,7 +95,7 @@ namespace System.Reflection break; default: - throw new FormatException(SR.Arg_BadLiteralFormat); + throw new FormatException(Environment.GetResourceString("Arg_BadLiteralFormat")); #endregion } @@ -158,7 +158,7 @@ namespace System.Reflection return null; default: - throw new FormatException(SR.Arg_BadLiteralFormat); + throw new FormatException(Environment.GetResourceString("Arg_BadLiteralFormat")); #endregion } } diff --git a/src/mscorlib/src/System/Reflection/MdFieldInfo.cs b/src/mscorlib/src/System/Reflection/MdFieldInfo.cs index 2ec6abd713..994cdc6879 100644 --- a/src/mscorlib/src/System/Reflection/MdFieldInfo.cs +++ b/src/mscorlib/src/System/Reflection/MdFieldInfo.cs @@ -79,7 +79,7 @@ namespace System.Reflection [Diagnostics.DebuggerHidden] public override void SetValueDirect(TypedReference obj, Object value) { - throw new FieldAccessException(SR.Acc_ReadOnly); + throw new FieldAccessException(Environment.GetResourceString("Acc_ReadOnly")); } [DebuggerStepThroughAttribute] @@ -98,7 +98,7 @@ namespace System.Reflection Object value = MdConstant.GetValue(GetRuntimeModule().MetadataImport, m_tkField, FieldType.GetTypeHandleInternal(), raw); if (value == DBNull.Value) - throw new NotSupportedException(SR.Arg_EnumLitValueNotFound); + throw new NotSupportedException(Environment.GetResourceString("Arg_EnumLitValueNotFound")); return value; } @@ -107,7 +107,7 @@ namespace System.Reflection [Diagnostics.DebuggerHidden] public override void SetValue(Object obj, Object value, BindingFlags invokeAttr, Binder binder, CultureInfo culture) { - throw new FieldAccessException(SR.Acc_ReadOnly); + throw new FieldAccessException(Environment.GetResourceString("Acc_ReadOnly")); } public override Type FieldType diff --git a/src/mscorlib/src/System/Reflection/MemberInfoSerializationHolder.cs b/src/mscorlib/src/System/Reflection/MemberInfoSerializationHolder.cs index a487f68c1f..d59205d707 100644 --- a/src/mscorlib/src/System/Reflection/MemberInfoSerializationHolder.cs +++ b/src/mscorlib/src/System/Reflection/MemberInfoSerializationHolder.cs @@ -72,7 +72,7 @@ namespace System.Reflection String typeName = info.GetString("ClassName"); if (assemblyName == null || typeName == null) - throw new SerializationException(SR.Serialization_InsufficientState); + throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState")); Assembly assem = FormatterServices.LoadAssemblyFromString(assemblyName); m_reflectedType = assem.GetType(typeName, true, false) as RuntimeType; @@ -88,7 +88,7 @@ namespace System.Reflection #region ISerializable public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { - throw new NotSupportedException(SR.GetResourceString(ResId.NotSupported_Method)); + throw new NotSupportedException(Environment.GetResourceString(ResId.NotSupported_Method)); } #endregion @@ -96,7 +96,7 @@ namespace System.Reflection public virtual Object GetRealObject(StreamingContext context) { if (m_memberName == null || m_reflectedType == null || m_memberType == 0) - throw new SerializationException(SR.GetResourceString(ResId.Serialization_InsufficientState)); + throw new SerializationException(Environment.GetResourceString(ResId.Serialization_InsufficientState)); BindingFlags bindingFlags = BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic | @@ -110,7 +110,7 @@ namespace System.Reflection FieldInfo[] fields = m_reflectedType.GetMember(m_memberName, MemberTypes.Field, bindingFlags) as FieldInfo[]; if (fields.Length == 0) - throw new SerializationException(SR.Format(SR.Serialization_UnknownMember, m_memberName)); + throw new SerializationException(Environment.GetResourceString("Serialization_UnknownMember", m_memberName)); return fields[0]; } @@ -122,7 +122,7 @@ namespace System.Reflection EventInfo[] events = m_reflectedType.GetMember(m_memberName, MemberTypes.Event, bindingFlags) as EventInfo[]; if (events.Length == 0) - throw new SerializationException(SR.Format(SR.Serialization_UnknownMember, m_memberName)); + throw new SerializationException(Environment.GetResourceString("Serialization_UnknownMember", m_memberName)); return events[0]; } @@ -134,7 +134,7 @@ namespace System.Reflection PropertyInfo[] properties = m_reflectedType.GetMember(m_memberName, MemberTypes.Property, bindingFlags) as PropertyInfo[]; if (properties.Length == 0) - throw new SerializationException(SR.Format(SR.Serialization_UnknownMember, m_memberName)); + throw new SerializationException(Environment.GetResourceString("Serialization_UnknownMember", m_memberName)); if (properties.Length == 1) return properties[0]; @@ -156,7 +156,7 @@ namespace System.Reflection } } - throw new SerializationException(SR.Format(SR.GetResourceString(ResId.Serialization_UnknownMember), m_memberName)); + throw new SerializationException(Environment.GetResourceString(ResId.Serialization_UnknownMember, m_memberName)); } #endregion @@ -164,7 +164,7 @@ namespace System.Reflection case MemberTypes.Constructor: { if (m_signature == null) - throw new SerializationException(SR.GetResourceString(ResId.Serialization_NullSignature)); + throw new SerializationException(Environment.GetResourceString(ResId.Serialization_NullSignature)); ConstructorInfo[] constructors = m_reflectedType.GetMember(m_memberName, MemberTypes.Constructor, bindingFlags) as ConstructorInfo[]; @@ -188,7 +188,7 @@ namespace System.Reflection } } - throw new SerializationException(SR.Format(SR.GetResourceString(ResId.Serialization_UnknownMember), m_memberName)); + throw new SerializationException(Environment.GetResourceString(ResId.Serialization_UnknownMember, m_memberName)); } #endregion @@ -198,7 +198,7 @@ namespace System.Reflection MethodInfo methodInfo = null; if (m_signature == null) - throw new SerializationException(SR.GetResourceString(ResId.Serialization_NullSignature)); + throw new SerializationException(Environment.GetResourceString(ResId.Serialization_NullSignature)); Type[] genericArguments = m_info.GetValueNoThrow("GenericArguments", typeof(Type[])) as Type[]; @@ -258,7 +258,7 @@ namespace System.Reflection } if (methodInfo == null) - throw new SerializationException(SR.Format(SR.GetResourceString(ResId.Serialization_UnknownMember), m_memberName)); + throw new SerializationException(Environment.GetResourceString(ResId.Serialization_UnknownMember, m_memberName)); if (!methodInfo.IsGenericMethodDefinition) return methodInfo; @@ -274,7 +274,7 @@ namespace System.Reflection #endregion default: - throw new ArgumentException(SR.Serialization_MemberTypeNotRecognized); + throw new ArgumentException(Environment.GetResourceString("Serialization_MemberTypeNotRecognized")); } } #endregion diff --git a/src/mscorlib/src/System/Reflection/MethodBase.CoreCLR.cs b/src/mscorlib/src/System/Reflection/MethodBase.CoreCLR.cs index 3afd396471..384b2dd0a1 100644 --- a/src/mscorlib/src/System/Reflection/MethodBase.CoreCLR.cs +++ b/src/mscorlib/src/System/Reflection/MethodBase.CoreCLR.cs @@ -15,14 +15,14 @@ namespace System.Reflection public static MethodBase GetMethodFromHandle(RuntimeMethodHandle handle) { if (handle.IsNullHandle()) - throw new ArgumentException(SR.Argument_InvalidHandle); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHandle")); MethodBase m = RuntimeType.GetMethodBase(handle.GetMethodInfo()); Type declaringType = m.DeclaringType; if (declaringType != null && declaringType.IsGenericType) throw new ArgumentException(String.Format( - CultureInfo.CurrentCulture, SR.Argument_MethodDeclaringTypeGeneric, + CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_MethodDeclaringTypeGeneric"), m, declaringType.GetGenericTypeDefinition())); return m; @@ -31,7 +31,7 @@ namespace System.Reflection public static MethodBase GetMethodFromHandle(RuntimeMethodHandle handle, RuntimeTypeHandle declaringType) { if (handle.IsNullHandle()) - throw new ArgumentException(SR.Argument_InvalidHandle); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidHandle")); return RuntimeType.GetMethodBase(declaringType.GetRuntimeType(), handle.GetMethodInfo()); } @@ -144,7 +144,7 @@ namespace System.Reflection if (p == null) p = GetParametersNoCopy(); if (p[i].DefaultValue == System.DBNull.Value) - throw new ArgumentException(SR.Arg_VarMissNull, nameof(parameters)); + throw new ArgumentException(Environment.GetResourceString("Arg_VarMissNull"), nameof(parameters)); arg = p[i].DefaultValue; } copyOfParameters[i] = argRT.CheckValue(arg, binder, culture, invokeAttr); diff --git a/src/mscorlib/src/System/Reflection/MethodBody.cs b/src/mscorlib/src/System/Reflection/MethodBody.cs index 275e4f86c0..b245b5406b 100644 --- a/src/mscorlib/src/System/Reflection/MethodBody.cs +++ b/src/mscorlib/src/System/Reflection/MethodBody.cs @@ -52,7 +52,7 @@ namespace System.Reflection get { if (m_flags != ExceptionHandlingClauseOptions.Filter) - throw new InvalidOperationException(SR.Arg_EHClauseNotFilter); + throw new InvalidOperationException(Environment.GetResourceString("Arg_EHClauseNotFilter")); return m_filterOffset; } @@ -63,7 +63,7 @@ namespace System.Reflection get { if (m_flags != ExceptionHandlingClauseOptions.Clause) - throw new InvalidOperationException(SR.Arg_EHClauseNotClause); + throw new InvalidOperationException(Environment.GetResourceString("Arg_EHClauseNotClause")); Type type = null; diff --git a/src/mscorlib/src/System/Reflection/ParameterModifier.cs b/src/mscorlib/src/System/Reflection/ParameterModifier.cs index 70abf75ea0..652831c94e 100644 --- a/src/mscorlib/src/System/Reflection/ParameterModifier.cs +++ b/src/mscorlib/src/System/Reflection/ParameterModifier.cs @@ -18,7 +18,7 @@ namespace System.Reflection public ParameterModifier(int parameterCount) { if (parameterCount <= 0) - throw new ArgumentException(SR.Arg_ParmArraySize); + throw new ArgumentException(Environment.GetResourceString("Arg_ParmArraySize")); Contract.EndContractBlock(); _byRef = new bool[parameterCount]; diff --git a/src/mscorlib/src/System/Reflection/Pointer.cs b/src/mscorlib/src/System/Reflection/Pointer.cs index 600676a5ab..91e205e3a7 100644 --- a/src/mscorlib/src/System/Reflection/Pointer.cs +++ b/src/mscorlib/src/System/Reflection/Pointer.cs @@ -42,12 +42,12 @@ namespace System.Reflection if (type == null) throw new ArgumentNullException(nameof(type)); if (!type.IsPointer) - throw new ArgumentException(SR.Arg_MustBePointer, nameof(ptr)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBePointer"), nameof(ptr)); Contract.EndContractBlock(); RuntimeType rt = type as RuntimeType; if (rt == null) - throw new ArgumentException(SR.Arg_MustBePointer, nameof(ptr)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBePointer"), nameof(ptr)); Pointer x = new Pointer(); x._ptr = ptr; @@ -59,7 +59,7 @@ namespace System.Reflection public static unsafe void* Unbox(Object ptr) { if (!(ptr is Pointer)) - throw new ArgumentException(SR.Arg_MustBePointer, nameof(ptr)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBePointer"), nameof(ptr)); return ((Pointer)ptr)._ptr; } diff --git a/src/mscorlib/src/System/Reflection/ReflectionTypeLoadException.cs b/src/mscorlib/src/System/Reflection/ReflectionTypeLoadException.cs index 4dca8de86d..908b79513d 100644 --- a/src/mscorlib/src/System/Reflection/ReflectionTypeLoadException.cs +++ b/src/mscorlib/src/System/Reflection/ReflectionTypeLoadException.cs @@ -30,7 +30,7 @@ namespace System.Reflection // private constructor. This is not called. private ReflectionTypeLoadException() - : base(SR.ReflectionTypeLoad_LoadFailed) + : base(Environment.GetResourceString("ReflectionTypeLoad_LoadFailed")) { SetErrorCode(__HResults.COR_E_REFLECTIONTYPELOAD); } diff --git a/src/mscorlib/src/System/Reflection/RtFieldInfo.cs b/src/mscorlib/src/System/Reflection/RtFieldInfo.cs index 20d6e6392f..856e9521ce 100644 --- a/src/mscorlib/src/System/Reflection/RtFieldInfo.cs +++ b/src/mscorlib/src/System/Reflection/RtFieldInfo.cs @@ -114,12 +114,12 @@ namespace System.Reflection { if (target == null) { - throw new TargetException(SR.RFLCT_Targ_StatFldReqTarg); + throw new TargetException(Environment.GetResourceString("RFLCT.Targ_StatFldReqTarg")); } else { throw new ArgumentException( - String.Format(CultureInfo.CurrentUICulture, SR.Arg_FieldDeclTarget, + String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Arg_FieldDeclTarget"), Name, m_declaringType, target.GetType())); } } @@ -146,10 +146,10 @@ namespace System.Reflection if ((invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NO_INVOKE) != 0) { if (declaringType != null && declaringType.ContainsGenericParameters) - throw new InvalidOperationException(SR.Arg_UnboundGenField); + throw new InvalidOperationException(Environment.GetResourceString("Arg_UnboundGenField")); if ((declaringType == null && Module.Assembly.ReflectionOnly) || declaringType is ReflectionOnlyType) - throw new InvalidOperationException(SR.Arg_ReflectionOnlyField); + throw new InvalidOperationException(Environment.GetResourceString("Arg_ReflectionOnlyField")); throw new FieldAccessException(); } @@ -214,10 +214,10 @@ namespace System.Reflection if ((invocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_NO_INVOKE) != 0) { if (declaringType != null && DeclaringType.ContainsGenericParameters) - throw new InvalidOperationException(SR.Arg_UnboundGenField); + throw new InvalidOperationException(Environment.GetResourceString("Arg_UnboundGenField")); if ((declaringType == null && Module.Assembly.ReflectionOnly) || declaringType is ReflectionOnlyType) - throw new InvalidOperationException(SR.Arg_ReflectionOnlyField); + throw new InvalidOperationException(Environment.GetResourceString("Arg_ReflectionOnlyField")); throw new FieldAccessException(); } @@ -307,7 +307,7 @@ namespace System.Reflection public override Object GetValueDirect(TypedReference obj) { if (obj.IsNull) - throw new ArgumentException(SR.Arg_TypedReference_Null); + throw new ArgumentException(Environment.GetResourceString("Arg_TypedReference_Null")); Contract.EndContractBlock(); unsafe @@ -330,7 +330,7 @@ namespace System.Reflection public override void SetValueDirect(TypedReference obj, Object value) { if (obj.IsNull) - throw new ArgumentException(SR.Arg_TypedReference_Null); + throw new ArgumentException(Environment.GetResourceString("Arg_TypedReference_Null")); Contract.EndContractBlock(); unsafe @@ -346,7 +346,7 @@ namespace System.Reflection { Type declaringType = DeclaringType; if ((declaringType == null && Module.Assembly.ReflectionOnly) || declaringType is ReflectionOnlyType) - throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInReflectionOnly); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInReflectionOnly")); return new RuntimeFieldHandle(this); } } diff --git a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs index 1cca9e1d55..5322047484 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeAssembly.cs @@ -296,7 +296,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType); } @@ -310,7 +310,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.IsDefined(this, attributeRuntimeType); } @@ -382,7 +382,7 @@ namespace System.Reflection if ((assemblyString.Length == 0) || (assemblyString[0] == '\0')) - throw new ArgumentException(SR.Format_StringZeroLength); + throw new ArgumentException(Environment.GetResourceString("Format_StringZeroLength")); if (forIntrospection) AppDomain.CheckReflectionOnlyLoadSupported(); @@ -715,7 +715,7 @@ namespace System.Reflection { //Console.WriteLine("Creating an unmanaged memory stream of length "+length); if (length > Int64.MaxValue) - throw new NotImplementedException(SR.NotImplemented_ResourcesLongerThanInt64Max); + throw new NotImplementedException(Environment.GetResourceString("NotImplemented_ResourcesLongerThan2^63")); return new UnmanagedMemoryStream(pbInMemoryResource, (long)length, (long)length, FileAccess.Read); } @@ -891,7 +891,7 @@ namespace System.Reflection if (retAssembly == this || (retAssembly == null && throwOnFileNotFound)) { - throw new FileNotFoundException(String.Format(culture, SR.IO_FileNotFound_FileName, an.Name)); + throw new FileNotFoundException(String.Format(culture, Environment.GetResourceString("IO.FileNotFound_FileName"), an.Name)); } return retAssembly; diff --git a/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs index c2601ae3bf..069927e739 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeConstructorInfo.cs @@ -142,9 +142,9 @@ namespace System.Reflection if (!m_declaringType.IsInstanceOfType(target)) { if (target == null) - throw new TargetException(SR.RFLCT_Targ_StatMethReqTarg); + throw new TargetException(Environment.GetResourceString("RFLCT.Targ_StatMethReqTarg")); - throw new TargetException(SR.RFLCT_Targ_ITargMismatch); + throw new TargetException(Environment.GetResourceString("RFLCT.Targ_ITargMismatch")); } } @@ -177,7 +177,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType); } @@ -191,7 +191,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.IsDefined(this, attributeRuntimeType); } @@ -277,7 +277,7 @@ namespace System.Reflection { Type declaringType = DeclaringType; if ((declaringType == null && Module.Assembly.ReflectionOnly) || declaringType is ReflectionOnlyType) - throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInReflectionOnly); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInReflectionOnly")); return new RuntimeMethodHandle(this); } } @@ -306,17 +306,17 @@ namespace System.Reflection // ctor is ReflectOnly if (declaringType is ReflectionOnlyType) - throw new InvalidOperationException(SR.Arg_ReflectionOnlyInvoke); + throw new InvalidOperationException(Environment.GetResourceString("Arg_ReflectionOnlyInvoke")); // ctor is declared on interface class else if (declaringType.IsInterface) throw new MemberAccessException( - String.Format(CultureInfo.CurrentUICulture, SR.Acc_CreateInterfaceEx, declaringType)); + String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Acc_CreateInterfaceEx"), declaringType)); // ctor is on an abstract class else if (declaringType.IsAbstract) throw new MemberAccessException( - String.Format(CultureInfo.CurrentUICulture, SR.Acc_CreateAbstEx, declaringType)); + String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Acc_CreateAbstEx"), declaringType)); // ctor is on a class that contains stack pointers else if (declaringType.GetRootElementType() == typeof(ArgIterator)) @@ -330,12 +330,12 @@ namespace System.Reflection else if (declaringType.ContainsGenericParameters) { throw new MemberAccessException( - String.Format(CultureInfo.CurrentUICulture, SR.Acc_CreateGenericEx, declaringType)); + String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Acc_CreateGenericEx"), declaringType)); } // ctor is declared on System.Void else if (declaringType == typeof(void)) - throw new MemberAccessException(SR.Access_Void); + throw new MemberAccessException(Environment.GetResourceString("Access_Void")); } internal void ThrowNoInvokeException() @@ -344,7 +344,7 @@ namespace System.Reflection // ctor is .cctor if ((Attributes & MethodAttributes.Static) == MethodAttributes.Static) - throw new MemberAccessException(SR.Acc_NotClassInit); + throw new MemberAccessException(Environment.GetResourceString("Acc_NotClassInit")); throw new TargetException(); } @@ -376,7 +376,7 @@ namespace System.Reflection int formalCount = sig.Arguments.Length; int actualCount = (parameters != null) ? parameters.Length : 0; if (formalCount != actualCount) - throw new TargetParameterCountException(SR.Arg_ParmCnt); + throw new TargetParameterCountException(Environment.GetResourceString("Arg_ParmCnt")); // if we are here we passed all the previous checks. Time to look at the arguments if (actualCount > 0) @@ -443,7 +443,7 @@ namespace System.Reflection int formalCount = sig.Arguments.Length; int actualCount = (parameters != null) ? parameters.Length : 0; if (formalCount != actualCount) - throw new TargetParameterCountException(SR.Arg_ParmCnt); + throw new TargetParameterCountException(Environment.GetResourceString("Arg_ParmCnt")); // We don't need to explicitly invoke the class constructor here, // JIT/NGen will insert the call to .cctor in the instance ctor. diff --git a/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs index ba356e2ebf..8d82e26a97 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeEventInfo.cs @@ -75,7 +75,7 @@ namespace System.Reflection public override String ToString() { if (m_addMethod == null || m_addMethod.GetParametersNoCopy().Length == 0) - throw new InvalidOperationException(SR.InvalidOperation_NoPublicAddMethod); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NoPublicAddMethod")); return m_addMethod.GetParametersNoCopy()[0].ParameterType.FormatTypeName() + " " + Name; } @@ -96,7 +96,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType); } @@ -110,7 +110,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.IsDefined(this, attributeRuntimeType); } diff --git a/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs index cab7a4a5c4..cc1beb74a1 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeFieldInfo.cs @@ -93,7 +93,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType); } @@ -107,7 +107,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.IsDefined(this, attributeRuntimeType); } diff --git a/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs index 73298d3e36..a2530e22bf 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeMethodInfo.cs @@ -287,7 +287,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType, inherit); } @@ -301,7 +301,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.IsDefined(this, attributeRuntimeType, inherit); } @@ -404,7 +404,7 @@ namespace System.Reflection { Type declaringType = DeclaringType; if ((declaringType == null && Module.Assembly.ReflectionOnly) || declaringType is ReflectionOnlyType) - throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInReflectionOnly); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInReflectionOnly")); return new RuntimeMethodHandle(this); } } @@ -437,9 +437,9 @@ namespace System.Reflection if (!m_declaringType.IsInstanceOfType(target)) { if (target == null) - throw new TargetException(SR.RFLCT_Targ_StatMethReqTarg); + throw new TargetException(Environment.GetResourceString("RFLCT.Targ_StatMethReqTarg")); else - throw new TargetException(SR.RFLCT_Targ_ITargMismatch); + throw new TargetException(Environment.GetResourceString("RFLCT.Targ_ITargMismatch")); } } } @@ -450,7 +450,7 @@ namespace System.Reflection Type declaringType = DeclaringType; if ((declaringType == null && Module.Assembly.ReflectionOnly) || declaringType is ReflectionOnlyType) { - throw new InvalidOperationException(SR.Arg_ReflectionOnlyInvoke); + throw new InvalidOperationException(Environment.GetResourceString("Arg_ReflectionOnlyInvoke")); } // method is on a class that contains stack pointers else if ((InvocationFlags & INVOCATION_FLAGS.INVOCATION_FLAGS_CONTAINS_STACK_POINTERS) != 0) @@ -465,7 +465,7 @@ namespace System.Reflection // method is generic or on a generic class else if (DeclaringType.ContainsGenericParameters || ContainsGenericParameters) { - throw new InvalidOperationException(SR.Arg_UnboundGenParam); + throw new InvalidOperationException(Environment.GetResourceString("Arg_UnboundGenParam")); } // method is abstract class else if (IsAbstract) @@ -475,7 +475,7 @@ namespace System.Reflection // ByRef return are not allowed in reflection else if (ReturnType.IsByRef) { - throw new NotSupportedException(SR.NotSupported_ByRefReturn); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ByRefReturn")); } throw new TargetException(); @@ -540,7 +540,7 @@ namespace System.Reflection CheckConsistency(obj); if (formalCount != actualCount) - throw new TargetParameterCountException(SR.Arg_ParmCnt); + throw new TargetParameterCountException(Environment.GetResourceString("Arg_ParmCnt")); if (actualCount != 0) return CheckArguments(parameters, binder, invokeAttr, culture, sig); @@ -642,15 +642,15 @@ namespace System.Reflection RuntimeType rtType = delegateType as RuntimeType; if (rtType == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(delegateType)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(delegateType)); if (!rtType.IsDelegate()) - throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(delegateType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(delegateType)); Delegate d = Delegate.CreateDelegateInternal(rtType, this, firstArgument, bindingFlags, ref stackMark); if (d == null) { - throw new ArgumentException(SR.Arg_DlgtTargMeth); + throw new ArgumentException(Environment.GetResourceString("Arg_DlgtTargMeth")); } return d; @@ -669,7 +669,7 @@ namespace System.Reflection if (!IsGenericMethodDefinition) throw new InvalidOperationException( - SR.Format(SR.Arg_NotGenericMethodDefinition, this)); + Environment.GetResourceString("Arg_NotGenericMethodDefinition", this)); for (int i = 0; i < methodInstantiation.Length; i++) { @@ -777,7 +777,7 @@ namespace System.Reflection Contract.EndContractBlock(); if (m_reflectedTypeCache.IsGlobal) - throw new NotSupportedException(SR.NotSupported_GlobalMethodSerialization); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_GlobalMethodSerialization")); MemberInfoSerializationHolder.GetSerializationInfo( info, diff --git a/src/mscorlib/src/System/Reflection/RuntimeModule.cs b/src/mscorlib/src/System/Reflection/RuntimeModule.cs index 4e77e8f8c4..2b663a8677 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeModule.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeModule.cs @@ -58,12 +58,12 @@ namespace System.Reflection { Type typeArg = genericArguments[i]; if (typeArg == null) - throw new ArgumentException(SR.Argument_InvalidGenericInstArray); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidGenericInstArray")); typeArg = typeArg.UnderlyingSystemType; if (typeArg == null) - throw new ArgumentException(SR.Argument_InvalidGenericInstArray); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidGenericInstArray")); if (!(typeArg is RuntimeType)) - throw new ArgumentException(SR.Argument_InvalidGenericInstArray); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidGenericInstArray")); typeHandleArgs[i] = typeArg.GetTypeHandleInternal(); } return typeHandleArgs; @@ -75,10 +75,10 @@ namespace System.Reflection if (!MetadataImport.IsValidToken(tk)) throw new ArgumentOutOfRangeException(nameof(metadataToken), - SR.Format(SR.Argument_InvalidToken, tk, this)); + Environment.GetResourceString("Argument_InvalidToken", tk, this)); if (!tk.IsMemberRef && !tk.IsMethodDef && !tk.IsTypeSpec && !tk.IsSignature && !tk.IsFieldDef) - throw new ArgumentException(SR.Format(SR.Argument_InvalidToken, tk, this), + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidToken", tk, this), nameof(metadataToken)); ConstArray signature; @@ -101,7 +101,7 @@ namespace System.Reflection if (!MetadataImport.IsValidToken(tk)) throw new ArgumentOutOfRangeException(nameof(metadataToken), - SR.Format(SR.Argument_InvalidToken, tk, this)); + Environment.GetResourceString("Argument_InvalidToken", tk, this)); RuntimeTypeHandle[] typeArgs = ConvertToTypeHandleArray(genericTypeArguments); RuntimeTypeHandle[] methodArgs = ConvertToTypeHandleArray(genericMethodArguments); @@ -111,7 +111,7 @@ namespace System.Reflection if (!tk.IsMethodDef && !tk.IsMethodSpec) { if (!tk.IsMemberRef) - throw new ArgumentException(SR.Format(SR.Argument_ResolveMethod, tk, this), + throw new ArgumentException(Environment.GetResourceString("Argument_ResolveMethod", tk, this), nameof(metadataToken)); unsafe @@ -119,7 +119,7 @@ namespace System.Reflection ConstArray sig = MetadataImport.GetMemberRefProps(tk); if (*(MdSigCallingConvention*)sig.Signature.ToPointer() == MdSigCallingConvention.Field) - throw new ArgumentException(SR.Format(SR.Argument_ResolveMethod, tk, this), + throw new ArgumentException(Environment.GetResourceString("Argument_ResolveMethod", tk, this), nameof(metadataToken)); } } @@ -141,7 +141,7 @@ namespace System.Reflection } catch (BadImageFormatException e) { - throw new ArgumentException(SR.Argument_BadImageFormatExceptionResolve, e); + throw new ArgumentException(Environment.GetResourceString("Argument_BadImageFormatExceptionResolve"), e); } } @@ -151,7 +151,7 @@ namespace System.Reflection if (!MetadataImport.IsValidToken(tk) || !tk.IsFieldDef) throw new ArgumentOutOfRangeException(nameof(metadataToken), - String.Format(CultureInfo.CurrentUICulture, SR.Format(SR.Argument_InvalidToken, tk, this))); + String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Argument_InvalidToken", tk, this))); int tkDeclaringType; string fieldName; @@ -172,7 +172,7 @@ namespace System.Reflection } catch { - throw new ArgumentException(SR.Format(SR.Argument_ResolveField, tk, this), nameof(metadataToken)); + throw new ArgumentException(Environment.GetResourceString("Argument_ResolveField", tk, this), nameof(metadataToken)); } } @@ -182,7 +182,7 @@ namespace System.Reflection if (!MetadataImport.IsValidToken(tk)) throw new ArgumentOutOfRangeException(nameof(metadataToken), - SR.Format(SR.Argument_InvalidToken, tk, this)); + Environment.GetResourceString("Argument_InvalidToken", tk, this)); RuntimeTypeHandle[] typeArgs = ConvertToTypeHandleArray(genericTypeArguments); RuntimeTypeHandle[] methodArgs = ConvertToTypeHandleArray(genericMethodArguments); @@ -194,7 +194,7 @@ namespace System.Reflection if (!tk.IsFieldDef) { if (!tk.IsMemberRef) - throw new ArgumentException(SR.Format(SR.Argument_ResolveField, tk, this), + throw new ArgumentException(Environment.GetResourceString("Argument_ResolveField", tk, this), nameof(metadataToken)); unsafe @@ -202,7 +202,7 @@ namespace System.Reflection ConstArray sig = MetadataImport.GetMemberRefProps(tk); if (*(MdSigCallingConvention*)sig.Signature.ToPointer() != MdSigCallingConvention.Field) - throw new ArgumentException(SR.Format(SR.Argument_ResolveField, tk, this), + throw new ArgumentException(Environment.GetResourceString("Argument_ResolveField", tk, this), nameof(metadataToken)); } @@ -226,7 +226,7 @@ namespace System.Reflection } catch (BadImageFormatException e) { - throw new ArgumentException(SR.Argument_BadImageFormatExceptionResolve, e); + throw new ArgumentException(Environment.GetResourceString("Argument_BadImageFormatExceptionResolve"), e); } } @@ -235,14 +235,14 @@ namespace System.Reflection MetadataToken tk = new MetadataToken(metadataToken); if (tk.IsGlobalTypeDefToken) - throw new ArgumentException(SR.Format(SR.Argument_ResolveModuleType, tk), nameof(metadataToken)); + throw new ArgumentException(Environment.GetResourceString("Argument_ResolveModuleType", tk), nameof(metadataToken)); if (!MetadataImport.IsValidToken(tk)) throw new ArgumentOutOfRangeException(nameof(metadataToken), - SR.Format(SR.Argument_InvalidToken, tk, this)); + Environment.GetResourceString("Argument_InvalidToken", tk, this)); if (!tk.IsTypeDef && !tk.IsTypeSpec && !tk.IsTypeRef) - throw new ArgumentException(SR.Format(SR.Argument_ResolveType, tk, this), nameof(metadataToken)); + throw new ArgumentException(Environment.GetResourceString("Argument_ResolveType", tk, this), nameof(metadataToken)); RuntimeTypeHandle[] typeArgs = ConvertToTypeHandleArray(genericTypeArguments); RuntimeTypeHandle[] methodArgs = ConvertToTypeHandleArray(genericMethodArguments); @@ -252,13 +252,13 @@ namespace System.Reflection Type t = GetModuleHandleImpl().ResolveTypeHandle(metadataToken, typeArgs, methodArgs).GetRuntimeType(); if (t == null) - throw new ArgumentException(SR.Format(SR.Argument_ResolveType, tk, this), nameof(metadataToken)); + throw new ArgumentException(Environment.GetResourceString("Argument_ResolveType", tk, this), nameof(metadataToken)); return t; } catch (BadImageFormatException e) { - throw new ArgumentException(SR.Argument_BadImageFormatExceptionResolve, e); + throw new ArgumentException(Environment.GetResourceString("Argument_BadImageFormatExceptionResolve"), e); } } @@ -267,10 +267,10 @@ namespace System.Reflection MetadataToken tk = new MetadataToken(metadataToken); if (tk.IsProperty) - throw new ArgumentException(SR.InvalidOperation_PropertyInfoNotAvailable); + throw new ArgumentException(Environment.GetResourceString("InvalidOperation_PropertyInfoNotAvailable")); if (tk.IsEvent) - throw new ArgumentException(SR.InvalidOperation_EventInfoNotAvailable); + throw new ArgumentException(Environment.GetResourceString("InvalidOperation_EventInfoNotAvailable")); if (tk.IsMethodSpec || tk.IsMethodDef) return ResolveMethod(metadataToken, genericTypeArguments, genericMethodArguments); @@ -285,7 +285,7 @@ namespace System.Reflection { if (!MetadataImport.IsValidToken(tk)) throw new ArgumentOutOfRangeException(nameof(metadataToken), - SR.Format(SR.Argument_InvalidToken, tk, this)); + Environment.GetResourceString("Argument_InvalidToken", tk, this)); ConstArray sig = MetadataImport.GetMemberRefProps(tk); @@ -302,7 +302,7 @@ namespace System.Reflection } } - throw new ArgumentException(SR.Format(SR.Argument_ResolveMember, tk, this), + throw new ArgumentException(Environment.GetResourceString("Argument_ResolveMember", tk, this), nameof(metadataToken)); } @@ -311,17 +311,17 @@ namespace System.Reflection MetadataToken tk = new MetadataToken(metadataToken); if (!tk.IsString) throw new ArgumentException( - String.Format(CultureInfo.CurrentUICulture, SR.Argument_ResolveString, metadataToken, ToString())); + String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Argument_ResolveString"), metadataToken, ToString())); if (!MetadataImport.IsValidToken(tk)) throw new ArgumentOutOfRangeException(nameof(metadataToken), - String.Format(CultureInfo.CurrentUICulture, SR.Format(SR.Argument_InvalidToken, tk, this))); + String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Argument_InvalidToken", tk, this))); string str = MetadataImport.GetUserString(metadataToken); if (str == null) throw new ArgumentException( - String.Format(CultureInfo.CurrentUICulture, SR.Argument_ResolveString, metadataToken, ToString())); + String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Argument_ResolveString"), metadataToken, ToString())); return str; } @@ -420,7 +420,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType); } @@ -434,7 +434,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.IsDefined(this, attributeRuntimeType); } diff --git a/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs b/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs index 77a56b4fe2..5fb2e92088 100644 --- a/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimeParameterInfo.cs @@ -55,7 +55,7 @@ namespace System.Reflection // Not all parameters have tokens. Parameters may have no token // if they have no name and no attributes. if (cParamDefs > sigArgCount + 1 /* return type */) - throw new BadImageFormatException(SR.BadImageFormat_ParameterSignatureMismatch); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ParameterSignatureMismatch")); for (int i = 0; i < cParamDefs; i++) { @@ -71,7 +71,7 @@ namespace System.Reflection { // more than one return parameter? if (returnParameter != null) - throw new BadImageFormatException(SR.BadImageFormat_ParameterSignatureMismatch); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ParameterSignatureMismatch")); returnParameter = new RuntimeParameterInfo(sig, scope, tkParamDef, position, attr, member); } @@ -79,7 +79,7 @@ namespace System.Reflection { // position beyong sigArgCount? if (position >= sigArgCount) - throw new BadImageFormatException(SR.BadImageFormat_ParameterSignatureMismatch); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ParameterSignatureMismatch")); args[position] = new RuntimeParameterInfo(sig, scope, tkParamDef, position, attr, member); } @@ -496,7 +496,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType); } @@ -513,7 +513,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.IsDefined(this, attributeRuntimeType); } diff --git a/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs b/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs index fe4ffbf8b7..5726081b2a 100644 --- a/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs +++ b/src/mscorlib/src/System/Reflection/RuntimePropertyInfo.cs @@ -162,7 +162,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType); } @@ -176,7 +176,7 @@ namespace System.Reflection RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.IsDefined(this, attributeRuntimeType); } @@ -249,7 +249,7 @@ namespace System.Reflection if (defaultValue == DBNull.Value) // Arg_EnumLitValueNotFound -> "Literal value was not found." - throw new InvalidOperationException(SR.Arg_EnumLitValueNotFound); + throw new InvalidOperationException(Environment.GetResourceString("Arg_EnumLitValueNotFound")); return defaultValue; } @@ -400,7 +400,7 @@ namespace System.Reflection { MethodInfo m = GetGetMethod(true); if (m == null) - throw new ArgumentException(System.SR.Arg_GetMethNotFnd); + throw new ArgumentException(System.Environment.GetResourceString("Arg_GetMethNotFnd")); return m.Invoke(obj, invokeAttr, binder, index, null); } @@ -423,7 +423,7 @@ namespace System.Reflection MethodInfo m = GetSetMethod(true); if (m == null) - throw new ArgumentException(System.SR.Arg_SetMethNotFnd); + throw new ArgumentException(System.Environment.GetResourceString("Arg_SetMethNotFnd")); Object[] args = null; diff --git a/src/mscorlib/src/System/Reflection/TargetInvocationException.cs b/src/mscorlib/src/System/Reflection/TargetInvocationException.cs index 38c5b7d008..326b571e18 100644 --- a/src/mscorlib/src/System/Reflection/TargetInvocationException.cs +++ b/src/mscorlib/src/System/Reflection/TargetInvocationException.cs @@ -25,7 +25,7 @@ namespace System.Reflection // This exception is not creatable without specifying the // inner exception. private TargetInvocationException() - : base(SR.Arg_TargetInvocationException) + : base(Environment.GetResourceString("Arg_TargetInvocationException")) { SetErrorCode(__HResults.COR_E_TARGETINVOCATION); } @@ -37,7 +37,7 @@ namespace System.Reflection } public TargetInvocationException(System.Exception inner) - : base(SR.Arg_TargetInvocationException, inner) + : base(Environment.GetResourceString("Arg_TargetInvocationException"), inner) { SetErrorCode(__HResults.COR_E_TARGETINVOCATION); } diff --git a/src/mscorlib/src/System/Reflection/TargetParameterCountException.cs b/src/mscorlib/src/System/Reflection/TargetParameterCountException.cs index 5e315f91ff..3e2bce4b26 100644 --- a/src/mscorlib/src/System/Reflection/TargetParameterCountException.cs +++ b/src/mscorlib/src/System/Reflection/TargetParameterCountException.cs @@ -22,7 +22,7 @@ namespace System.Reflection public sealed class TargetParameterCountException : ApplicationException { public TargetParameterCountException() - : base(SR.Arg_TargetParameterCountException) + : base(Environment.GetResourceString("Arg_TargetParameterCountException")) { SetErrorCode(__HResults.COR_E_TARGETPARAMCOUNT); } diff --git a/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs b/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs index e1bbd2814a..da4ee812a6 100644 --- a/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs +++ b/src/mscorlib/src/System/Resources/FileBasedResourceGroveler.cs @@ -62,7 +62,7 @@ namespace System.Resources { // We really don't think this should happen - we always // expect the neutral locale's resources to be present. - throw new MissingManifestResourceException(SR.MissingManifestResource_NoNeutralDisk + Environment.NewLine + "baseName: " + _mediator.BaseNameField + " locationInfo: " + (_mediator.LocationInfo == null ? "<null>" : _mediator.LocationInfo.FullName) + " fileName: " + _mediator.GetResourceFileName(culture)); + throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_NoNeutralDisk") + Environment.NewLine + "baseName: " + _mediator.BaseNameField + " locationInfo: " + (_mediator.LocationInfo == null ? "<null>" : _mediator.LocationInfo.FullName) + " fileName: " + _mediator.GetResourceFileName(culture)); } } } @@ -142,7 +142,7 @@ namespace System.Resources } catch (MissingMethodException e) { - throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResMgrBadResSet_Type, _mediator.UserResourceSet.AssemblyQualifiedName), e); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResMgrBadResSet_Type", _mediator.UserResourceSet.AssemblyQualifiedName), e); } } } diff --git a/src/mscorlib/src/System/Resources/LooselyLinkedResourceReference.cs b/src/mscorlib/src/System/Resources/LooselyLinkedResourceReference.cs index 3179df09b7..9287ae4590 100644 --- a/src/mscorlib/src/System/Resources/LooselyLinkedResourceReference.cs +++ b/src/mscorlib/src/System/Resources/LooselyLinkedResourceReference.cs @@ -39,9 +39,9 @@ namespace System.Resources { if (typeName == null) throw new ArgumentNullException(nameof(typeName)); if (looselyLinkedResourceName.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(looselyLinkedResourceName)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(looselyLinkedResourceName)); if (typeName.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(typeName)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(typeName)); Contract.EndContractBlock(); _manifestResourceName = looselyLinkedResourceName; @@ -64,7 +64,7 @@ namespace System.Resources { Stream data = assembly.GetManifestResourceStream(_manifestResourceName); if (data == null) - throw new MissingManifestResourceException(SR.Format(SR.MissingManifestResource_LooselyLinked, _manifestResourceName, assembly.FullName)); + throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_LooselyLinked", _manifestResourceName, assembly.FullName)); Type type = Type.GetType(_typeName, true); diff --git a/src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs b/src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs index 0e9666b2b1..3ef0066e7e 100644 --- a/src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs +++ b/src/mscorlib/src/System/Resources/ManifestBasedResourceGroveler.cs @@ -159,7 +159,7 @@ namespace System.Resources { if ((UltimateResourceFallbackLocation)fallback < UltimateResourceFallbackLocation.MainAssembly || (UltimateResourceFallbackLocation)fallback > UltimateResourceFallbackLocation.Satellite) { - throw new ArgumentException(SR.Format(SR.Arg_InvalidNeutralResourcesLanguage_FallbackLoc, fallback)); + throw new ArgumentException(Environment.GetResourceString("Arg_InvalidNeutralResourcesLanguage_FallbackLoc", fallback)); } fallbackLocation = (UltimateResourceFallbackLocation)fallback; } @@ -185,7 +185,7 @@ namespace System.Resources return CultureInfo.InvariantCulture; } - throw new ArgumentException(SR.Format(SR.Arg_InvalidNeutralResourcesLanguage_Asm_Culture, a.ToString(), cultureName), e); + throw new ArgumentException(Environment.GetResourceString("Arg_InvalidNeutralResourcesLanguage_Asm_Culture", a.ToString(), cultureName), e); } } @@ -238,7 +238,7 @@ namespace System.Resources // resMgrHeaderVersion is older than this ResMgr version. // We should add in backwards compatibility support here. - throw new NotSupportedException(SR.Format(SR.NotSupported_ObsoleteResourcesFile, _mediator.MainAssembly.GetSimpleName())); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ObsoleteResourcesFile", _mediator.MainAssembly.GetSimpleName())); } store.Position = startPos; @@ -334,7 +334,7 @@ namespace System.Resources } catch (MissingMethodException e) { - throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResMgrBadResSet_Type, _mediator.UserResourceSet.AssemblyQualifiedName), e); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResMgrBadResSet_Type", _mediator.UserResourceSet.AssemblyQualifiedName), e); } } } @@ -394,7 +394,7 @@ namespace System.Resources } else { - throw new MissingManifestResourceException(SR.Format(SR.MissingManifestResource_MultipleBlobs, givenName, satellite.ToString())); + throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_MultipleBlobs", givenName, satellite.ToString())); } } } @@ -521,7 +521,7 @@ namespace System.Resources { missingCultureName = "<invariant>"; } - throw new MissingSatelliteAssemblyException(SR.Format(SR.MissingSatelliteAssembly_Culture_Name, _mediator.NeutralResourcesCulture, satAssemName), missingCultureName); + throw new MissingSatelliteAssemblyException(Environment.GetResourceString("MissingSatelliteAssembly_Culture_Name", _mediator.NeutralResourcesCulture, satAssemName), missingCultureName); } private void HandleResourceStreamMissing(String fileName) @@ -542,7 +542,7 @@ namespace System.Resources if (_mediator.LocationInfo != null && _mediator.LocationInfo.Namespace != null) resName = _mediator.LocationInfo.Namespace + Type.Delimiter; resName += fileName; - throw new MissingManifestResourceException(SR.Format(SR.MissingManifestResource_NoNeutralAsm, resName, _mediator.MainAssembly.GetSimpleName())); + throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_NoNeutralAsm", resName, _mediator.MainAssembly.GetSimpleName())); } [DllImport(JitHelpers.QCall, CharSet = CharSet.Unicode)] diff --git a/src/mscorlib/src/System/Resources/MissingManifestResourceException.cs b/src/mscorlib/src/System/Resources/MissingManifestResourceException.cs index fd3c5b97fd..9401806134 100644 --- a/src/mscorlib/src/System/Resources/MissingManifestResourceException.cs +++ b/src/mscorlib/src/System/Resources/MissingManifestResourceException.cs @@ -22,7 +22,7 @@ namespace System.Resources public class MissingManifestResourceException : SystemException { public MissingManifestResourceException() - : base(SR.Arg_MissingManifestResourceException) + : base(Environment.GetResourceString("Arg_MissingManifestResourceException")) { SetErrorCode(System.__HResults.COR_E_MISSINGMANIFESTRESOURCE); } diff --git a/src/mscorlib/src/System/Resources/MissingSatelliteAssemblyException.cs b/src/mscorlib/src/System/Resources/MissingSatelliteAssemblyException.cs index 5f927f4259..f1f1494290 100644 --- a/src/mscorlib/src/System/Resources/MissingSatelliteAssemblyException.cs +++ b/src/mscorlib/src/System/Resources/MissingSatelliteAssemblyException.cs @@ -26,7 +26,7 @@ namespace System.Resources private String _cultureName; public MissingSatelliteAssemblyException() - : base(SR.MissingSatelliteAssembly_Default) + : base(Environment.GetResourceString("MissingSatelliteAssembly_Default")) { SetErrorCode(System.__HResults.COR_E_MISSINGSATELLITEASSEMBLY); } diff --git a/src/mscorlib/src/System/Resources/NeutralResourcesLanguageAttribute.cs b/src/mscorlib/src/System/Resources/NeutralResourcesLanguageAttribute.cs index d124389b02..83fb51d139 100644 --- a/src/mscorlib/src/System/Resources/NeutralResourcesLanguageAttribute.cs +++ b/src/mscorlib/src/System/Resources/NeutralResourcesLanguageAttribute.cs @@ -47,7 +47,7 @@ namespace System.Resources if (cultureName == null) throw new ArgumentNullException(nameof(cultureName)); if (!Enum.IsDefined(typeof(UltimateResourceFallbackLocation), location)) - throw new ArgumentException(SR.Format(SR.Arg_InvalidNeutralResourcesLanguage_FallbackLoc, location)); + throw new ArgumentException(Environment.GetResourceString("Arg_InvalidNeutralResourcesLanguage_FallbackLoc", location)); Contract.EndContractBlock(); _culture = cultureName; diff --git a/src/mscorlib/src/System/Resources/ResourceManager.cs b/src/mscorlib/src/System/Resources/ResourceManager.cs index 993efddbfc..c60e8222fe 100644 --- a/src/mscorlib/src/System/Resources/ResourceManager.cs +++ b/src/mscorlib/src/System/Resources/ResourceManager.cs @@ -310,7 +310,7 @@ namespace System.Resources Contract.EndContractBlock(); if (!(assembly is RuntimeAssembly)) - throw new ArgumentException(SR.Argument_MustBeRuntimeAssembly); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeAssembly")); MainAssembly = assembly; BaseNameField = baseName; @@ -340,13 +340,13 @@ namespace System.Resources Contract.EndContractBlock(); if (!(assembly is RuntimeAssembly)) - throw new ArgumentException(SR.Argument_MustBeRuntimeAssembly); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeAssembly")); MainAssembly = assembly; BaseNameField = baseName; if (usingResourceSet != null && (usingResourceSet != _minResourceSet) && !(usingResourceSet.IsSubclassOf(_minResourceSet))) - throw new ArgumentException(SR.Arg_ResMgrNotResSet, nameof(usingResourceSet)); + throw new ArgumentException(Environment.GetResourceString("Arg_ResMgrNotResSet"), nameof(usingResourceSet)); _userResourceSet = usingResourceSet; CommonAssemblyInit(); @@ -367,7 +367,7 @@ namespace System.Resources Contract.EndContractBlock(); if (!(resourceSource is RuntimeType)) - throw new ArgumentException(SR.Argument_MustBeRuntimeType); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType")); _locationInfo = resourceSource; MainAssembly = _locationInfo.Assembly; @@ -758,7 +758,7 @@ namespace System.Resources // Ensure that the assembly reference is not null if (a == null) { - throw new ArgumentNullException(nameof(a), SR.ArgumentNull_Assembly); + throw new ArgumentNullException(nameof(a), Environment.GetResourceString("ArgumentNull_Assembly")); } Contract.EndContractBlock(); @@ -1120,9 +1120,9 @@ namespace System.Resources // Always throw if we did not fully succeed in initializing the WinRT Resource Manager. if (_PRIExceptionInfo != null && _PRIExceptionInfo._PackageSimpleName != null && _PRIExceptionInfo._ResWFile != null) - throw new MissingManifestResourceException(SR.Format(SR.MissingManifestResource_ResWFileNotLoaded, _PRIExceptionInfo._ResWFile, _PRIExceptionInfo._PackageSimpleName)); + throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_ResWFileNotLoaded", _PRIExceptionInfo._ResWFile, _PRIExceptionInfo._PackageSimpleName)); - throw new MissingManifestResourceException(SR.MissingManifestResource_NoPRIresources); + throw new MissingManifestResourceException(Environment.GetResourceString("MissingManifestResource_NoPRIresources")); } // Throws WinRT hresults. @@ -1299,7 +1299,7 @@ namespace System.Resources Object obj = GetObject(name, culture, false); UnmanagedMemoryStream ums = obj as UnmanagedMemoryStream; if (ums == null && obj != null) - throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotStream_Name, name)); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResourceNotStream_Name", name)); return ums; } diff --git a/src/mscorlib/src/System/Resources/ResourceReader.cs b/src/mscorlib/src/System/Resources/ResourceReader.cs index 9734343f92..49795d8f6f 100644 --- a/src/mscorlib/src/System/Resources/ResourceReader.cs +++ b/src/mscorlib/src/System/Resources/ResourceReader.cs @@ -133,7 +133,7 @@ namespace System.Resources if (stream == null) throw new ArgumentNullException(nameof(stream)); if (!stream.CanRead) - throw new ArgumentException(SR.Argument_StreamNotReadable); + throw new ArgumentException(Environment.GetResourceString("Argument_StreamNotReadable")); Contract.EndContractBlock(); _resCache = new Dictionary<String, ResourceLocator>(FastResourceComparer.Default); @@ -211,7 +211,7 @@ namespace System.Resources int stringLength = _store.Read7BitEncodedInt(); if (stringLength < 0) { - throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_NegativeStringLength")); } _store.BaseStream.Seek(stringLength, SeekOrigin.Current); } @@ -239,7 +239,7 @@ namespace System.Resources r = ReadUnalignedI4(&_namePositionsPtr[index]); if (r < 0 || r > _dataSectionOffset - _nameSectionOffset) { - throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesNameInvalidOffset, r)); + throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesNameInvalidOffset", r)); } return r; } @@ -252,7 +252,7 @@ namespace System.Resources public IDictionaryEnumerator GetEnumerator() { if (_resCache == null) - throw new InvalidOperationException(SR.ResourceReaderIsClosed); + throw new InvalidOperationException(Environment.GetResourceString("ResourceReaderIsClosed")); return new ResourceEnumerator(this); } @@ -341,7 +341,7 @@ namespace System.Resources int dataPos = _store.ReadInt32(); if (dataPos < 0 || dataPos >= _store.BaseStream.Length - _dataSectionOffset) { - throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesDataInvalidOffset, dataPos)); + throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesDataInvalidOffset", dataPos)); } return dataPos; } @@ -361,7 +361,7 @@ namespace System.Resources int byteLen = _store.Read7BitEncodedInt(); if (byteLen < 0) { - throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_NegativeStringLength")); } if (_ums != null) { @@ -370,7 +370,7 @@ namespace System.Resources _ums.Seek(byteLen, SeekOrigin.Current); if (_ums.Position > _ums.Length) { - throw new BadImageFormatException(SR.BadImageFormat_ResourcesNameTooLong); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesNameTooLong")); } // On 64-bit machines, these char*'s may be misaligned. Use a @@ -387,7 +387,7 @@ namespace System.Resources { int n = _store.Read(bytes, byteLen - numBytesToRead, numBytesToRead); if (n == 0) - throw new BadImageFormatException(SR.BadImageFormat_ResourceNameCorrupted); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourceNameCorrupted")); numBytesToRead -= n; } return FastResourceComparer.CompareOrdinal(bytes, byteLen / 2, name) == 0; @@ -410,13 +410,13 @@ namespace System.Resources byteLen = _store.Read7BitEncodedInt(); if (byteLen < 0) { - throw new BadImageFormatException(SR.BadImageFormat_NegativeStringLength); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_NegativeStringLength")); } if (_ums != null) { if (_ums.Position > _ums.Length - byteLen) - throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourcesIndexTooLong, index)); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesIndexTooLong", index)); String s = null; char* charPtr = (char*)_ums.PositionPointer; @@ -438,7 +438,7 @@ namespace System.Resources dataOffset = _store.ReadInt32(); if (dataOffset < 0 || dataOffset >= _store.BaseStream.Length - _dataSectionOffset) { - throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesDataInvalidOffset, dataOffset)); + throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesDataInvalidOffset", dataOffset)); } return s; } @@ -452,13 +452,13 @@ namespace System.Resources { int n = _store.Read(bytes, byteLen - count, count); if (n == 0) - throw new EndOfStreamException(SR.Format(SR.BadImageFormat_ResourceNameCorrupted_NameIndex, index)); + throw new EndOfStreamException(Environment.GetResourceString("BadImageFormat_ResourceNameCorrupted_NameIndex", index)); count -= n; } dataOffset = _store.ReadInt32(); if (dataOffset < 0 || dataOffset >= _store.BaseStream.Length - _dataSectionOffset) { - throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesDataInvalidOffset, dataOffset)); + throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesDataInvalidOffset", dataOffset)); } } return Encoding.Unicode.GetString(bytes, 0, byteLen); @@ -479,7 +479,7 @@ namespace System.Resources int dataPos = _store.ReadInt32(); if (dataPos < 0 || dataPos >= _store.BaseStream.Length - _dataSectionOffset) { - throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesDataInvalidOffset, dataPos)); + throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesDataInvalidOffset", dataPos)); } BCLDebug.Log("RESMGRFILEFORMAT", "GetValueForNameIndex: dataPos: " + dataPos); ResourceTypeCode junk; @@ -505,7 +505,7 @@ namespace System.Resources if (typeIndex == -1) return null; if (FindType(typeIndex) != typeof(String)) - throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotString_Type, FindType(typeIndex).FullName)); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResourceNotString_Type", FindType(typeIndex).FullName)); s = _store.ReadString(); } else @@ -518,7 +518,7 @@ namespace System.Resources typeString = typeCode.ToString(); else typeString = FindType(typeCode - ResourceTypeCode.StartOfUserTypes).FullName; - throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotString_Type, typeString)); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResourceNotString_Type", typeString)); } if (typeCode == ResourceTypeCode.String) // ignore Null s = _store.ReadString(); @@ -564,11 +564,11 @@ namespace System.Resources } catch (EndOfStreamException eof) { - throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, eof); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_TypeMismatch"), eof); } catch (ArgumentOutOfRangeException e) { - throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, e); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_TypeMismatch"), e); } } @@ -623,7 +623,7 @@ namespace System.Resources } else { - throw new NotSupportedException(SR.NotSupported_ResourceObjectSerialization); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ResourceObjectSerialization")); } } @@ -640,11 +640,11 @@ namespace System.Resources } catch (EndOfStreamException eof) { - throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, eof); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_TypeMismatch"), eof); } catch (ArgumentOutOfRangeException e) { - throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch, e); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_TypeMismatch"), e); } } @@ -717,21 +717,21 @@ namespace System.Resources int len = _store.ReadInt32(); if (len < 0) { - throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourceDataLengthInvalid", len)); } if (_ums == null) { if (len > _store.BaseStream.Length) { - throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourceDataLengthInvalid", len)); } return _store.ReadBytes(len); } if (len > _ums.Length - _ums.Position) { - throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourceDataLengthInvalid", len)); } byte[] bytes = new byte[len]; @@ -745,7 +745,7 @@ namespace System.Resources int len = _store.ReadInt32(); if (len < 0) { - throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourceDataLengthInvalid", len)); } if (_ums == null) { @@ -757,7 +757,7 @@ namespace System.Resources // make sure we don't create an UnmanagedMemoryStream that is longer than the resource stream. if (len > _ums.Length - _ums.Position) { - throw new BadImageFormatException(SR.Format(SR.BadImageFormat_ResourceDataLengthInvalid, len)); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourceDataLengthInvalid", len)); } // For the case that we've memory mapped in the .resources @@ -771,13 +771,13 @@ namespace System.Resources default: if (typeCode < ResourceTypeCode.StartOfUserTypes) { - throw new BadImageFormatException(SR.BadImageFormat_TypeMismatch); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_TypeMismatch")); } break; } // Normal serialized objects - throw new NotSupportedException(SR.NotSupported_ResourceObjectSerialization); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ResourceObjectSerialization")); } @@ -797,11 +797,11 @@ namespace System.Resources } catch (EndOfStreamException eof) { - throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted, eof); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"), eof); } catch (IndexOutOfRangeException e) { - throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted, e); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted"), e); } } @@ -811,7 +811,7 @@ namespace System.Resources // Check for magic number int magicNum = _store.ReadInt32(); if (magicNum != ResourceManager.MagicNumber) - throw new ArgumentException(SR.Resources_StreamNotValid); + throw new ArgumentException(Environment.GetResourceString("Resources_StreamNotValid")); // Assuming this is ResourceManager header V1 or greater, hopefully // after the version number there is a number of bytes to skip // to bypass the rest of the ResMgr header. For V2 or greater, we @@ -820,7 +820,7 @@ namespace System.Resources int numBytesToSkip = _store.ReadInt32(); if (numBytesToSkip < 0 || resMgrHeaderVersion < 0) { - throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted")); } if (resMgrHeaderVersion > 1) { @@ -839,7 +839,7 @@ namespace System.Resources AssemblyName mscorlib = new AssemblyName(ResourceManager.MscorlibName); if (!ResourceManager.CompareNames(readerType, ResourceManager.ResReaderTypeName, mscorlib)) - throw new NotSupportedException(SR.Format(SR.NotSupported_WrongResourceReader_Type, readerType)); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_WrongResourceReader_Type", readerType)); // Skip over type name for a suitable ResourceSet SkipString(); @@ -849,7 +849,7 @@ namespace System.Resources // Do file version check int version = _store.ReadInt32(); if (version != RuntimeResourceSet.Version && version != 1) - throw new ArgumentException(SR.Format(SR.Arg_ResourceFileUnsupportedVersion, RuntimeResourceSet.Version, version)); + throw new ArgumentException(Environment.GetResourceString("Arg_ResourceFileUnsupportedVersion", RuntimeResourceSet.Version, version)); _version = version; #if RESOURCE_FILE_FORMAT_DEBUG @@ -875,7 +875,7 @@ namespace System.Resources _numResources = _store.ReadInt32(); if (_numResources < 0) { - throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted")); } BCLDebug.Log("RESMGRFILEFORMAT", "ReadResources: Expecting " + _numResources + " resources."); #if RESOURCE_FILE_FORMAT_DEBUG @@ -888,7 +888,7 @@ namespace System.Resources int numTypes = _store.ReadInt32(); if (numTypes < 0) { - throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted")); } _typeTable = new RuntimeType[numTypes]; _typeNamePositions = new int[numTypes]; @@ -942,7 +942,7 @@ namespace System.Resources int seekPos = unchecked(4 * _numResources); if (seekPos < 0) { - throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted")); } unsafe { @@ -969,7 +969,7 @@ namespace System.Resources int namePosition = _store.ReadInt32(); if (namePosition < 0) { - throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted")); } _namePositions[i] = namePosition; @@ -980,7 +980,7 @@ namespace System.Resources int seekPos = unchecked(4 * _numResources); if (seekPos < 0) { - throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted")); } unsafe { @@ -996,7 +996,7 @@ namespace System.Resources _dataSectionOffset = _store.ReadInt32(); if (_dataSectionOffset < 0) { - throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted")); } // Store current location as start of name section @@ -1005,7 +1005,7 @@ namespace System.Resources // _nameSectionOffset should be <= _dataSectionOffset; if not, it's corrupt if (_dataSectionOffset < _nameSectionOffset) { - throw new BadImageFormatException(SR.BadImageFormat_ResourcesHeaderCorrupted); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_ResourcesHeaderCorrupted")); } BCLDebug.Log("RESMGRFILEFORMAT", String.Format(CultureInfo.InvariantCulture, "ReadResources: _nameOffset = 0x{0:x} _dataOffset = 0x{1:x}", _nameSectionOffset, _dataSectionOffset)); @@ -1018,7 +1018,7 @@ namespace System.Resources { if (typeIndex < 0 || typeIndex >= _typeTable.Length) { - throw new BadImageFormatException(SR.BadImageFormat_InvalidType); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_InvalidType")); } if (_typeTable[typeIndex] == null) { @@ -1041,7 +1041,7 @@ namespace System.Resources // getting to Type.GetType -- this is costly with v1 resource formats. catch (FileNotFoundException) { - throw new NotSupportedException(SR.NotSupported_ResourceObjectSerialization); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ResourceObjectSerialization")); } finally { @@ -1059,7 +1059,7 @@ namespace System.Resources throw new ArgumentNullException(nameof(resourceName)); Contract.EndContractBlock(); if (_resCache == null) - throw new InvalidOperationException(SR.ResourceReaderIsClosed); + throw new InvalidOperationException(Environment.GetResourceString("ResourceReaderIsClosed")); // Get the type information from the data section. Also, // sort all of the data section's indexes to compute length of @@ -1069,7 +1069,7 @@ namespace System.Resources int dataPos = FindPosForResource(resourceName); if (dataPos == -1) { - throw new ArgumentException(SR.Format(SR.Arg_ResourceNameNotExist, resourceName)); + throw new ArgumentException(Environment.GetResourceString("Arg_ResourceNameNotExist", resourceName)); } lock (this) @@ -1082,14 +1082,14 @@ namespace System.Resources int numBytesToSkip = _store.Read7BitEncodedInt(); if (numBytesToSkip < 0) { - throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesNameInvalidOffset, numBytesToSkip)); + throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesNameInvalidOffset", numBytesToSkip)); } _store.BaseStream.Position += numBytesToSkip; int dPos = _store.ReadInt32(); if (dPos < 0 || dPos >= _store.BaseStream.Length - _dataSectionOffset) { - throw new FormatException(SR.Format(SR.BadImageFormat_ResourcesDataInvalidOffset, dPos)); + throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourcesDataInvalidOffset", dPos)); } sortedDataPositions[i] = dPos; } @@ -1106,7 +1106,7 @@ namespace System.Resources ResourceTypeCode typeCode = (ResourceTypeCode)_store.Read7BitEncodedInt(); if (typeCode < 0 || typeCode >= ResourceTypeCode.StartOfUserTypes + _typeTable.Length) { - throw new BadImageFormatException(SR.BadImageFormat_InvalidType); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_InvalidType")); } resourceType = TypeNameFromTypeCode(typeCode); @@ -1115,7 +1115,7 @@ namespace System.Resources len -= (int)(_store.BaseStream.Position - (_dataSectionOffset + dataPos)); byte[] bytes = _store.ReadBytes(len); if (bytes.Length != len) - throw new FormatException(SR.BadImageFormat_ResourceNameCorrupted); + throw new FormatException(Environment.GetResourceString("BadImageFormat_ResourceNameCorrupted")); resourceData = bytes; } } @@ -1181,9 +1181,9 @@ namespace System.Resources { get { - if (_currentName == ENUM_DONE) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumEnded)); - if (!_currentIsValid) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); - if (_reader._resCache == null) throw new InvalidOperationException(SR.ResourceReaderIsClosed); + if (_currentName == ENUM_DONE) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded)); + if (!_currentIsValid) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); + if (_reader._resCache == null) throw new InvalidOperationException(Environment.GetResourceString("ResourceReaderIsClosed")); return _reader.AllocateStringForNameIndex(_currentName, out _dataPosition); } @@ -1210,9 +1210,9 @@ namespace System.Resources { get { - if (_currentName == ENUM_DONE) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumEnded)); - if (!_currentIsValid) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); - if (_reader._resCache == null) throw new InvalidOperationException(SR.ResourceReaderIsClosed); + if (_currentName == ENUM_DONE) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded)); + if (!_currentIsValid) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); + if (_reader._resCache == null) throw new InvalidOperationException(Environment.GetResourceString("ResourceReaderIsClosed")); String key; Object value = null; @@ -1248,9 +1248,9 @@ namespace System.Resources { get { - if (_currentName == ENUM_DONE) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumEnded)); - if (!_currentIsValid) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); - if (_reader._resCache == null) throw new InvalidOperationException(SR.ResourceReaderIsClosed); + if (_currentName == ENUM_DONE) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded)); + if (!_currentIsValid) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); + if (_reader._resCache == null) throw new InvalidOperationException(Environment.GetResourceString("ResourceReaderIsClosed")); // Consider using _resCache here, eventually, if // this proves to be an interesting perf scenario. @@ -1262,7 +1262,7 @@ namespace System.Resources public void Reset() { - if (_reader._resCache == null) throw new InvalidOperationException(SR.ResourceReaderIsClosed); + if (_reader._resCache == null) throw new InvalidOperationException(Environment.GetResourceString("ResourceReaderIsClosed")); _currentIsValid = false; _currentName = ENUM_NOT_STARTED; } diff --git a/src/mscorlib/src/System/Resources/ResourceSet.cs b/src/mscorlib/src/System/Resources/ResourceSet.cs index 24f9184dcd..0fac0a9abc 100644 --- a/src/mscorlib/src/System/Resources/ResourceSet.cs +++ b/src/mscorlib/src/System/Resources/ResourceSet.cs @@ -196,7 +196,7 @@ namespace System.Resources { Hashtable copyOfTable = Table; // Avoid a race with Dispose if (copyOfTable == null) - throw new ObjectDisposedException(null, SR.ObjectDisposed_ResourceSet); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ResourceSet")); return copyOfTable.GetEnumerator(); } @@ -211,7 +211,7 @@ namespace System.Resources } catch (InvalidCastException) { - throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotString_Name, name)); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResourceNotString_Name", name)); } } @@ -228,7 +228,7 @@ namespace System.Resources } catch (InvalidCastException) { - throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotString_Name, name)); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResourceNotString_Name", name)); } // case-sensitive lookup succeeded @@ -245,7 +245,7 @@ namespace System.Resources } catch (InvalidCastException) { - throw new InvalidOperationException(SR.Format(SR.InvalidOperation_ResourceNotString_Name, name)); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ResourceNotString_Name", name)); } } @@ -293,7 +293,7 @@ namespace System.Resources Hashtable copyOfTable = Table; // Avoid a race with Dispose if (copyOfTable == null) - throw new ObjectDisposedException(null, SR.ObjectDisposed_ResourceSet); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ResourceSet")); return copyOfTable[name]; } @@ -303,7 +303,7 @@ namespace System.Resources Hashtable copyOfTable = Table; // Avoid a race with Dispose if (copyOfTable == null) - throw new ObjectDisposedException(null, SR.ObjectDisposed_ResourceSet); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ResourceSet")); Hashtable caseTable = _caseInsensitiveTable; // Avoid a race condition with Close if (caseTable == null) diff --git a/src/mscorlib/src/System/Resources/RuntimeResourceSet.cs b/src/mscorlib/src/System/Resources/RuntimeResourceSet.cs index e9c038a498..202fe50637 100644 --- a/src/mscorlib/src/System/Resources/RuntimeResourceSet.cs +++ b/src/mscorlib/src/System/Resources/RuntimeResourceSet.cs @@ -259,7 +259,7 @@ namespace System.Resources { IResourceReader copyOfReader = Reader; if (copyOfReader == null || _resCache == null) - throw new ObjectDisposedException(null, SR.ObjectDisposed_ResourceSet); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ResourceSet")); return copyOfReader.GetEnumerator(); } @@ -292,7 +292,7 @@ namespace System.Resources if (key == null) throw new ArgumentNullException(nameof(key)); if (Reader == null || _resCache == null) - throw new ObjectDisposedException(null, SR.ObjectDisposed_ResourceSet); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ResourceSet")); Contract.EndContractBlock(); Object value = null; @@ -301,7 +301,7 @@ namespace System.Resources lock (Reader) { if (Reader == null) - throw new ObjectDisposedException(null, SR.ObjectDisposed_ResourceSet); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_ResourceSet")); if (_defaultReader != null) { diff --git a/src/mscorlib/src/System/RtType.cs b/src/mscorlib/src/System/RtType.cs index 54899456e4..9a3d9ab42f 100644 --- a/src/mscorlib/src/System/RtType.cs +++ b/src/mscorlib/src/System/RtType.cs @@ -1832,7 +1832,7 @@ namespace System if (!loaderAssuredCompatible) throw new ArgumentException(String.Format( - CultureInfo.CurrentCulture, SR.Argument_ResolveMethodHandle, + CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_ResolveMethodHandle"), reflectedType.ToString(), declaredType.ToString())); } // Action<in string> is assignable from, but not a subclass of Action<in object>. @@ -1860,7 +1860,7 @@ namespace System { // ignoring instantiation is the ReflectedType is not a subtype of the DeclaringType throw new ArgumentException(String.Format( - CultureInfo.CurrentCulture, SR.Argument_ResolveMethodHandle, + CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_ResolveMethodHandle"), reflectedType.ToString(), declaredType.ToString())); } @@ -1882,7 +1882,7 @@ namespace System { // declaredType is not Array, not generic, and not assignable from reflectedType throw new ArgumentException(String.Format( - CultureInfo.CurrentCulture, SR.Argument_ResolveMethodHandle, + CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_ResolveMethodHandle"), reflectedType.ToString(), declaredType.ToString())); } } @@ -1950,7 +1950,7 @@ namespace System !RuntimeTypeHandle.CompareCanonicalHandles(declaredType, reflectedType)) { throw new ArgumentException(String.Format( - CultureInfo.CurrentCulture, SR.Argument_ResolveFieldHandle, + CultureInfo.CurrentCulture, Environment.GetResourceString("Argument_ResolveFieldHandle"), reflectedType.ToString(), declaredType.ToString())); } @@ -1984,7 +1984,7 @@ namespace System { if (type.IsPointer || type.IsByRef || type == typeof(void)) throw new ArgumentException( - SR.Format(SR.Argument_NeverValidGenericArgument, type.ToString())); + Environment.GetResourceString("Argument_NeverValidGenericArgument", type.ToString())); } @@ -2004,7 +2004,7 @@ namespace System if (genericArguments.Length != genericParamters.Length) throw new ArgumentException( - SR.Format(SR.Argument_NotEnoughGenArguments, genericArguments.Length, genericParamters.Length)); + Environment.GetResourceString("Argument_NotEnoughGenArguments", genericArguments.Length, genericParamters.Length)); } internal static void ValidateGenericArguments(MemberInfo definition, RuntimeType[] genericArguments, Exception e) @@ -2041,7 +2041,8 @@ namespace System typeContext, methodContext, genericArgument.GetTypeHandleInternal().GetTypeChecked())) { throw new ArgumentException( - SR.Format(SR.Argument_GenConstraintViolation, i.ToString(CultureInfo.CurrentCulture), genericArgument.ToString(), definition.ToString(), genericParameter.ToString()), e); + Environment.GetResourceString("Argument_GenConstraintViolation", + i.ToString(CultureInfo.CurrentCulture), genericArgument.ToString(), definition.ToString(), genericParameter.ToString()), e); } } } @@ -2730,7 +2731,7 @@ namespace System public override InterfaceMapping GetInterfaceMap(Type ifaceType) { if (IsGenericParameter) - throw new InvalidOperationException(SR.Arg_GenericParameter); + throw new InvalidOperationException(Environment.GetResourceString("Arg_GenericParameter")); if ((object)ifaceType == null) throw new ArgumentNullException(nameof(ifaceType)); @@ -2739,7 +2740,7 @@ namespace System RuntimeType ifaceRtType = ifaceType as RuntimeType; if (ifaceRtType == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(ifaceType)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(ifaceType)); RuntimeTypeHandle ifaceRtTypeHandle = ifaceRtType.GetTypeHandleInternal(); @@ -2750,7 +2751,7 @@ namespace System // SZArrays implement the methods on IList`1, IEnumerable`1, and ICollection`1 with // SZArrayHelper and some runtime magic. We don't have accurate interface maps for them. if (IsSZArray && ifaceType.IsGenericType) - throw new ArgumentException(SR.Argument_ArrayGetInterfaceMap); + throw new ArgumentException(Environment.GetResourceString("Argument_ArrayGetInterfaceMap")); int ifaceInstanceMethodCount = RuntimeTypeHandle.GetNumVirtuals(ifaceRtType); @@ -2812,7 +2813,7 @@ namespace System MethodInfo methodInfo = candidates[j]; if (!System.DefaultBinder.CompareMethodSigAndName(methodInfo, firstCandidate)) { - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); } } @@ -2885,7 +2886,7 @@ namespace System { if ((object)returnType == null) // if we are here we have no args or property type to select over and we have more than one property with that name - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); } } @@ -2919,7 +2920,7 @@ namespace System if ((bindingAttr & eventInfo.BindingFlags) == eventInfo.BindingFlags) { if (match != null) - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); match = eventInfo; } @@ -2951,7 +2952,7 @@ namespace System if (match != null) { if (Object.ReferenceEquals(fieldInfo.DeclaringType, match.DeclaringType)) - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); if ((match.DeclaringType.IsInterface == true) && (fieldInfo.DeclaringType.IsInterface == true)) multipleStaticFieldMatches = true; @@ -2963,7 +2964,7 @@ namespace System } if (multipleStaticFieldMatches && match.DeclaringType.IsInterface) - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); return match; } @@ -2995,7 +2996,7 @@ namespace System if (RuntimeType.FilterApplyType(iface, bindingAttr, name, false, ns)) { if (match != null) - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); match = iface; } @@ -3026,7 +3027,7 @@ namespace System if (RuntimeType.FilterApplyType(nestedType, bindingAttr, name, false, ns)) { if (match != null) - throw new AmbiguousMatchException(SR.Arg_AmbiguousMatchException); + throw new AmbiguousMatchException(Environment.GetResourceString("Arg_AmbiguousMatchException")); match = nestedType; } @@ -3230,7 +3231,7 @@ namespace System get { if (!IsGenericParameter) - throw new InvalidOperationException(SR.Arg_NotGenericParameter); + throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericParameter")); Contract.EndContractBlock(); IRuntimeMethodInfo declaringMethod = RuntimeTypeHandle.GetDeclaringMethod(this); @@ -3515,7 +3516,7 @@ namespace System get { if (!IsGenericParameter) - throw new InvalidOperationException(SR.Arg_NotGenericParameter); + throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericParameter")); Contract.EndContractBlock(); GenericParameterAttributes attributes; @@ -3557,7 +3558,7 @@ namespace System public override int GetArrayRank() { if (!IsArrayImpl()) - throw new ArgumentException(SR.Argument_HasToBeArrayClass); + throw new ArgumentException(Environment.GetResourceString("Argument_HasToBeArrayClass")); return RuntimeTypeHandle.GetArrayRank(this); } @@ -3572,7 +3573,7 @@ namespace System public override string[] GetEnumNames() { if (!IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, "enumType"); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), "enumType"); Contract.EndContractBlock(); String[] ret = Enum.InternalGetNames(this); @@ -3588,7 +3589,7 @@ namespace System public override Array GetEnumValues() { if (!IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, "enumType"); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), "enumType"); Contract.EndContractBlock(); // Get all of the values @@ -3609,7 +3610,7 @@ namespace System public override Type GetEnumUnderlyingType() { if (!IsEnum) - throw new ArgumentException(SR.Arg_MustBeEnum, "enumType"); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnum"), "enumType"); Contract.EndContractBlock(); return Enum.InternalGetUnderlyingType(this); @@ -3628,7 +3629,7 @@ namespace System if (valueType.IsEnum) { if (!valueType.IsEquivalentTo(this)) - throw new ArgumentException(SR.Format(SR.Arg_EnumAndObjectMustBeSameType, valueType.ToString(), this.ToString())); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumAndObjectMustBeSameType", valueType.ToString(), this.ToString())); valueType = (RuntimeType)valueType.GetEnumUnderlyingType(); } @@ -3649,7 +3650,7 @@ namespace System { RuntimeType underlyingType = Enum.InternalGetUnderlyingType(this); if (underlyingType != valueType) - throw new ArgumentException(SR.Format(SR.Arg_EnumUnderlyingTypeAndObjectMustBeSameType, valueType.ToString(), underlyingType.ToString())); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumUnderlyingTypeAndObjectMustBeSameType", valueType.ToString(), underlyingType.ToString())); ulong[] ulValues = Enum.InternalGetValues(this); ulong ulValue = Enum.ToUInt64(value); @@ -3658,7 +3659,7 @@ namespace System } else { - throw new InvalidOperationException(SR.InvalidOperation_UnknownEnumType); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_UnknownEnumType")); } } @@ -3671,7 +3672,7 @@ namespace System Type valueType = value.GetType(); if (!(valueType.IsEnum || IsIntegerType(valueType))) - throw new ArgumentException(SR.Arg_MustBeEnumBaseTypeOrEnum, nameof(value)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeEnumBaseTypeOrEnum"), nameof(value)); ulong ulValue = Enum.ToUInt64(value); @@ -3705,10 +3706,10 @@ namespace System if (!IsGenericTypeDefinition) throw new InvalidOperationException( - SR.Format(SR.Arg_NotGenericTypeDefinition, this)); + Environment.GetResourceString("Arg_NotGenericTypeDefinition", this)); if (GetGenericArguments().Length != instantiation.Length) - throw new ArgumentException(SR.Argument_GenericArgsCount, nameof(instantiation)); + throw new ArgumentException(Environment.GetResourceString("Argument_GenericArgsCount"), nameof(instantiation)); for (int i = 0; i < instantiation.Length; i++) { @@ -3763,7 +3764,7 @@ namespace System get { if (!IsGenericParameter) - throw new InvalidOperationException(SR.Arg_NotGenericParameter); + throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericParameter")); Contract.EndContractBlock(); return new RuntimeTypeHandle(this).GetGenericVariableIndex(); @@ -3773,7 +3774,7 @@ namespace System public override Type GetGenericTypeDefinition() { if (!IsGenericType) - throw new InvalidOperationException(SR.InvalidOperation_NotGenericType); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotGenericType")); Contract.EndContractBlock(); return RuntimeTypeHandle.GetGenericTypeDefinition(this); @@ -3797,7 +3798,7 @@ namespace System public override Type[] GetGenericParameterConstraints() { if (!IsGenericParameter) - throw new InvalidOperationException(SR.Arg_NotGenericParameter); + throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericParameter")); Contract.EndContractBlock(); Type[] constraints = new RuntimeTypeHandle(this).GetConstraints(); @@ -3913,7 +3914,7 @@ namespace System } if ((invokeAttr & BindingFlags.ExactBinding) == BindingFlags.ExactBinding) - throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, SR.Arg_ObjObjEx, value.GetType(), this)); + throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Arg_ObjObjEx"), value.GetType(), this)); return TryChangeType(value, binder, culture, needsSpecialCast); } @@ -3954,7 +3955,7 @@ namespace System } } - throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, SR.Arg_ObjObjEx, value.GetType(), this)); + throw new ArgumentException(String.Format(CultureInfo.CurrentUICulture, Environment.GetResourceString("Arg_ObjObjEx"), value.GetType(), this)); } // GetDefaultMembers @@ -3985,13 +3986,13 @@ namespace System Object[] providedArgs, ParameterModifier[] modifiers, CultureInfo culture, String[] namedParams) { if (IsGenericParameter) - throw new InvalidOperationException(SR.Arg_GenericParameter); + throw new InvalidOperationException(Environment.GetResourceString("Arg_GenericParameter")); Contract.EndContractBlock(); #region Preconditions if ((bindingFlags & InvocationMask) == 0) // "Must specify binding flags describing the invoke operation required." - throw new ArgumentException(SR.Arg_NoAccessSpec, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_NoAccessSpec"), nameof(bindingFlags)); // Provide a default binding mask if none is provided if ((bindingFlags & MemberBindingMask) == 0) @@ -4009,13 +4010,13 @@ namespace System { if (namedParams.Length > providedArgs.Length) // "Named parameter array can not be bigger than argument array." - throw new ArgumentException(SR.Arg_NamedParamTooBig, nameof(namedParams)); + throw new ArgumentException(Environment.GetResourceString("Arg_NamedParamTooBig"), nameof(namedParams)); } else { if (namedParams.Length != 0) // "Named parameter array can not be bigger than argument array." - throw new ArgumentException(SR.Arg_NamedParamTooBig, nameof(namedParams)); + throw new ArgumentException(Environment.GetResourceString("Arg_NamedParamTooBig"), nameof(namedParams)); } } #endregion @@ -4026,22 +4027,22 @@ namespace System { #region Preconditions if ((bindingFlags & ClassicBindingMask) == 0) - throw new ArgumentException(SR.Arg_COMAccess, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_COMAccess"), nameof(bindingFlags)); if ((bindingFlags & BindingFlags.GetProperty) != 0 && (bindingFlags & ClassicBindingMask & ~(BindingFlags.GetProperty | BindingFlags.InvokeMethod)) != 0) - throw new ArgumentException(SR.Arg_PropSetGet, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_PropSetGet"), nameof(bindingFlags)); if ((bindingFlags & BindingFlags.InvokeMethod) != 0 && (bindingFlags & ClassicBindingMask & ~(BindingFlags.GetProperty | BindingFlags.InvokeMethod)) != 0) - throw new ArgumentException(SR.Arg_PropSetInvoke, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_PropSetInvoke"), nameof(bindingFlags)); if ((bindingFlags & BindingFlags.SetProperty) != 0 && (bindingFlags & ClassicBindingMask & ~BindingFlags.SetProperty) != 0) - throw new ArgumentException(SR.Arg_COMPropSetPut, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_COMPropSetPut"), nameof(bindingFlags)); if ((bindingFlags & BindingFlags.PutDispProperty) != 0 && (bindingFlags & ClassicBindingMask & ~BindingFlags.PutDispProperty) != 0) - throw new ArgumentException(SR.Arg_COMPropSetPut, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_COMPropSetPut"), nameof(bindingFlags)); if ((bindingFlags & BindingFlags.PutRefDispProperty) != 0 && (bindingFlags & ClassicBindingMask & ~BindingFlags.PutRefDispProperty) != 0) - throw new ArgumentException(SR.Arg_COMPropSetPut, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_COMPropSetPut"), nameof(bindingFlags)); #endregion { @@ -4064,7 +4065,7 @@ namespace System #region Check that any named paramters are not null if (namedParams != null && Array.IndexOf(namedParams, null) != -1) // "Named parameter value must not be null." - throw new ArgumentException(SR.Arg_NamedParamNull, nameof(namedParams)); + throw new ArgumentException(Environment.GetResourceString("Arg_NamedParamNull"), nameof(namedParams)); #endregion int argCnt = (providedArgs != null) ? providedArgs.Length : 0; @@ -4081,7 +4082,7 @@ namespace System { if ((bindingFlags & BindingFlags.CreateInstance) != 0 && (bindingFlags & BinderNonCreateInstance) != 0) // "Can not specify both CreateInstance and another access type." - throw new ArgumentException(SR.Arg_CreatInstAccess, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_CreatInstAccess"), nameof(bindingFlags)); return Activator.CreateInstance(this, bindingFlags, binder, providedArgs, culture); } @@ -4118,11 +4119,11 @@ namespace System { if (IsSetField) // "Can not specify both Get and Set on a field." - throw new ArgumentException(SR.Arg_FldSetGet, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_FldSetGet"), nameof(bindingFlags)); if ((bindingFlags & BindingFlags.SetProperty) != 0) // "Can not specify both GetField and SetProperty." - throw new ArgumentException(SR.Arg_FldGetPropSet, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_FldGetPropSet"), nameof(bindingFlags)); } else { @@ -4133,11 +4134,11 @@ namespace System if ((bindingFlags & BindingFlags.GetProperty) != 0) // "Can not specify both SetField and GetProperty." - throw new ArgumentException(SR.Arg_FldSetPropGet, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_FldSetPropGet"), nameof(bindingFlags)); if ((bindingFlags & BindingFlags.InvokeMethod) != 0) // "Can not specify Set on a Field and Invoke on a method." - throw new ArgumentException(SR.Arg_FldSetInvoke, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_FldSetInvoke"), nameof(bindingFlags)); } #endregion @@ -4186,7 +4187,7 @@ namespace System } catch (InvalidCastException) { - throw new ArgumentException(SR.Arg_IndexMustBeInt); + throw new ArgumentException(Environment.GetResourceString("Arg_IndexMustBeInt")); } } @@ -4211,7 +4212,7 @@ namespace System { #region Get the field value if (argCnt != 0) - throw new ArgumentException(SR.Arg_FldGetArgErr, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_FldGetArgErr"), nameof(bindingFlags)); return selFld.GetValue(target); #endregion @@ -4220,7 +4221,7 @@ namespace System { #region Set the field Value if (argCnt != 1) - throw new ArgumentException(SR.Arg_FldSetArgErr, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_FldSetArgErr"), nameof(bindingFlags)); selFld.SetValue(target, providedArgs[0], bindingFlags, binder, culture); @@ -4271,7 +4272,7 @@ namespace System Debug.Assert(!IsSetField); if (isSetProperty) - throw new ArgumentException(SR.Arg_PropSetGet, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_PropSetGet"), nameof(bindingFlags)); } else { @@ -4280,7 +4281,7 @@ namespace System Debug.Assert(!IsGetField); if ((bindingFlags & BindingFlags.InvokeMethod) != 0) - throw new ArgumentException(SR.Arg_PropSetInvoke, nameof(bindingFlags)); + throw new ArgumentException(Environment.GetResourceString("Arg_PropSetInvoke"), nameof(bindingFlags)); } #endregion } @@ -4485,7 +4486,7 @@ namespace System RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.GetCustomAttributes(this, attributeRuntimeType, inherit); } @@ -4499,7 +4500,7 @@ namespace System RuntimeType attributeRuntimeType = attributeType.UnderlyingSystemType as RuntimeType; if (attributeRuntimeType == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(attributeType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(attributeType)); return CustomAttribute.IsDefined(this, attributeRuntimeType, inherit); } @@ -4602,20 +4603,20 @@ namespace System private void CreateInstanceCheckThis() { if (this is ReflectionOnlyType) - throw new ArgumentException(SR.Arg_ReflectionOnlyInvoke); + throw new ArgumentException(Environment.GetResourceString("Arg_ReflectionOnlyInvoke")); if (ContainsGenericParameters) throw new ArgumentException( - SR.Format(SR.Acc_CreateGenericEx, this)); + Environment.GetResourceString("Acc_CreateGenericEx", this)); Contract.EndContractBlock(); Type elementType = this.GetRootElementType(); if (Object.ReferenceEquals(elementType, typeof(ArgIterator))) - throw new NotSupportedException(SR.Acc_CreateArgIterator); + throw new NotSupportedException(Environment.GetResourceString("Acc_CreateArgIterator")); if (Object.ReferenceEquals(elementType, typeof(void))) - throw new NotSupportedException(SR.Acc_CreateVoid); + throw new NotSupportedException(Environment.GetResourceString("Acc_CreateVoid")); } internal Object CreateInstanceImpl( @@ -4669,7 +4670,7 @@ namespace System if (cons == null) { - throw new MissingMethodException(SR.Format(SR.MissingConstructor_Name, FullName)); + throw new MissingMethodException(Environment.GetResourceString("MissingConstructor_Name", FullName)); } MethodBase invokeMethod; @@ -4683,7 +4684,7 @@ namespace System if (invokeMethod == null) { - throw new MissingMethodException(SR.Format(SR.MissingConstructor_Name, FullName)); + throw new MissingMethodException(Environment.GetResourceString("MissingConstructor_Name", FullName)); } if (invokeMethod.GetParametersNoCopy().Length == 0) @@ -4693,7 +4694,7 @@ namespace System Debug.Assert((invokeMethod.CallingConvention & CallingConventions.VarArgs) == CallingConventions.VarArgs); throw new NotSupportedException(String.Format(CultureInfo.CurrentCulture, - SR.NotSupported_CallToVarArg)); + Environment.GetResourceString("NotSupported_CallToVarArg"))); } // fast path?? @@ -4833,7 +4834,7 @@ namespace System internal Object CreateInstanceDefaultCtor(bool publicOnly, bool skipCheckThis, bool fillCache, ref StackCrawlMark stackMark) { if (GetType() == typeof(ReflectionOnlyType)) - throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInReflectionOnly); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInReflectionOnly")); ActivatorCache activatorCache = s_ActivatorCache; if (activatorCache != null) @@ -4846,7 +4847,7 @@ namespace System if (ace.m_ctor != null && (ace.m_ctorAttributes & MethodAttributes.MemberAccessMask) != MethodAttributes.Public) { - throw new MissingMethodException(SR.Arg_NoDefCTor); + throw new MissingMethodException(Environment.GetResourceString("Arg_NoDefCTor")); } } @@ -4943,7 +4944,7 @@ namespace System { get { - throw new InvalidOperationException(SR.InvalidOperation_NotAllowedInReflectionOnly); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NotAllowedInReflectionOnly")); } } } diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs b/src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs index 9e4673b624..eed21cf6fb 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/ConditionalWeakTable.cs @@ -973,7 +973,7 @@ namespace System.Runtime.CompilerServices { if (_invalid) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionCorrupted); + throw new InvalidOperationException(Environment.GetResourceString("CollectionCorrupted")); } } diff --git a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs index dc27a65c43..abb5a8f656 100644 --- a/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs +++ b/src/mscorlib/src/System/Runtime/CompilerServices/RuntimeWrappedException.cs @@ -22,7 +22,7 @@ namespace System.Runtime.CompilerServices public sealed class RuntimeWrappedException : Exception { private RuntimeWrappedException(Object thrownObject) - : base(SR.RuntimeWrappedException) + : base(Environment.GetResourceString("RuntimeWrappedException")) { SetErrorCode(System.__HResults.COR_E_RUNTIMEWRAPPED); m_wrappedException = thrownObject; diff --git a/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionNotification.cs b/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionNotification.cs index d986ea9c24..70b9418263 100644 --- a/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionNotification.cs +++ b/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionNotification.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. /*============================================================================= diff --git a/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs b/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs index 9e87b21737..4666611278 100644 --- a/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs +++ b/src/mscorlib/src/System/Runtime/ExceptionServices/ExceptionServicesCommon.cs @@ -101,7 +101,7 @@ namespace System.Runtime.ExceptionServices { if (source == null) { - throw new ArgumentNullException(nameof(source), SR.ArgumentNull_Obj); + throw new ArgumentNullException(nameof(source), Environment.GetResourceString("ArgumentNull_Obj")); } return new ExceptionDispatchInfo(source); diff --git a/src/mscorlib/src/System/Runtime/GcSettings.cs b/src/mscorlib/src/System/Runtime/GcSettings.cs index 993a24f986..834307190b 100644 --- a/src/mscorlib/src/System/Runtime/GcSettings.cs +++ b/src/mscorlib/src/System/Runtime/GcSettings.cs @@ -50,7 +50,7 @@ namespace System.Runtime { if ((value < GCLatencyMode.Batch) || (value > GCLatencyMode.SustainedLowLatency)) { - throw new ArgumentOutOfRangeException(SR.ArgumentOutOfRange_Enum); + throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum")); } Contract.EndContractBlock(); @@ -72,7 +72,7 @@ namespace System.Runtime if ((value < GCLargeObjectHeapCompactionMode.Default) || (value > GCLargeObjectHeapCompactionMode.CompactOnce)) { - throw new ArgumentOutOfRangeException(SR.ArgumentOutOfRange_Enum); + throw new ArgumentOutOfRangeException(Environment.GetResourceString("ArgumentOutOfRange_Enum")); } Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs b/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs index f8fcfb5826..82a0f098a1 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/COMException.cs @@ -26,7 +26,7 @@ namespace System.Runtime.InteropServices public class COMException : ExternalException { public COMException() - : base(SR.Arg_COMException) + : base(Environment.GetResourceString("Arg_COMException")) { SetErrorCode(__HResults.E_FAIL); } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs index 4b436825e8..51c379f369 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/CurrencyWrapper.cs @@ -27,7 +27,7 @@ namespace System.Runtime.InteropServices public CurrencyWrapper(Object obj) { if (!(obj is Decimal)) - throw new ArgumentException(SR.Arg_MustBeDecimal, nameof(obj)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDecimal"), nameof(obj)); m_WrappedObject = (Decimal)obj; } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs b/src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs index 73be2c5777..ff96aeff61 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/ErrorWrapper.cs @@ -27,7 +27,7 @@ namespace System.Runtime.InteropServices public ErrorWrapper(Object errorCode) { if (!(errorCode is int)) - throw new ArgumentException(SR.Arg_MustBeInt32, nameof(errorCode)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeInt32"), nameof(errorCode)); m_ErrorCode = (int)errorCode; } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/ExternalException.cs b/src/mscorlib/src/System/Runtime/InteropServices/ExternalException.cs index 323a9a666a..8aea9b2a1b 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/ExternalException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/ExternalException.cs @@ -26,7 +26,7 @@ namespace System.Runtime.InteropServices public class ExternalException : SystemException { public ExternalException() - : base(SR.Arg_ExternalException) + : base(Environment.GetResourceString("Arg_ExternalException")) { SetErrorCode(__HResults.E_FAIL); } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/GCHandleCookieTable.cs b/src/mscorlib/src/System/Runtime/InteropServices/GCHandleCookieTable.cs index 9e813d9bd9..304f369879 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/GCHandleCookieTable.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/GCHandleCookieTable.cs @@ -91,7 +91,7 @@ namespace System.Runtime.InteropServices } if (cookie == GCHandleCookie.Zero) - throw new OutOfMemoryException(SR.OutOfMemory_GCHandleMDA); + throw new OutOfMemoryException(Environment.GetResourceString("OutOfMemory_GCHandleMDA")); // This handle hasn't been added to the map yet so add it. m_HandleToCookieMap.Add(handle, cookie); diff --git a/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs b/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs index dcb9e24258..4cf21401fd 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/GcHandle.cs @@ -140,7 +140,7 @@ namespace System.Runtime.InteropServices ValidateHandle(); // You can only get the address of pinned handles. - throw new InvalidOperationException(SR.InvalidOperation_HandleIsNotPinned); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_HandleIsNotPinned")); } // Get the address. diff --git a/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs b/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs index 5e26352090..b7fb686a39 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/InvalidComObjectException.cs @@ -21,7 +21,7 @@ namespace System.Runtime.InteropServices public class InvalidComObjectException : SystemException { public InvalidComObjectException() - : base(SR.Arg_InvalidComObjectException) + : base(Environment.GetResourceString("Arg_InvalidComObjectException")) { SetErrorCode(__HResults.COR_E_INVALIDCOMOBJECT); } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs b/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs index 6e644181ec..8ce8bb2a06 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/InvalidOleVariantTypeException.cs @@ -20,7 +20,7 @@ namespace System.Runtime.InteropServices public class InvalidOleVariantTypeException : SystemException { public InvalidOleVariantTypeException() - : base(SR.Arg_InvalidOleVariantTypeException) + : base(Environment.GetResourceString("Arg_InvalidOleVariantTypeException")) { SetErrorCode(__HResults.COR_E_INVALIDOLEVARIANTTYPE); } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs b/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs index 306d889d04..142389e29d 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/Marshal.cs @@ -240,9 +240,9 @@ namespace System.Runtime.InteropServices if (t == null) throw new ArgumentNullException(nameof(t)); if (!(t is RuntimeType)) - throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(t)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(t)); if (t.IsGenericType) - throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(t)); + throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(t)); Contract.EndContractBlock(); return SizeOfHelper(t, true); @@ -296,10 +296,10 @@ namespace System.Runtime.InteropServices FieldInfo f = t.GetField(fieldName, BindingFlags.Instance | BindingFlags.Public | BindingFlags.NonPublic); if (f == null) - throw new ArgumentException(SR.Format(SR.Argument_OffsetOfFieldNotFound, t.FullName), nameof(fieldName)); + throw new ArgumentException(Environment.GetResourceString("Argument_OffsetOfFieldNotFound", t.FullName), nameof(fieldName)); RtFieldInfo rtField = f as RtFieldInfo; if (rtField == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeFieldInfo, nameof(fieldName)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeFieldInfo"), nameof(fieldName)); return OffsetOfHelper(rtField); } @@ -799,7 +799,7 @@ namespace System.Runtime.InteropServices RuntimeMethodInfo rmi = m as RuntimeMethodInfo; if (rmi == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo")); InternalPrelink(rmi); } @@ -866,12 +866,12 @@ namespace System.Runtime.InteropServices throw new ArgumentNullException(nameof(structureType)); if (structureType.IsGenericType) - throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(structureType)); + throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(structureType)); RuntimeType rt = structureType.UnderlyingSystemType as RuntimeType; if (rt == null) - throw new ArgumentException(SR.Arg_MustBeType, nameof(structureType)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeType"), nameof(structureType)); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; @@ -925,7 +925,7 @@ namespace System.Runtime.InteropServices } if (rtModule == null) - throw new ArgumentNullException(nameof(m), SR.Argument_MustBeRuntimeModule); + throw new ArgumentNullException(nameof(m), Environment.GetResourceString("Argument_MustBeRuntimeModule")); return GetHINSTANCE(rtModule.GetNativeHandle()); } @@ -1424,7 +1424,7 @@ namespace System.Runtime.InteropServices } catch (InvalidCastException) { - throw new ArgumentException(SR.Argument_ObjNotComObject, nameof(o)); + throw new ArgumentException(Environment.GetResourceString("Argument_ObjNotComObject"), nameof(o)); } return co.ReleaseSelf(); @@ -1453,7 +1453,7 @@ namespace System.Runtime.InteropServices } catch (InvalidCastException) { - throw new ArgumentException(SR.Argument_ObjNotComObject, nameof(o)); + throw new ArgumentException(Environment.GetResourceString("Argument_ObjNotComObject"), nameof(o)); } co.FinalReleaseSelf(); @@ -1495,13 +1495,13 @@ namespace System.Runtime.InteropServices if (t == null) throw new ArgumentNullException(nameof(t)); if (!t.IsCOMObject) - throw new ArgumentException(SR.Argument_TypeNotComObject, nameof(t)); + throw new ArgumentException(Environment.GetResourceString("Argument_TypeNotComObject"), nameof(t)); if (t.IsGenericType) - throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(t)); + throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(t)); Contract.EndContractBlock(); if (t.IsWindowsRuntimeObject) - throw new ArgumentException(SR.Argument_TypeIsWinRTType, nameof(t)); + throw new ArgumentException(Environment.GetResourceString("Argument_TypeIsWinRTType"), nameof(t)); // Check for the null case. if (o == null) @@ -1509,9 +1509,9 @@ namespace System.Runtime.InteropServices // Make sure the object is a COM object. if (!o.GetType().IsCOMObject) - throw new ArgumentException(SR.Argument_ObjNotComObject, nameof(o)); + throw new ArgumentException(Environment.GetResourceString("Argument_ObjNotComObject"), nameof(o)); if (o.GetType().IsWindowsRuntimeObject) - throw new ArgumentException(SR.Argument_ObjIsWinRTObject, nameof(o)); + throw new ArgumentException(Environment.GetResourceString("Argument_ObjIsWinRTObject"), nameof(o)); // Check to see if the type of the object is the requested type. if (o.GetType() == t) @@ -1621,9 +1621,9 @@ namespace System.Runtime.InteropServices if (type == null) throw new ArgumentNullException(nameof(type)); if (type.IsImport) - throw new ArgumentException(SR.Argument_TypeMustNotBeComImport, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_TypeMustNotBeComImport"), nameof(type)); if (type.IsGenericType) - throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(type)); Contract.EndContractBlock(); IList<CustomAttributeData> cas = CustomAttributeData.GetCustomAttributes(type); @@ -1724,14 +1724,14 @@ namespace System.Runtime.InteropServices Contract.EndContractBlock(); if ((t as RuntimeType) == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType, nameof(t)); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType"), nameof(t)); if (t.IsGenericType) - throw new ArgumentException(SR.Argument_NeedNonGenericType, nameof(t)); + throw new ArgumentException(Environment.GetResourceString("Argument_NeedNonGenericType"), nameof(t)); Type c = t.BaseType; if (c == null || (c != typeof(Delegate) && c != typeof(MulticastDelegate))) - throw new ArgumentException(SR.Arg_MustBeDelegate, nameof(t)); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeDelegate"), nameof(t)); return GetDelegateForFunctionPointerInternal(ptr, t); } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs b/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs index 4634ea893c..8240e299cb 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/MarshalDirectiveException.cs @@ -21,7 +21,7 @@ namespace System.Runtime.InteropServices public class MarshalDirectiveException : SystemException { public MarshalDirectiveException() - : base(SR.Arg_MarshalDirectiveException) + : base(Environment.GetResourceString("Arg_MarshalDirectiveException")) { SetErrorCode(__HResults.COR_E_MARSHALDIRECTIVE); } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs b/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs index 96bbdd7b59..ad64e5e927 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayRankMismatchException.cs @@ -20,7 +20,7 @@ namespace System.Runtime.InteropServices public class SafeArrayRankMismatchException : SystemException { public SafeArrayRankMismatchException() - : base(SR.Arg_SafeArrayRankMismatchException) + : base(Environment.GetResourceString("Arg_SafeArrayRankMismatchException")) { SetErrorCode(__HResults.COR_E_SAFEARRAYRANKMISMATCH); } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs b/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs index 2ec2f9e80a..d541cf41b5 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/SafeArrayTypeMismatchException.cs @@ -21,7 +21,7 @@ namespace System.Runtime.InteropServices public class SafeArrayTypeMismatchException : SystemException { public SafeArrayTypeMismatchException() - : base(SR.Arg_SafeArrayTypeMismatchException) + : base(Environment.GetResourceString("Arg_SafeArrayTypeMismatchException")) { SetErrorCode(__HResults.COR_E_SAFEARRAYTYPEMISMATCH); } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/SafeBuffer.cs b/src/mscorlib/src/System/Runtime/InteropServices/SafeBuffer.cs index aba25e94a3..7fb3e4e5e8 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/SafeBuffer.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/SafeBuffer.cs @@ -99,13 +99,13 @@ namespace System.Runtime.InteropServices public void Initialize(ulong numBytes) { if (numBytes < 0) - throw new ArgumentOutOfRangeException(nameof(numBytes), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(numBytes), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (IntPtr.Size == 4 && numBytes > UInt32.MaxValue) - throw new ArgumentOutOfRangeException(nameof(numBytes), SR.ArgumentOutOfRange_AddressSpace); + throw new ArgumentOutOfRangeException(nameof(numBytes), Environment.GetResourceString("ArgumentOutOfRange_AddressSpace")); Contract.EndContractBlock(); if (numBytes >= (ulong)Uninitialized) - throw new ArgumentOutOfRangeException(nameof(numBytes), SR.ArgumentOutOfRange_UIntPtrMax); + throw new ArgumentOutOfRangeException(nameof(numBytes), Environment.GetResourceString("ArgumentOutOfRange_UIntPtrMax-1")); _numBytes = (UIntPtr)numBytes; } @@ -118,16 +118,16 @@ namespace System.Runtime.InteropServices public void Initialize(uint numElements, uint sizeOfEachElement) { if (numElements < 0) - throw new ArgumentOutOfRangeException(nameof(numElements), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(numElements), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (sizeOfEachElement < 0) - throw new ArgumentOutOfRangeException(nameof(sizeOfEachElement), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(sizeOfEachElement), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (IntPtr.Size == 4 && numElements * sizeOfEachElement > UInt32.MaxValue) - throw new ArgumentOutOfRangeException("numBytes", SR.ArgumentOutOfRange_AddressSpace); + throw new ArgumentOutOfRangeException("numBytes", Environment.GetResourceString("ArgumentOutOfRange_AddressSpace")); Contract.EndContractBlock(); if (numElements * sizeOfEachElement >= (ulong)Uninitialized) - throw new ArgumentOutOfRangeException(nameof(numElements), SR.ArgumentOutOfRange_UIntPtrMax); + throw new ArgumentOutOfRangeException(nameof(numElements), Environment.GetResourceString("ArgumentOutOfRange_UIntPtrMax-1")); _numBytes = checked((UIntPtr)(numElements * sizeOfEachElement)); } @@ -240,13 +240,13 @@ namespace System.Runtime.InteropServices where T : struct { if (array == null) - throw new ArgumentNullException(nameof(array), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(array), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0) - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (array.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); if (_numBytes == Uninitialized) @@ -311,13 +311,13 @@ namespace System.Runtime.InteropServices where T : struct { if (array == null) - throw new ArgumentNullException(nameof(array), SR.ArgumentNull_Buffer); + throw new ArgumentNullException(nameof(array), Environment.GetResourceString("ArgumentNull_Buffer")); if (index < 0) - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (array.Length - index < count) - throw new ArgumentException(SR.Argument_InvalidOffLen); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidOffLen")); Contract.EndContractBlock(); if (_numBytes == Uninitialized) @@ -372,13 +372,13 @@ namespace System.Runtime.InteropServices private static void NotEnoughRoom() { - throw new ArgumentException(SR.Arg_BufferTooSmall); + throw new ArgumentException(Environment.GetResourceString("Arg_BufferTooSmall")); } private static InvalidOperationException NotInitialized() { Debug.Assert(false, "Uninitialized SafeBuffer! Someone needs to call Initialize before using this instance!"); - return new InvalidOperationException(SR.InvalidOperation_MustCallInitialize); + return new InvalidOperationException(Environment.GetResourceString("InvalidOperation_MustCallInitialize")); } // FCALL limitations mean we can't have generic FCALL methods. However, we can pass diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToCollectionAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToCollectionAdapter.cs index 350920564a..2d0e9a799c 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToCollectionAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToCollectionAdapter.cs @@ -39,7 +39,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime uint size = _this.Size; if (((uint)Int32.MaxValue) < size) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } return (int)size; @@ -68,7 +68,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // ICollection expects the destination array to be single-dimensional. if (array.Rank != 1) - throw new ArgumentException(SR.Arg_RankMultiDimNotSupported); + throw new ArgumentException(Environment.GetResourceString("Arg_RankMultiDimNotSupported")); int destLB = array.GetLowerBound(0); @@ -88,10 +88,10 @@ namespace System.Runtime.InteropServices.WindowsRuntime // list.CopyTo(items, 0); if (srcLen > (destLen - (arrayIndex - destLB))) - throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection); + throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection")); if (arrayIndex - destLB > destLen) - throw new ArgumentException(SR.Argument_IndexOutOfArrayBounds); + throw new ArgumentException(Environment.GetResourceString("Argument_IndexOutOfArrayBounds")); // We need to verify the index as we; IBindableVector _this = JitHelpers.UnsafeCast<IBindableVector>(this); diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToListAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToListAdapter.cs index 539b8020b8..d6e50f5164 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToListAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/BindableVectorToListAdapter.cs @@ -60,7 +60,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime uint size = _this.Size; if (((uint)Int32.MaxValue) < size) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } return (int)(size - 1); @@ -109,7 +109,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (((uint)Int32.MaxValue) < index) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } return (int)index; @@ -137,7 +137,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { if (((uint)Int32.MaxValue) < index) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } RemoveAtHelper(_this, index); diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs index aa0f3ba056..8fd30438ad 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CLRIPropertyValueImpl.cs @@ -134,7 +134,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public char GetChar16() { if (this.Type != PropertyType.Char16) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Char16"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Char16"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return (char)_data; } @@ -143,7 +143,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public Boolean GetBoolean() { if (this.Type != PropertyType.Boolean) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Boolean"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Boolean"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return (bool)_data; } @@ -166,7 +166,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public DateTimeOffset GetDateTime() { if (this.Type != PropertyType.DateTime) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "DateTime"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "DateTime"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return (DateTimeOffset)_data; } @@ -175,7 +175,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public TimeSpan GetTimeSpan() { if (this.Type != PropertyType.TimeSpan) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "TimeSpan"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "TimeSpan"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return (TimeSpan)_data; } @@ -184,7 +184,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public Point GetPoint() { if (this.Type != PropertyType.Point) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Point"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Point"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return Unbox<Point>(IReferenceFactory.s_pointType); @@ -194,7 +194,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public Size GetSize() { if (this.Type != PropertyType.Size) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Size"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Size"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return Unbox<Size>(IReferenceFactory.s_sizeType); @@ -204,7 +204,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public Rect GetRect() { if (this.Type != PropertyType.Rect) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Rect"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Rect"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return Unbox<Rect>(IReferenceFactory.s_rectType); @@ -268,7 +268,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public char[] GetChar16Array() { if (this.Type != PropertyType.Char16Array) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Char16[]"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Char16[]"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return (char[])_data; } @@ -277,7 +277,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public Boolean[] GetBooleanArray() { if (this.Type != PropertyType.BooleanArray) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Boolean[]"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Boolean[]"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return (bool[])_data; } @@ -292,7 +292,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public Object[] GetInspectableArray() { if (this.Type != PropertyType.InspectableArray) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Inspectable[]"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Inspectable[]"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return (Object[])_data; } @@ -307,7 +307,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public DateTimeOffset[] GetDateTimeArray() { if (this.Type != PropertyType.DateTimeArray) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "DateTimeOffset[]"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "DateTimeOffset[]"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return (DateTimeOffset[])_data; } @@ -316,7 +316,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public TimeSpan[] GetTimeSpanArray() { if (this.Type != PropertyType.TimeSpanArray) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "TimeSpan[]"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "TimeSpan[]"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return (TimeSpan[])_data; } @@ -325,7 +325,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public Point[] GetPointArray() { if (this.Type != PropertyType.PointArray) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Point[]"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Point[]"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return UnboxArray<Point>(IReferenceFactory.s_pointType); @@ -335,7 +335,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public Size[] GetSizeArray() { if (this.Type != PropertyType.SizeArray) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Size[]"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Size[]"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); @@ -346,7 +346,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public Rect[] GetRectArray() { if (this.Type != PropertyType.RectArray) - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, "Rect[]"), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, "Rect[]"), __HResults.TYPE_E_TYPEMISMATCH); Contract.EndContractBlock(); return UnboxArray<Rect>(IReferenceFactory.s_rectType); @@ -364,7 +364,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime Array dataArray = _data as Array; if (dataArray == null) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, this.Type, typeof (T).MakeArrayType().Name), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", this.Type, typeof(T).MakeArrayType().Name), __HResults.TYPE_E_TYPEMISMATCH); } // Array types are 1024 larger than their equivilent scalar counterpart @@ -382,7 +382,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime } catch (InvalidCastException elementCastException) { - Exception e = new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueArrayCoersion, this.Type, typeof (T).MakeArrayType().Name, i, elementCastException.Message), elementCastException); + Exception e = new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueArrayCoersion", this.Type, typeof(T).MakeArrayType().Name, i, elementCastException.Message), elementCastException); e.SetErrorCode(elementCastException._HResult); throw e; } @@ -408,7 +408,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // should not attempt coersion, even if the underlying value is technically convertable if (!IsCoercable(type, value) && type != PropertyType.Inspectable) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, type, typeof (T).Name), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", type, typeof(T).Name), __HResults.TYPE_E_TYPEMISMATCH); } try @@ -438,15 +438,15 @@ namespace System.Runtime.InteropServices.WindowsRuntime } catch (FormatException) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, type, typeof (T).Name), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", type, typeof(T).Name), __HResults.TYPE_E_TYPEMISMATCH); } catch (InvalidCastException) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, type, typeof (T).Name), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", type, typeof(T).Name), __HResults.TYPE_E_TYPEMISMATCH); } catch (OverflowException) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueCoersion, type, value, typeof (T).Name), __HResults.DISP_E_OVERFLOW); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueCoersion", type, value, typeof(T).Name), __HResults.DISP_E_OVERFLOW); } // If the property type is IInspectable, and we have a nested IPropertyValue, then we need @@ -497,7 +497,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime } // Otherwise, this is an invalid coersion - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, type, typeof (T).Name), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", type, typeof(T).Name), __HResults.TYPE_E_TYPEMISMATCH); } private static bool IsCoercable(PropertyType type, object data) @@ -539,7 +539,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (_data.GetType() != expectedBoxedType) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, _data.GetType(), expectedBoxedType.Name), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", _data.GetType(), expectedBoxedType.Name), __HResults.TYPE_E_TYPEMISMATCH); } T unboxed = new T(); @@ -563,7 +563,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime Array dataArray = _data as Array; if (dataArray == null || _data.GetType().GetElementType() != expectedArrayElementType) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_WinRTIPropertyValueElement, _data.GetType(), expectedArrayElementType.MakeArrayType().Name), __HResults.TYPE_E_TYPEMISMATCH); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_WinRTIPropertyValueElement", _data.GetType(), expectedArrayElementType.MakeArrayType().Name), __HResults.TYPE_E_TYPEMISMATCH); } T[] converted = new T[dataArray.Length]; diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs index 4549a407e0..0e9140f41b 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ConstantSplittableMap.cs @@ -102,7 +102,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (!found) { - Exception e = new KeyNotFoundException(SR.Arg_KeyNotFound); + Exception e = new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound")); e.SetErrorCode(__HResults.E_BOUNDS); throw e; } @@ -205,8 +205,8 @@ namespace System.Runtime.InteropServices.WindowsRuntime { get { - if (_current < _start) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); - if (_current > _end) throw new InvalidOperationException(SR.GetResourceString(ResId.InvalidOperation_EnumEnded)); + if (_current < _start) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumNotStarted)); + if (_current > _end) throw new InvalidOperationException(Environment.GetResourceString(ResId.InvalidOperation_EnumEnded)); return new CLRIKeyValuePairImpl<TKey, TValue>(ref _array[_current]); } } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CustomPropertyImpl.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CustomPropertyImpl.cs index 63565a39b8..fe1ecff161 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CustomPropertyImpl.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/CustomPropertyImpl.cs @@ -107,19 +107,19 @@ namespace System.Runtime.InteropServices.WindowsRuntime MethodInfo accessor = getValue ? m_property.GetGetMethod(true) : m_property.GetSetMethod(true); if (accessor == null) - throw new ArgumentException(getValue ? SR.Arg_GetMethNotFnd : SR.Arg_SetMethNotFnd); + throw new ArgumentException(System.Environment.GetResourceString(getValue ? "Arg_GetMethNotFnd" : "Arg_SetMethNotFnd")); if (!accessor.IsPublic) throw new MethodAccessException( String.Format( CultureInfo.CurrentCulture, - SR.Arg_MethodAccessException_WithMethodName, + Environment.GetResourceString("Arg_MethodAccessException_WithMethodName"), accessor.ToString(), accessor.DeclaringType.FullName)); RuntimeMethodInfo rtMethod = accessor as RuntimeMethodInfo; if (rtMethod == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeMethodInfo); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeMethodInfo")); // We can safely skip access check because this is only used in full trust scenarios. // And we have already verified that the property accessor is public. diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs index 2a34aba717..9f33b2f946 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryKeyCollection.cs @@ -30,9 +30,9 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (index < 0) throw new ArgumentOutOfRangeException(nameof(index)); if (array.Length <= index && this.Count > 0) - throw new ArgumentException(SR.Arg_IndexOutOfRangeException); + throw new ArgumentException(Environment.GetResourceString("Arg_IndexOutOfRangeException")); if (array.Length - index < dictionary.Count) - throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection); + throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection")); int i = index; foreach (KeyValuePair<TKey, TValue> mapping in dictionary) @@ -53,12 +53,12 @@ namespace System.Runtime.InteropServices.WindowsRuntime void ICollection<TKey>.Add(TKey item) { - throw new NotSupportedException(SR.NotSupported_KeyCollectionSet); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_KeyCollectionSet")); } void ICollection<TKey>.Clear() { - throw new NotSupportedException(SR.NotSupported_KeyCollectionSet); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_KeyCollectionSet")); } public bool Contains(TKey item) @@ -68,7 +68,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime bool ICollection<TKey>.Remove(TKey item) { - throw new NotSupportedException(SR.NotSupported_KeyCollectionSet); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_KeyCollectionSet")); } IEnumerator IEnumerable.GetEnumerator() diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryToMapAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryToMapAdapter.cs index bb54d49b60..b1a4042419 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryToMapAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryToMapAdapter.cs @@ -41,7 +41,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (!keyFound) { - Exception e = new KeyNotFoundException(SR.Arg_KeyNotFound); + Exception e = new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound")); e.SetErrorCode(__HResults.E_BOUNDS); throw e; } @@ -96,7 +96,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (!removed) { - Exception e = new KeyNotFoundException(SR.Arg_KeyNotFound); + Exception e = new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound")); e.SetErrorCode(__HResults.E_BOUNDS); throw e; } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs index 083b0ffcb1..d599d24aa3 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/DictionaryValueCollection.cs @@ -34,9 +34,9 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (index < 0) throw new ArgumentOutOfRangeException(nameof(index)); if (array.Length <= index && this.Count > 0) - throw new ArgumentException(SR.Arg_IndexOutOfRangeException); + throw new ArgumentException(Environment.GetResourceString("Arg_IndexOutOfRangeException")); if (array.Length - index < dictionary.Count) - throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection); + throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection")); int i = index; foreach (KeyValuePair<TKey, TValue> mapping in dictionary) @@ -57,12 +57,12 @@ namespace System.Runtime.InteropServices.WindowsRuntime void ICollection<TValue>.Add(TValue item) { - throw new NotSupportedException(SR.NotSupported_ValueCollectionSet); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ValueCollectionSet")); } void ICollection<TValue>.Clear() { - throw new NotSupportedException(SR.NotSupported_ValueCollectionSet); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ValueCollectionSet")); } public bool Contains(TValue item) @@ -76,7 +76,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime bool ICollection<TValue>.Remove(TValue item) { - throw new NotSupportedException(SR.NotSupported_ValueCollectionSet); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_ValueCollectionSet")); } IEnumerator IEnumerable.GetEnumerator() diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationTokenTable.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationTokenTable.cs index 974da48a42..03b17d9261 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationTokenTable.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/EventRegistrationTokenTable.cs @@ -28,7 +28,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // static check at construction time if (!typeof(Delegate).IsAssignableFrom(typeof(T))) { - throw new InvalidOperationException(SR.Format(SR.InvalidOperation_EventTokenTableRequiresDelegate, typeof (T))); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EventTokenTableRequiresDelegate", typeof(T))); } } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs index e06364dcae..55f8a1e862 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IMapViewToIReadOnlyDictionaryAdapter.cs @@ -114,7 +114,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime catch (Exception ex) { if (__HResults.E_BOUNDS == ex._HResult) - throw new KeyNotFoundException(SR.Arg_KeyNotFound); + throw new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound")); throw; } } @@ -145,9 +145,9 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (index < 0) throw new ArgumentOutOfRangeException(nameof(index)); if (array.Length <= index && this.Count > 0) - throw new ArgumentException(SR.Arg_IndexOutOfRangeException); + throw new ArgumentException(Environment.GetResourceString("Arg_IndexOutOfRangeException")); if (array.Length - index < dictionary.Count) - throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection); + throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection")); int i = index; foreach (KeyValuePair<TKey, TValue> mapping in dictionary) @@ -242,9 +242,9 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (index < 0) throw new ArgumentOutOfRangeException(nameof(index)); if (array.Length <= index && this.Count > 0) - throw new ArgumentException(SR.Arg_IndexOutOfRangeException); + throw new ArgumentException(Environment.GetResourceString("Arg_IndexOutOfRangeException")); if (array.Length - index < dictionary.Count) - throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection); + throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection")); int i = index; foreach (KeyValuePair<TKey, TValue> mapping in dictionary) diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyDictionaryToIMapViewAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyDictionaryToIMapViewAdapter.cs index 73daf876cd..2fac36b23f 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyDictionaryToIMapViewAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyDictionaryToIMapViewAdapter.cs @@ -40,7 +40,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (!keyFound) { - Exception e = new KeyNotFoundException(SR.Arg_KeyNotFound); + Exception e = new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound")); e.SetErrorCode(__HResults.E_BOUNDS); throw e; } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyListToIVectorViewAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyListToIVectorViewAdapter.cs index 5dce7dfc8d..b902ded9c0 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyListToIVectorViewAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/IReadOnlyListToIVectorViewAdapter.cs @@ -126,7 +126,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // that Size > Int32.MaxValue: if (((uint)Int32.MaxValue) <= index || index >= (uint)listCapacity) { - Exception e = new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_IndexLargerThanMaxValue); + Exception e = new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_IndexLargerThanMaxValue")); e.SetErrorCode(__HResults.E_BOUNDS); throw e; } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorAdapter.cs index 5f12322ea8..6010eec6c8 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorAdapter.cs @@ -146,7 +146,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime IList _this = JitHelpers.UnsafeCast<IList>(this); if (_this.Count == 0) { - Exception e = new InvalidOperationException(SR.InvalidOperation_CannotRemoveLastFromEmptyCollection); + Exception e = new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotRemoveLastFromEmptyCollection")); e.SetErrorCode(__HResults.E_BOUNDS); throw e; } @@ -170,7 +170,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // that Size > Int32.MaxValue: if (((uint)Int32.MaxValue) <= index || index >= (uint)listCapacity) { - Exception e = new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_IndexLargerThanMaxValue); + Exception e = new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_IndexLargerThanMaxValue")); e.SetErrorCode(__HResults.E_BOUNDS); throw e; } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorViewAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorViewAdapter.cs index fc02bedfa6..0503b726dd 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorViewAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToBindableVectorViewAdapter.cs @@ -38,7 +38,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // that Size > Int32.MaxValue: if (((uint)Int32.MaxValue) <= index || index >= (uint)listCapacity) { - Exception e = new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_IndexLargerThanMaxValue); + Exception e = new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_IndexLargerThanMaxValue")); e.SetErrorCode(__HResults.E_BOUNDS); throw e; } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToVectorAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToVectorAdapter.cs index 87330e2559..8373885284 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToVectorAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ListToVectorAdapter.cs @@ -155,7 +155,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime IList<T> _this = JitHelpers.UnsafeCast<IList<T>>(this); if (_this.Count == 0) { - Exception e = new InvalidOperationException(SR.InvalidOperation_CannotRemoveLastFromEmptyCollection); + Exception e = new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotRemoveLastFromEmptyCollection")); e.SetErrorCode(__HResults.E_BOUNDS); throw e; } @@ -201,7 +201,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // that Size > Int32.MaxValue: if (((uint)Int32.MaxValue) <= index || index >= (uint)listCapacity) { - Exception e = new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_IndexLargerThanMaxValue); + Exception e = new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_IndexLargerThanMaxValue")); e.SetErrorCode(__HResults.E_BOUNDS); throw e; } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ManagedActivationFactory.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ManagedActivationFactory.cs index 12b13ac79b..cace2047d9 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ManagedActivationFactory.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/ManagedActivationFactory.cs @@ -41,7 +41,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime // Check whether the type is "exported to WinRT", i.e. it is declared in a managed .winmd and is decorated // with at least one ActivatableAttribute or StaticAttribute. if (!(type is RuntimeType) || !type.IsExportedToWindowsRuntime) - throw new ArgumentException(SR.Format(SR.Argument_TypeNotActivatableViaWindowsRuntime, type), nameof(type)); + throw new ArgumentException(Environment.GetResourceString("Argument_TypeNotActivatableViaWindowsRuntime", type), nameof(type)); m_type = type; } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToCollectionAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToCollectionAdapter.cs index 6b6c1719c3..f11260eb4a 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToCollectionAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToCollectionAdapter.cs @@ -46,7 +46,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (((uint)Int32.MaxValue) < size) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingDictionaryTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingDictionaryTooLarge")); } return (int)size; @@ -58,7 +58,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (((uint)Int32.MaxValue) < size) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } return (int)size; @@ -140,10 +140,10 @@ namespace System.Runtime.InteropServices.WindowsRuntime throw new ArgumentOutOfRangeException(nameof(arrayIndex)); if (array.Length <= arrayIndex && Count<K, V>() > 0) - throw new ArgumentException(SR.Argument_IndexOutOfArrayBounds); + throw new ArgumentException(Environment.GetResourceString("Argument_IndexOutOfArrayBounds")); if (array.Length - arrayIndex < Count<K, V>()) - throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection); + throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection")); Contract.EndContractBlock(); @@ -175,7 +175,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (((uint)Int32.MaxValue) < index) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } VectorToListAdapter.RemoveAtHelper<KeyValuePair<K, V>>(_this_vector, index); diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs index 224a266b07..a8a13c6912 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapToDictionaryAdapter.cs @@ -88,7 +88,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime throw new ArgumentNullException(nameof(key)); if (ContainsKey<K, V>(key)) - throw new ArgumentException(SR.Argument_AddingDuplicate); + throw new ArgumentException(Environment.GetResourceString("Argument_AddingDuplicate")); Contract.EndContractBlock(); @@ -158,7 +158,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime catch (Exception ex) { if (__HResults.E_BOUNDS == ex._HResult) - throw new KeyNotFoundException(SR.Arg_KeyNotFound); + throw new KeyNotFoundException(Environment.GetResourceString("Arg_KeyNotFound")); throw; } } diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapViewToReadOnlyCollectionAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapViewToReadOnlyCollectionAdapter.cs index 5d509549d3..a3715da0b0 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapViewToReadOnlyCollectionAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/MapViewToReadOnlyCollectionAdapter.cs @@ -46,7 +46,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (((uint)Int32.MaxValue) < size) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingDictionaryTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingDictionaryTooLarge")); } return (int)size; @@ -58,7 +58,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (((uint)Int32.MaxValue) < size) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } return (int)size; diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToCollectionAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToCollectionAdapter.cs index 3065b83c30..898f1a68a0 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToCollectionAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToCollectionAdapter.cs @@ -38,7 +38,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime uint size = _this.Size; if (((uint)Int32.MaxValue) < size) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } return (int)size; @@ -83,10 +83,10 @@ namespace System.Runtime.InteropServices.WindowsRuntime throw new ArgumentOutOfRangeException(nameof(arrayIndex)); if (array.Length <= arrayIndex && Count<T>() > 0) - throw new ArgumentException(SR.Argument_IndexOutOfArrayBounds); + throw new ArgumentException(Environment.GetResourceString("Argument_IndexOutOfArrayBounds")); if (array.Length - arrayIndex < Count<T>()) - throw new ArgumentException(SR.Argument_InsufficientSpaceToCopyCollection); + throw new ArgumentException(Environment.GetResourceString("Argument_InsufficientSpaceToCopyCollection")); Contract.EndContractBlock(); @@ -111,7 +111,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (((uint)Int32.MaxValue) < index) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } VectorToListAdapter.RemoveAtHelper<T>(_this, index); diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs index 56e62a25e7..3e3324864d 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorToListAdapter.cs @@ -63,7 +63,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime if (((uint)Int32.MaxValue) < index) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } return (int)index; diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorViewToReadOnlyCollectionAdapter.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorViewToReadOnlyCollectionAdapter.cs index 84c12f8a5c..6b7785d2dc 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorViewToReadOnlyCollectionAdapter.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/VectorViewToReadOnlyCollectionAdapter.cs @@ -38,7 +38,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime uint size = _this.Size; if (((uint)Int32.MaxValue) < size) { - throw new InvalidOperationException(SR.InvalidOperation_CollectionBackingListTooLarge); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CollectionBackingListTooLarge")); } return (int)size; diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs index 0b7ba10d62..00dad37a2a 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMarshal.cs @@ -1054,13 +1054,13 @@ namespace System.Runtime.InteropServices.WindowsRuntime string message = innerException.Message; if (message == null && messageResource != null) { - message = SR.GetResourceString(messageResource); + message = Environment.GetResourceString(messageResource); } e = new Exception(message, innerException); } else { - string message = (messageResource != null ? SR.GetResourceString(messageResource): null); + string message = (messageResource != null ? Environment.GetResourceString(messageResource) : null); e = new Exception(message); } @@ -1234,7 +1234,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public static IntPtr StringToHString(String s) { if (!Environment.IsWinRTSupported) - throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT")); if (s == null) throw new ArgumentNullException(nameof(s)); @@ -1252,7 +1252,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { if (!Environment.IsWinRTSupported) { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT")); } return HStringToString(ptr); @@ -1261,7 +1261,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime public static void FreeHString(IntPtr ptr) { if (!Environment.IsWinRTSupported) - throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT")); if (ptr != IntPtr.Zero) { diff --git a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs index 0f28d3b080..b772a2252b 100644 --- a/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs +++ b/src/mscorlib/src/System/Runtime/InteropServices/WindowsRuntime/WindowsRuntimeMetadata.cs @@ -42,7 +42,7 @@ namespace System.Runtime.InteropServices.WindowsRuntime { if (String.IsNullOrEmpty(assemblyFile)) { // DesignerNamespaceResolve event returned null or empty file name - that is not allowed - throw new ArgumentException(SR.Arg_EmptyOrNullString, "DesignerNamespaceResolveEventArgs.ResolvedAssemblyFiles"); + throw new ArgumentException(Environment.GetResourceString("Arg_EmptyOrNullString"), "DesignerNamespaceResolveEventArgs.ResolvedAssemblyFiles"); } retAssemblyFiles[retIndex] = assemblyFile; retIndex++; diff --git a/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs b/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs index 0da47739ff..3f21425a2a 100644 --- a/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs +++ b/src/mscorlib/src/System/Runtime/Loader/AssemblyLoadContext.cs @@ -93,7 +93,7 @@ namespace System.Runtime.Loader if (PathInternal.IsPartiallyQualified(assemblyPath)) { - throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(assemblyPath)); + throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"), nameof(assemblyPath)); } RuntimeAssembly loadedAssembly = null; @@ -110,12 +110,12 @@ namespace System.Runtime.Loader if (PathInternal.IsPartiallyQualified(nativeImagePath)) { - throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(nativeImagePath)); + throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"), nameof(nativeImagePath)); } if (assemblyPath != null && PathInternal.IsPartiallyQualified(assemblyPath)) { - throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(assemblyPath)); + throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"), nameof(assemblyPath)); } // Basic validation has succeeded - lets try to load the NI image. @@ -139,7 +139,7 @@ namespace System.Runtime.Loader if (assembly.Length <= 0) { - throw new BadImageFormatException(SR.BadImageFormat_BadILFormat); + throw new BadImageFormatException(Environment.GetResourceString("BadImageFormat_BadILFormat")); } int iAssemblyStreamLength = (int)assembly.Length; @@ -236,7 +236,7 @@ namespace System.Runtime.Loader // The simple names should match at the very least if (String.IsNullOrEmpty(loadedSimpleName) || (!requestedSimpleName.Equals(loadedSimpleName, StringComparison.InvariantCultureIgnoreCase))) - throw new InvalidOperationException(SR.Argument_CustomAssemblyLoadContextRequestedNameMismatch); + throw new InvalidOperationException(Environment.GetResourceString("Argument_CustomAssemblyLoadContextRequestedNameMismatch")); return assembly; } @@ -269,7 +269,7 @@ namespace System.Runtime.Loader // throw an exception if we do not find any assembly. if (assembly == null) { - throw new FileNotFoundException(SR.IO_FileLoad, simpleName); + throw new FileNotFoundException(Environment.GetResourceString("IO.FileLoad"), simpleName); } return assembly; @@ -297,11 +297,11 @@ namespace System.Runtime.Loader } if (unmanagedDllPath.Length == 0) { - throw new ArgumentException(SR.Argument_EmptyPath, nameof(unmanagedDllPath)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyPath"), nameof(unmanagedDllPath)); } if (PathInternal.IsPartiallyQualified(unmanagedDllPath)) { - throw new ArgumentException(SR.Argument_AbsolutePathRequired, nameof(unmanagedDllPath)); + throw new ArgumentException(Environment.GetResourceString("Argument_AbsolutePathRequired"), nameof(unmanagedDllPath)); } return InternalLoadUnmanagedDllFromPath(unmanagedDllPath); diff --git a/src/mscorlib/src/System/Runtime/MemoryFailPoint.cs b/src/mscorlib/src/System/Runtime/MemoryFailPoint.cs index f9f87bc928..2785942712 100644 --- a/src/mscorlib/src/System/Runtime/MemoryFailPoint.cs +++ b/src/mscorlib/src/System/Runtime/MemoryFailPoint.cs @@ -155,7 +155,7 @@ namespace System.Runtime public MemoryFailPoint(int sizeInMegabytes) { if (sizeInMegabytes <= 0) - throw new ArgumentOutOfRangeException(nameof(sizeInMegabytes), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(sizeInMegabytes), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); #if !FEATURE_PAL // Remove this when CheckForAvailableMemory is able to provide legitimate estimates @@ -170,7 +170,7 @@ namespace System.Runtime // heap, and to check both the normal & large object heaps. ulong segmentSize = (ulong)(Math.Ceiling((double)size / GCSegmentSize) * GCSegmentSize); if (segmentSize >= TopOfMemory) - throw new InsufficientMemoryException(SR.InsufficientMemory_MemFailPoint_TooBig); + throw new InsufficientMemoryException(Environment.GetResourceString("InsufficientMemory_MemFailPoint_TooBig")); ulong requestedSizeRounded = (ulong)(Math.Ceiling((double)sizeInMegabytes / MemoryCheckGranularity) * MemoryCheckGranularity); //re-convert into bytes @@ -266,7 +266,7 @@ namespace System.Runtime // state. if (needPageFile || needAddressSpace) { - InsufficientMemoryException e = new InsufficientMemoryException(SR.InsufficientMemory_MemFailPoint); + InsufficientMemoryException e = new InsufficientMemoryException(Environment.GetResourceString("InsufficientMemory_MemFailPoint")); #if _DEBUG e.Data["MemFailPointState"] = new MemoryFailPointState(sizeInMegabytes, segmentSize, needPageFile, needAddressSpace, needContiguousVASpace, @@ -278,7 +278,7 @@ namespace System.Runtime if (needContiguousVASpace) { - InsufficientMemoryException e = new InsufficientMemoryException(SR.InsufficientMemory_MemFailPoint_VAFrag); + InsufficientMemoryException e = new InsufficientMemoryException(Environment.GetResourceString("InsufficientMemory_MemFailPoint_VAFrag")); #if _DEBUG e.Data["MemFailPointState"] = new MemoryFailPointState(sizeInMegabytes, segmentSize, needPageFile, needAddressSpace, needContiguousVASpace, @@ -349,7 +349,7 @@ namespace System.Runtime LastTimeCheckingAddressSpace = Environment.TickCount; if (freeSpaceAfterGCHeap < size && shouldThrow) - throw new InsufficientMemoryException(SR.InsufficientMemory_MemFailPoint_VAFrag); + throw new InsufficientMemoryException(Environment.GetResourceString("InsufficientMemory_MemFailPoint_VAFrag")); return freeSpaceAfterGCHeap >= size; } diff --git a/src/mscorlib/src/System/Runtime/RuntimeImports.cs b/src/mscorlib/src/System/Runtime/RuntimeImports.cs index 16d41d3951..17a2602cd4 100644 --- a/src/mscorlib/src/System/Runtime/RuntimeImports.cs +++ b/src/mscorlib/src/System/Runtime/RuntimeImports.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. diff --git a/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs b/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs index 5f07c3a5ce..0db38b6545 100644 --- a/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs +++ b/src/mscorlib/src/System/Runtime/Serialization/FormatterServices.cs @@ -48,7 +48,7 @@ namespace System.Runtime.Serialization if (!(type is RuntimeType)) { - throw new SerializationException(SR.Format(SR.Serialization_InvalidType, type.ToString())); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidType", type.ToString())); } return nativeGetUninitializedObject((RuntimeType)type); diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationAttributes.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationAttributes.cs index be9f4aefee..435ca279e4 100644 --- a/src/mscorlib/src/System/Runtime/Serialization/SerializationAttributes.cs +++ b/src/mscorlib/src/System/Runtime/Serialization/SerializationAttributes.cs @@ -32,7 +32,7 @@ namespace System.Runtime.Serialization set { if (value < 1) - throw new ArgumentException(SR.Serialization_OptionalFieldVersionValue); + throw new ArgumentException(Environment.GetResourceString("Serialization_OptionalFieldVersionValue")); Contract.EndContractBlock(); versionAdded = value; } diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationException.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationException.cs index 7f2d2755bc..65db0e930a 100644 --- a/src/mscorlib/src/System/Runtime/Serialization/SerializationException.cs +++ b/src/mscorlib/src/System/Runtime/Serialization/SerializationException.cs @@ -21,7 +21,7 @@ namespace System.Runtime.Serialization [Serializable] public class SerializationException : SystemException { - private static String _nullMessage = SR.Arg_SerializationException; + private static String _nullMessage = Environment.GetResourceString("Arg_SerializationException"); // Creates a new SerializationException with its message // string set to a default message. diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs index 7fc3ce27d9..d024361985 100644 --- a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs +++ b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfo.cs @@ -331,7 +331,7 @@ namespace System.Runtime.Serialization if (m_nameToIndex.ContainsKey(name)) { BCLDebug.Trace("SER", "[SerializationInfo.AddValue]Tried to add ", name, " twice to the SI."); - throw new SerializationException(SR.Serialization_SameNameTwice); + throw new SerializationException(Environment.GetResourceString("Serialization_SameNameTwice")); } m_nameToIndex.Add(name, m_currMember); @@ -415,7 +415,7 @@ namespace System.Runtime.Serialization int index = FindElement(name); if (index == -1) { - throw new SerializationException(SR.Format(SR.Serialization_NotFound, name)); + throw new SerializationException(Environment.GetResourceString("Serialization_NotFound", name)); } Debug.Assert(index < m_data.Length, "[SerializationInfo.GetElement]index<m_data.Length"); @@ -458,7 +458,7 @@ namespace System.Runtime.Serialization RuntimeType rt = type as RuntimeType; if (rt == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeType); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeType")); Type foundType; Object value; diff --git a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfoEnumerator.cs b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfoEnumerator.cs index 615b128f2a..b7857dece2 100644 --- a/src/mscorlib/src/System/Runtime/Serialization/SerializationInfoEnumerator.cs +++ b/src/mscorlib/src/System/Runtime/Serialization/SerializationInfoEnumerator.cs @@ -116,7 +116,7 @@ namespace System.Runtime.Serialization { if (m_current == false) { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } return (Object)(new SerializationEntry(m_members[m_currItem], m_data[m_currItem], m_types[m_currItem])); } @@ -128,7 +128,7 @@ namespace System.Runtime.Serialization { if (m_current == false) { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } return (new SerializationEntry(m_members[m_currItem], m_data[m_currItem], m_types[m_currItem])); } @@ -146,7 +146,7 @@ namespace System.Runtime.Serialization { if (m_current == false) { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } return m_members[m_currItem]; } @@ -157,7 +157,7 @@ namespace System.Runtime.Serialization { if (m_current == false) { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } return m_data[m_currItem]; } @@ -168,7 +168,7 @@ namespace System.Runtime.Serialization { if (m_current == false) { - throw new InvalidOperationException(SR.InvalidOperation_EnumOpCantHappen); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_EnumOpCantHappen")); } return m_types[m_currItem]; } diff --git a/src/mscorlib/src/System/RuntimeHandles.cs b/src/mscorlib/src/System/RuntimeHandles.cs index 37db526aee..dcf8cd6500 100644 --- a/src/mscorlib/src/System/RuntimeHandles.cs +++ b/src/mscorlib/src/System/RuntimeHandles.cs @@ -32,7 +32,7 @@ namespace System // Create local copy to avoid a race condition RuntimeType type = m_type; if (type == null) - throw new ArgumentNullException(null, SR.Arg_InvalidHandle); + throw new ArgumentNullException(null, Environment.GetResourceString("Arg_InvalidHandle")); return new RuntimeTypeHandle(type); } @@ -42,7 +42,7 @@ namespace System // Create local copy to avoid a race condition RuntimeType type = m_type; if (type == null) - throw new ArgumentNullException(null, SR.Arg_InvalidHandle); + throw new ArgumentNullException(null, Environment.GetResourceString("Arg_InvalidHandle")); return type; } @@ -462,7 +462,7 @@ namespace System if (name == null || name.Length == 0) { if (throwOnError) - throw new TypeLoadException(SR.Arg_TypeLoadNullStr); + throw new TypeLoadException(Environment.GetResourceString("Arg_TypeLoadNullStr")); return null; } @@ -611,7 +611,7 @@ namespace System RuntimeType type = GetTypeChecked(); if (!IsGenericVariable(type)) - throw new InvalidOperationException(SR.Arg_NotGenericParameter); + throw new InvalidOperationException(Environment.GetResourceString("Arg_NotGenericParameter")); return GetGenericVariableIndex(type); } @@ -664,7 +664,7 @@ namespace System m_type = m; if (m_type == null) - throw new SerializationException(SR.Serialization_InsufficientState); + throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState")); } public void GetObjectData(SerializationInfo info, StreamingContext context) @@ -674,7 +674,7 @@ namespace System Contract.EndContractBlock(); if (m_type == null) - throw new SerializationException(SR.Serialization_InvalidFieldState); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidFieldState")); info.AddValue("TypeObj", m_type, typeof(RuntimeType)); } @@ -773,7 +773,7 @@ namespace System internal static IRuntimeMethodInfo EnsureNonNullMethodInfo(IRuntimeMethodInfo method) { if (method == null) - throw new ArgumentNullException(null, SR.Arg_InvalidHandle); + throw new ArgumentNullException(null, Environment.GetResourceString("Arg_InvalidHandle")); return method; } @@ -807,7 +807,7 @@ namespace System m_value = m.MethodHandle.m_value; if (m_value == null) - throw new SerializationException(SR.Serialization_InsufficientState); + throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState")); } public void GetObjectData(SerializationInfo info, StreamingContext context) @@ -817,7 +817,7 @@ namespace System Contract.EndContractBlock(); if (m_value == null) - throw new SerializationException(SR.Serialization_InvalidFieldState); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidFieldState")); // This is either a RuntimeMethodInfo or a RuntimeConstructorInfo MethodBase methodInfo = RuntimeType.GetMethodBase(m_value); @@ -1158,7 +1158,7 @@ namespace System // Create local copy to avoid a race condition IRuntimeFieldInfo field = m_ptr; if (field == null) - throw new ArgumentNullException(null, SR.Arg_InvalidHandle); + throw new ArgumentNullException(null, Environment.GetResourceString("Arg_InvalidHandle")); return new RuntimeFieldHandle(field); } @@ -1306,12 +1306,12 @@ namespace System FieldInfo f = (RuntimeFieldInfo)info.GetValue("FieldObj", typeof(RuntimeFieldInfo)); if (f == null) - throw new SerializationException(SR.Serialization_InsufficientState); + throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState")); m_ptr = f.FieldHandle.m_ptr; if (m_ptr == null) - throw new SerializationException(SR.Serialization_InsufficientState); + throw new SerializationException(Environment.GetResourceString("Serialization_InsufficientState")); } public void GetObjectData(SerializationInfo info, StreamingContext context) @@ -1321,7 +1321,7 @@ namespace System Contract.EndContractBlock(); if (m_ptr == null) - throw new SerializationException(SR.Serialization_InvalidFieldState); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidFieldState")); RuntimeFieldInfo fldInfo = (RuntimeFieldInfo)RuntimeType.GetFieldInfo(this.GetRuntimeFieldInfo()); @@ -1399,7 +1399,7 @@ namespace System { // Make sure we have a valid Module to resolve against. if (module == null) - throw new InvalidOperationException(SR.InvalidOperation_NullModuleHandle); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NullModuleHandle")); } // SQL-CLR LKG9 Compiler dependency @@ -1418,7 +1418,7 @@ namespace System ValidateModulePointer(module); if (!ModuleHandle.GetMetadataImport(module).IsValidToken(typeToken)) throw new ArgumentOutOfRangeException(nameof(typeToken), - SR.Format(SR.Argument_InvalidToken, typeToken, new ModuleHandle(module))); + Environment.GetResourceString("Argument_InvalidToken", typeToken, new ModuleHandle(module))); int typeInstCount, methodInstCount; IntPtr[] typeInstantiationContextHandles = RuntimeTypeHandle.CopyRuntimeTypeHandles(typeInstantiationContext, out typeInstCount); @@ -1472,7 +1472,7 @@ namespace System ValidateModulePointer(module); if (!ModuleHandle.GetMetadataImport(module.GetNativeHandle()).IsValidToken(methodToken)) throw new ArgumentOutOfRangeException(nameof(methodToken), - SR.Format(SR.Argument_InvalidToken, methodToken, new ModuleHandle(module))); + Environment.GetResourceString("Argument_InvalidToken", methodToken, new ModuleHandle(module))); fixed (IntPtr* typeInstArgs = typeInstantiationContext, methodInstArgs = methodInstantiationContext) { @@ -1500,7 +1500,7 @@ namespace System ValidateModulePointer(module); if (!ModuleHandle.GetMetadataImport(module.GetNativeHandle()).IsValidToken(fieldToken)) throw new ArgumentOutOfRangeException(nameof(fieldToken), - SR.Format(SR.Argument_InvalidToken, fieldToken, new ModuleHandle(module))); + Environment.GetResourceString("Argument_InvalidToken", fieldToken, new ModuleHandle(module))); // defensive copy to be sure array is not mutated from the outside during processing int typeInstCount, methodInstCount; diff --git a/src/mscorlib/src/System/SByte.cs b/src/mscorlib/src/System/SByte.cs index 93f5387412..b85093d72f 100644 --- a/src/mscorlib/src/System/SByte.cs +++ b/src/mscorlib/src/System/SByte.cs @@ -47,7 +47,7 @@ namespace System } if (!(obj is SByte)) { - throw new ArgumentException(SR.Arg_MustBeSByte); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeSByte")); } return m_value - ((SByte)obj).m_value; } @@ -156,19 +156,19 @@ namespace System } catch (OverflowException e) { - throw new OverflowException(SR.Overflow_SByte, e); + throw new OverflowException(Environment.GetResourceString("Overflow_SByte"), e); } if ((style & NumberStyles.AllowHexSpecifier) != 0) { // We are parsing a hexadecimal number if ((i < 0) || i > Byte.MaxValue) { - throw new OverflowException(SR.Overflow_SByte); + throw new OverflowException(Environment.GetResourceString("Overflow_SByte")); } return (sbyte)i; } - if (i < MinValue || i > MaxValue) throw new OverflowException(SR.Overflow_SByte); + if (i < MinValue || i > MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_SByte")); return (sbyte)i; } @@ -303,7 +303,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "SByte", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "SByte", "DateTime")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/Security/Util/URLString.cs b/src/mscorlib/src/System/Security/Util/URLString.cs index 33aac6f034..d694acbba8 100644 --- a/src/mscorlib/src/System/Security/Util/URLString.cs +++ b/src/mscorlib/src/System/Security/Util/URLString.cs @@ -131,7 +131,7 @@ namespace System.Security.Util PathInternal.MaxLongPath)) #endif { - throw new PathTooLongException(SR.IO_PathTooLong); + throw new PathTooLongException(Environment.GetResourceString("IO.PathTooLong")); } } } diff --git a/src/mscorlib/src/System/Security/VerificationException.cs b/src/mscorlib/src/System/Security/VerificationException.cs index 6f70dcd35b..d07b76f6ad 100644 --- a/src/mscorlib/src/System/Security/VerificationException.cs +++ b/src/mscorlib/src/System/Security/VerificationException.cs @@ -14,7 +14,7 @@ namespace System.Security public class VerificationException : SystemException { public VerificationException() - : base(SR.Verification_Exception) + : base(Environment.GetResourceString("Verification_Exception")) { SetErrorCode(__HResults.COR_E_VERIFICATION); } diff --git a/src/mscorlib/src/System/Single.cs b/src/mscorlib/src/System/Single.cs index 4fb6ae03fd..f3ed5b8b06 100644 --- a/src/mscorlib/src/System/Single.cs +++ b/src/mscorlib/src/System/Single.cs @@ -98,7 +98,7 @@ namespace System else // f is NaN. return 1; } - throw new ArgumentException(SR.Arg_MustBeSingle); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeSingle")); } @@ -306,7 +306,7 @@ namespace System /// <internalonly/> char IConvertible.ToChar(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Single", "Char")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Single", "Char")); } /// <internalonly/> @@ -378,7 +378,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "Single", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "Single", "DateTime")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/String.Comparison.cs b/src/mscorlib/src/System/String.Comparison.cs index c2c3a8709a..bc7800068b 100644 --- a/src/mscorlib/src/System/String.Comparison.cs +++ b/src/mscorlib/src/System/String.Comparison.cs @@ -386,7 +386,7 @@ namespace System // Single comparison to check if comparisonType is within [CurrentCulture .. OrdinalIgnoreCase] if ((uint)(comparisonType - StringComparison.CurrentCulture) > (uint)(StringComparison.OrdinalIgnoreCase - StringComparison.CurrentCulture)) { - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); } Contract.EndContractBlock(); @@ -439,7 +439,7 @@ namespace System return CompareInfo.CompareOrdinalIgnoreCase(strA, 0, strA.Length, strB, 0, strB.Length); default: - throw new NotSupportedException(SR.NotSupported_StringComparison); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_StringComparison")); } } @@ -572,7 +572,7 @@ namespace System { if (comparisonType < StringComparison.CurrentCulture || comparisonType > StringComparison.OrdinalIgnoreCase) { - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); } Contract.EndContractBlock(); @@ -589,19 +589,19 @@ namespace System if (length < 0) { - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength")); } if (indexA < 0 || indexB < 0) { string paramName = indexA < 0 ? nameof(indexA) : nameof(indexB); - throw new ArgumentOutOfRangeException(paramName, SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(paramName, Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (strA.Length - indexA < 0 || strB.Length - indexB < 0) { string paramName = strA.Length - indexA < 0 ? nameof(indexA) : nameof(indexB); - throw new ArgumentOutOfRangeException(paramName, SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(paramName, Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (length == 0 || (object.ReferenceEquals(strA, strB) && indexA == indexB)) @@ -633,7 +633,7 @@ namespace System return (CompareInfo.CompareOrdinalIgnoreCase(strA, indexA, lengthA, strB, indexB, lengthB)); default: - throw new ArgumentException(SR.NotSupported_StringComparison); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison")); } } @@ -689,13 +689,13 @@ namespace System if (length < 0) { - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeCount); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeCount")); } if (indexA < 0 || indexB < 0) { string paramName = indexA < 0 ? nameof(indexA) : nameof(indexB); - throw new ArgumentOutOfRangeException(paramName, SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(paramName, Environment.GetResourceString("ArgumentOutOfRange_Index")); } int lengthA = Math.Min(length, strA.Length - indexA); @@ -704,7 +704,7 @@ namespace System if (lengthA < 0 || lengthB < 0) { string paramName = lengthA < 0 ? nameof(indexA) : nameof(indexB); - throw new ArgumentOutOfRangeException(paramName, SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(paramName, Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (length == 0 || (object.ReferenceEquals(strA, strB) && indexA == indexB)) @@ -731,7 +731,7 @@ namespace System if (other == null) { - throw new ArgumentException(SR.Arg_MustBeString); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeString")); } return CompareTo(other); // will call the string-based overload @@ -766,7 +766,7 @@ namespace System if (comparisonType < StringComparison.CurrentCulture || comparisonType > StringComparison.OrdinalIgnoreCase) { - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); } Contract.EndContractBlock(); @@ -800,7 +800,7 @@ namespace System case StringComparison.OrdinalIgnoreCase: return this.Length < value.Length ? false : (CompareInfo.CompareOrdinalIgnoreCase(this, this.Length - value.Length, value.Length, value, 0, value.Length) == 0); default: - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); } } @@ -874,7 +874,7 @@ namespace System public bool Equals(String value, StringComparison comparisonType) { if (comparisonType < StringComparison.CurrentCulture || comparisonType > StringComparison.OrdinalIgnoreCase) - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); Contract.EndContractBlock(); if ((Object)this == (Object)value) @@ -919,7 +919,7 @@ namespace System return (CompareInfo.CompareOrdinalIgnoreCase(this, 0, this.Length, value, 0, value.Length) == 0); default: - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); } } @@ -945,7 +945,7 @@ namespace System public static bool Equals(String a, String b, StringComparison comparisonType) { if (comparisonType < StringComparison.CurrentCulture || comparisonType > StringComparison.OrdinalIgnoreCase) - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); Contract.EndContractBlock(); if ((Object)a == (Object)b) @@ -994,7 +994,7 @@ namespace System } default: - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); } } @@ -1123,7 +1123,7 @@ namespace System if (comparisonType < StringComparison.CurrentCulture || comparisonType > StringComparison.OrdinalIgnoreCase) { - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); } Contract.EndContractBlock(); @@ -1169,7 +1169,7 @@ namespace System return (CompareInfo.CompareOrdinalIgnoreCase(this, 0, value.Length, value, 0, value.Length) == 0); default: - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); } } diff --git a/src/mscorlib/src/System/String.Manipulation.cs b/src/mscorlib/src/System/String.Manipulation.cs index 4a59ec4c22..90ec773bf7 100644 --- a/src/mscorlib/src/System/String.Manipulation.cs +++ b/src/mscorlib/src/System/String.Manipulation.cs @@ -763,15 +763,15 @@ namespace System } if (startIndex < 0) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex")); } if (count < 0) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NegativeCount); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NegativeCount")); } if (startIndex > value.Length - count) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_IndexCountBuffer); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); } if (count <= 1) @@ -871,7 +871,7 @@ namespace System public String PadLeft(int totalWidth, char paddingChar) { if (totalWidth < 0) - throw new ArgumentOutOfRangeException(nameof(totalWidth), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(totalWidth), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); int oldLength = Length; int count = totalWidth - oldLength; if (count <= 0) @@ -902,7 +902,7 @@ namespace System public String PadRight(int totalWidth, char paddingChar) { if (totalWidth < 0) - throw new ArgumentOutOfRangeException(nameof(totalWidth), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(totalWidth), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); int oldLength = Length; int count = totalWidth - oldLength; if (count <= 0) @@ -927,13 +927,13 @@ namespace System { if (startIndex < 0) throw new ArgumentOutOfRangeException(nameof(startIndex), - SR.ArgumentOutOfRange_StartIndex); + Environment.GetResourceString("ArgumentOutOfRange_StartIndex")); if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), - SR.ArgumentOutOfRange_NegativeCount); + Environment.GetResourceString("ArgumentOutOfRange_NegativeCount")); if (count > Length - startIndex) throw new ArgumentOutOfRangeException(nameof(count), - SR.ArgumentOutOfRange_IndexCount); + Environment.GetResourceString("ArgumentOutOfRange_IndexCount")); Contract.Ensures(Contract.Result<String>() != null); Contract.Ensures(Contract.Result<String>().Length == this.Length - count); Contract.EndContractBlock(); @@ -965,13 +965,13 @@ namespace System if (startIndex < 0) { throw new ArgumentOutOfRangeException(nameof(startIndex), - SR.ArgumentOutOfRange_StartIndex); + Environment.GetResourceString("ArgumentOutOfRange_StartIndex")); } if (startIndex >= Length) { throw new ArgumentOutOfRangeException(nameof(startIndex), - SR.ArgumentOutOfRange_StartIndexLessThanLength); + Environment.GetResourceString("ArgumentOutOfRange_StartIndexLessThanLength")); } Contract.Ensures(Contract.Result<String>() != null); @@ -1014,7 +1014,7 @@ namespace System return ReplaceCore(oldValue, newValue, CultureInfo.InvariantCulture, CompareOptions.OrdinalIgnoreCase); default: - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); } } @@ -1223,10 +1223,10 @@ namespace System { if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), - SR.ArgumentOutOfRange_NegativeCount); + Environment.GetResourceString("ArgumentOutOfRange_NegativeCount")); if (options < StringSplitOptions.None || options > StringSplitOptions.RemoveEmptyEntries) - throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, options)); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", options)); Contract.Ensures(Contract.Result<String[]>() != null); Contract.EndContractBlock(); @@ -1290,12 +1290,12 @@ namespace System if (count < 0) { throw new ArgumentOutOfRangeException(nameof(count), - SR.ArgumentOutOfRange_NegativeCount); + Environment.GetResourceString("ArgumentOutOfRange_NegativeCount")); } if (options < StringSplitOptions.None || options > StringSplitOptions.RemoveEmptyEntries) { - throw new ArgumentException(SR.Format(SR.Arg_EnumIllegalVal, (int)options)); + throw new ArgumentException(Environment.GetResourceString("Arg_EnumIllegalVal", (int)options)); } Contract.EndContractBlock(); @@ -1591,22 +1591,22 @@ namespace System //Bounds Checking. if (startIndex < 0) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex")); } if (startIndex > Length) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndexLargerThanLength); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndexLargerThanLength")); } if (length < 0) { - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength")); } if (startIndex > Length - length) { - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_IndexLength); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_IndexLength")); } Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/String.Searching.cs b/src/mscorlib/src/System/String.Searching.cs index 411a45c1a7..426bf21bec 100644 --- a/src/mscorlib/src/System/String.Searching.cs +++ b/src/mscorlib/src/System/String.Searching.cs @@ -35,10 +35,10 @@ namespace System public unsafe int IndexOf(char value, int startIndex, int count) { if (startIndex < 0 || startIndex > Length) - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); if (count < 0 || count > Length - startIndex) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count")); fixed (char* pChars = &m_firstChar) { @@ -124,12 +124,12 @@ namespace System { if (startIndex < 0 || startIndex > this.Length) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (count < 0 || count > this.Length - startIndex) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count")); } Contract.EndContractBlock(); @@ -156,10 +156,10 @@ namespace System throw new ArgumentNullException(nameof(value)); if (startIndex < 0 || startIndex > this.Length) - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); if (count < 0 || startIndex > this.Length - count) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count")); Contract.EndContractBlock(); switch (comparisonType) @@ -186,7 +186,7 @@ namespace System return TextInfo.IndexOfStringOrdinalIgnoreCase(this, value, startIndex, count); default: - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); } } @@ -214,10 +214,10 @@ namespace System return -1; if (startIndex < 0 || startIndex >= Length) - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); if (count < 0 || count - 1 > startIndex) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count")); fixed (char* pChars = &m_firstChar) { @@ -300,7 +300,7 @@ namespace System { if (count < 0) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count")); } Contract.EndContractBlock(); @@ -332,7 +332,7 @@ namespace System // Now after handling empty strings, make sure we're not out of range if (startIndex < 0 || startIndex > this.Length) - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); // Make sure that we allow startIndex == this.Length if (startIndex == this.Length) @@ -348,7 +348,7 @@ namespace System // 2nd half of this also catches when startIndex == MAXINT, so MAXINT - 0 + 1 == -1, which is < 0. if (count < 0 || startIndex - count + 1 < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Count); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Count")); switch (comparisonType) @@ -373,7 +373,7 @@ namespace System else return TextInfo.LastIndexOfStringOrdinalIgnoreCase(this, value, startIndex, count); default: - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); } } } diff --git a/src/mscorlib/src/System/String.cs b/src/mscorlib/src/System/String.cs index 2c1d97eefc..eb4d7921e5 100644 --- a/src/mscorlib/src/System/String.cs +++ b/src/mscorlib/src/System/String.cs @@ -118,13 +118,13 @@ namespace System if (destination == null) throw new ArgumentNullException(nameof(destination)); if (count < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NegativeCount); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NegativeCount")); if (sourceIndex < 0) - throw new ArgumentOutOfRangeException(nameof(sourceIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(sourceIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); if (count > Length - sourceIndex) - throw new ArgumentOutOfRangeException(nameof(sourceIndex), SR.ArgumentOutOfRange_IndexCount); + throw new ArgumentOutOfRangeException(nameof(sourceIndex), Environment.GetResourceString("ArgumentOutOfRange_IndexCount")); if (destinationIndex > destination.Length - count || destinationIndex < 0) - throw new ArgumentOutOfRangeException(nameof(destinationIndex), SR.ArgumentOutOfRange_IndexCount); + throw new ArgumentOutOfRangeException(nameof(destinationIndex), Environment.GetResourceString("ArgumentOutOfRange_IndexCount")); Contract.EndContractBlock(); // Note: fixed does not like empty arrays @@ -159,9 +159,9 @@ namespace System { // Range check everything. if (startIndex < 0 || startIndex > Length || startIndex > Length - length) - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); if (length < 0) - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_Index")); Contract.EndContractBlock(); if (length > 0) @@ -232,13 +232,13 @@ namespace System return new String(value, startIndex, length); // default to ANSI if (length < 0) - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (startIndex < 0) - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex")); if ((value + startIndex) < value) { // overflow check - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_PartialWCHAR); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_PartialWCHAR")); } byte[] b = new byte[length]; @@ -252,7 +252,7 @@ namespace System // If we got a NullReferencException. It means the pointer or // the index is out of range throw new ArgumentOutOfRangeException(nameof(value), - SR.ArgumentOutOfRange_PartialWCHAR); + Environment.GetResourceString("ArgumentOutOfRange_PartialWCHAR")); } return enc.GetString(b); @@ -332,7 +332,7 @@ namespace System if (0 != DefaultCharUsed) { - throw new ArgumentException(SR.Interop_Marshal_Unmappable_Char); + throw new ArgumentException(Environment.GetResourceString("Interop_Marshal_Unmappable_Char")); } pbNativeBuffer[nb] = 0; @@ -428,13 +428,13 @@ namespace System throw new ArgumentNullException(nameof(value)); if (startIndex < 0) - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex")); if (length < 0) - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength")); if (startIndex > value.Length - length) - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); Contract.EndContractBlock(); if (length > 0) @@ -498,7 +498,7 @@ namespace System else if (count == 0) return String.Empty; else - throw new ArgumentOutOfRangeException(nameof(count), SR.Format(SR.ArgumentOutOfRange_MustBeNonNegNum, nameof(count))); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_MustBeNonNegNum", nameof(count))); } private static unsafe int wcslen(char* ptr) @@ -602,7 +602,7 @@ namespace System #if !FEATURE_PAL if (ptr < (char*)64000) - throw new ArgumentException(SR.Arg_MustBeStringPtrNotAtom); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeStringPtrNotAtom")); #endif // FEATURE_PAL Debug.Assert(this == null, "this == null"); // this is the string constructor, we allocate it @@ -620,7 +620,7 @@ namespace System } catch (NullReferenceException) { - throw new ArgumentOutOfRangeException(nameof(ptr), SR.ArgumentOutOfRange_PartialWCHAR); + throw new ArgumentOutOfRangeException(nameof(ptr), Environment.GetResourceString("ArgumentOutOfRange_PartialWCHAR")); } } @@ -628,12 +628,12 @@ namespace System { if (length < 0) { - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength")); } if (startIndex < 0) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex")); } Contract.EndContractBlock(); Debug.Assert(this == null, "this == null"); // this is the string constructor, we allocate it @@ -642,7 +642,7 @@ namespace System if (pFrom < ptr) { // This means that the pointer operation has had an overflow - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_PartialWCHAR); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_PartialWCHAR")); } if (length == 0) @@ -658,7 +658,7 @@ namespace System } catch (NullReferenceException) { - throw new ArgumentOutOfRangeException(nameof(ptr), SR.ArgumentOutOfRange_PartialWCHAR); + throw new ArgumentOutOfRangeException(nameof(ptr), Environment.GetResourceString("ArgumentOutOfRange_PartialWCHAR")); } } diff --git a/src/mscorlib/src/System/StringComparer.cs b/src/mscorlib/src/System/StringComparer.cs index 42b35fc6ea..19d2e9aedf 100644 --- a/src/mscorlib/src/System/StringComparer.cs +++ b/src/mscorlib/src/System/StringComparer.cs @@ -93,7 +93,7 @@ namespace System case StringComparison.OrdinalIgnoreCase: return OrdinalIgnoreCase; default: - throw new ArgumentException(SR.NotSupported_StringComparison, nameof(comparisonType)); + throw new ArgumentException(Environment.GetResourceString("NotSupported_StringComparison"), nameof(comparisonType)); } } @@ -131,7 +131,7 @@ namespace System return ia.CompareTo(y); } - throw new ArgumentException(SR.Argument_ImplementIComparable); + throw new ArgumentException(Environment.GetResourceString("Argument_ImplementIComparable")); } diff --git a/src/mscorlib/src/System/StubHelpers.cs b/src/mscorlib/src/System/StubHelpers.cs index f584ece6fc..7497cbffbb 100644 --- a/src/mscorlib/src/System/StubHelpers.cs +++ b/src/mscorlib/src/System/StubHelpers.cs @@ -532,7 +532,7 @@ namespace System.StubHelpers internal static unsafe IntPtr ConvertToNative(string managed) { if (!Environment.IsWinRTSupported) - throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT")); if (managed == null) throw new ArgumentNullException(); // We don't have enough information to get the argument name @@ -552,7 +552,7 @@ namespace System.StubHelpers [Out] HSTRING_HEADER* hstringHeader) { if (!Environment.IsWinRTSupported) - throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT")); if (managed == null) throw new ArgumentNullException(); // We don't have enough information to get the argument name @@ -571,7 +571,7 @@ namespace System.StubHelpers { if (!Environment.IsWinRTSupported) { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT")); } return WindowsRuntimeMarshal.HStringToString(hstring); @@ -1003,7 +1003,7 @@ namespace System.StubHelpers } default: - throw new ArgumentException(SR.Arg_NDirectBadObject); + throw new ArgumentException(Environment.GetResourceString("Arg_NDirectBadObject")); } // marshal the object as C-style array (UnmanagedType.LPArray) @@ -1170,7 +1170,7 @@ namespace System.StubHelpers return IntPtr.Zero; if (pManagedHome is ArrayWithOffset) - throw new ArgumentException(SR.Arg_MarshalAsAnyRestriction); + throw new ArgumentException(Environment.GetResourceString("Arg_MarshalAsAnyRestriction")); IntPtr pNativeHome; @@ -1202,7 +1202,7 @@ namespace System.StubHelpers else { // this type is not supported for AsAny marshaling - throw new ArgumentException(SR.Arg_NDirectBadObject); + throw new ArgumentException(Environment.GetResourceString("Arg_NDirectBadObject")); } } @@ -1328,7 +1328,7 @@ namespace System.StubHelpers { if (!Environment.IsWinRTSupported) { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT")); } string typeName; @@ -1336,7 +1336,7 @@ namespace System.StubHelpers { if (managedType.GetType() != typeof(System.RuntimeType)) { // The type should be exactly System.RuntimeType (and not its child System.ReflectionOnlyType, or other System.Type children) - throw new ArgumentException(SR.Format(SR.Argument_WinRTSystemRuntimeType, managedType.GetType().ToString())); + throw new ArgumentException(Environment.GetResourceString("Argument_WinRTSystemRuntimeType", managedType.GetType().ToString())); } bool isPrimitive; @@ -1371,7 +1371,7 @@ namespace System.StubHelpers { if (!Environment.IsWinRTSupported) { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT")); } string typeName = WindowsRuntimeMarshal.HStringToString(pNativeType->typeName); @@ -1392,7 +1392,7 @@ namespace System.StubHelpers // TypeSource must match if (isPrimitive != (pNativeType->typeKind == TypeKind.Primitive)) - throw new ArgumentException(SR.Argument_Unexpected_TypeSource); + throw new ArgumentException(Environment.GetResourceString("Argument_Unexpected_TypeSource")); } } @@ -1414,7 +1414,7 @@ namespace System.StubHelpers { if (!Environment.IsWinRTSupported) { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT")); } if (ex == null) @@ -1429,7 +1429,7 @@ namespace System.StubHelpers if (!Environment.IsWinRTSupported) { - throw new PlatformNotSupportedException(SR.PlatformNotSupported_WinRT); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_WinRT")); } Exception e = null; @@ -1722,7 +1722,7 @@ namespace System.StubHelpers { if (length > 0x7ffffff0) { - throw new MarshalDirectiveException(SR.Marshaler_StringTooLong); + throw new MarshalDirectiveException(Environment.GetResourceString("Marshaler_StringTooLong")); } } diff --git a/src/mscorlib/src/System/Text/ASCIIEncoding.cs b/src/mscorlib/src/System/Text/ASCIIEncoding.cs index f42a1c407b..a3107ebd64 100644 --- a/src/mscorlib/src/System/Text/ASCIIEncoding.cs +++ b/src/mscorlib/src/System/Text/ASCIIEncoding.cs @@ -178,7 +178,8 @@ namespace System.Text // We always need the fallback buffer in get bytes so we can flush any remaining ones if necessary fallbackBuffer = encoder.FallbackBuffer; if (fallbackBuffer.Remaining > 0 && encoder.m_throwOnOverflow) - throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType())); + throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty", + this.EncodingName, encoder.Fallback.GetType())); // Set our internal fallback interesting things. fallbackBuffer.InternalInitialize(chars, charEnd, encoder, false); @@ -318,7 +319,8 @@ namespace System.Text // We always need the fallback buffer in get bytes so we can flush any remaining ones if necessary fallbackBuffer = encoder.FallbackBuffer; if (fallbackBuffer.Remaining > 0 && encoder.m_throwOnOverflow) - throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType())); + throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty", + this.EncodingName, encoder.Fallback.GetType())); // Set our internal fallback interesting things. fallbackBuffer.InternalInitialize(charStart, charEnd, encoder, true); @@ -712,7 +714,7 @@ namespace System.Text { if (charCount < 0) throw new ArgumentOutOfRangeException(nameof(charCount), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Characters would be # of characters + 1 in case high surrogate is ? * max fallback @@ -724,7 +726,7 @@ namespace System.Text // 1 to 1 for most characters. Only surrogates with fallbacks have less. if (byteCount > 0x7fffffff) - throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GetByteCountOverflow); + throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow")); return (int)byteCount; } @@ -733,7 +735,7 @@ namespace System.Text { if (byteCount < 0) throw new ArgumentOutOfRangeException(nameof(byteCount), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Just return length, SBCS stay the same length because they don't map to surrogate @@ -744,7 +746,7 @@ namespace System.Text charCount *= DecoderFallback.MaxCharCount; if (charCount > 0x7fffffff) - throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_GetCharCountOverflow); + throw new ArgumentOutOfRangeException(nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_GetCharCountOverflow")); return (int)charCount; } diff --git a/src/mscorlib/src/System/Text/Decoder.cs b/src/mscorlib/src/System/Text/Decoder.cs index a52c9ba700..e8b9128bd6 100644 --- a/src/mscorlib/src/System/Text/Decoder.cs +++ b/src/mscorlib/src/System/Text/Decoder.cs @@ -55,7 +55,7 @@ namespace System.Text // Can't change fallback if buffer is wrong if (m_fallbackBuffer != null && m_fallbackBuffer.Remaining > 0) throw new ArgumentException( - SR.Argument_FallbackBufferNotEmpty, nameof(value)); + Environment.GetResourceString("Argument_FallbackBufferNotEmpty"), nameof(value)); m_fallback = value; m_fallbackBuffer = null; @@ -127,11 +127,11 @@ namespace System.Text // Validate input parameters if (bytes == null) throw new ArgumentNullException(nameof(bytes), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); byte[] arrbyte = new byte[count]; @@ -191,11 +191,11 @@ namespace System.Text // Validate input parameters if (chars == null || bytes == null) throw new ArgumentNullException(chars == null ? nameof(chars) : nameof(bytes), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (byteCount < 0 || charCount < 0) throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Get the byte array to convert @@ -249,23 +249,23 @@ namespace System.Text // Validate parameters if (bytes == null || chars == null) throw new ArgumentNullException((bytes == null ? nameof(bytes) : nameof(chars)), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (byteIndex < 0 || byteCount < 0) throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (charIndex < 0 || charCount < 0) throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (bytes.Length - byteIndex < byteCount) throw new ArgumentOutOfRangeException(nameof(bytes), - SR.ArgumentOutOfRange_IndexCountBuffer); + Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); if (chars.Length - charIndex < charCount) throw new ArgumentOutOfRangeException(nameof(chars), - SR.ArgumentOutOfRange_IndexCountBuffer); + Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); Contract.EndContractBlock(); bytesUsed = byteCount; @@ -287,7 +287,7 @@ namespace System.Text } // Oops, we didn't have anything, we'll have to throw an overflow - throw new ArgumentException(SR.Argument_ConversionOverflow); + throw new ArgumentException(Environment.GetResourceString("Argument_ConversionOverflow")); } // This is the version that uses *. @@ -306,11 +306,11 @@ namespace System.Text // Validate input parameters if (chars == null || bytes == null) throw new ArgumentNullException(chars == null ? nameof(chars) : nameof(bytes), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (byteCount < 0 || charCount < 0) throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Get ready to do it @@ -333,7 +333,7 @@ namespace System.Text } // Oops, we didn't have anything, we'll have to throw an overflow - throw new ArgumentException(SR.Argument_ConversionOverflow); + throw new ArgumentException(Environment.GetResourceString("Argument_ConversionOverflow")); } } } diff --git a/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs b/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs index e319e153dc..b709dcde57 100644 --- a/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs +++ b/src/mscorlib/src/System/Text/DecoderExceptionFallback.cs @@ -94,7 +94,8 @@ namespace System.Text // Known index throw new DecoderFallbackException( - SR.Format(SR.Argument_InvalidCodePageBytesIndex, strBytes, index), bytesUnknown, index); + Environment.GetResourceString("Argument_InvalidCodePageBytesIndex", + strBytes, index), bytesUnknown, index); } } @@ -106,7 +107,7 @@ namespace System.Text private int index = 0; public DecoderFallbackException() - : base(SR.Arg_ArgumentException) + : base(Environment.GetResourceString("Arg_ArgumentException")) { SetErrorCode(__HResults.COR_E_ARGUMENT); } diff --git a/src/mscorlib/src/System/Text/DecoderFallback.cs b/src/mscorlib/src/System/Text/DecoderFallback.cs index 9311cda585..e7b57bdff4 100644 --- a/src/mscorlib/src/System/Text/DecoderFallback.cs +++ b/src/mscorlib/src/System/Text/DecoderFallback.cs @@ -160,14 +160,14 @@ namespace System.Text { // High Surrogate if (bHighSurrogate) - throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex")); bHighSurrogate = true; } else { // Low surrogate if (bHighSurrogate == false) - throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex")); bHighSurrogate = false; } } @@ -183,7 +183,7 @@ namespace System.Text // Need to make sure that bHighSurrogate isn't true if (bHighSurrogate) - throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex")); // Now we aren't going to be false, so its OK to update chars chars = charTemp; @@ -220,14 +220,14 @@ namespace System.Text { // High Surrogate if (bHighSurrogate) - throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex")); bHighSurrogate = true; } else { // Low surrogate if (bHighSurrogate == false) - throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex")); bHighSurrogate = false; } } @@ -237,7 +237,7 @@ namespace System.Text // Need to make sure that bHighSurrogate isn't true if (bHighSurrogate) - throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex")); return count; } @@ -264,7 +264,8 @@ namespace System.Text // Throw it, using our complete bytes throw new ArgumentException( - SR.Format(SR.Argument_RecursiveFallbackBytes, strBytes.ToString()), nameof(bytesUnknown)); + Environment.GetResourceString("Argument_RecursiveFallbackBytes", + strBytes.ToString()), nameof(bytesUnknown)); } } } diff --git a/src/mscorlib/src/System/Text/DecoderNLS.cs b/src/mscorlib/src/System/Text/DecoderNLS.cs index 6fcfc79140..c2f5e47e1d 100644 --- a/src/mscorlib/src/System/Text/DecoderNLS.cs +++ b/src/mscorlib/src/System/Text/DecoderNLS.cs @@ -38,7 +38,7 @@ namespace System.Text throw new NotSupportedException( String.Format( System.Globalization.CultureInfo.CurrentCulture, - SR.NotSupported_TypeCannotDeserialized, this.GetType())); + Environment.GetResourceString("NotSupported_TypeCannotDeserialized"), this.GetType())); } // ISerializable implementation. called during serialization. @@ -81,15 +81,15 @@ namespace System.Text // Validate Parameters if (bytes == null) throw new ArgumentNullException(nameof(bytes), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (index < 0 || count < 0) throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (bytes.Length - index < count) throw new ArgumentOutOfRangeException(nameof(bytes), - SR.ArgumentOutOfRange_IndexCountBuffer); + Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); Contract.EndContractBlock(); @@ -107,11 +107,11 @@ namespace System.Text // Validate parameters if (bytes == null) throw new ArgumentNullException(nameof(bytes), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Remember the flush @@ -134,19 +134,19 @@ namespace System.Text // Validate Parameters if (bytes == null || chars == null) throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (byteIndex < 0 || byteCount < 0) throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (bytes.Length - byteIndex < byteCount) throw new ArgumentOutOfRangeException(nameof(bytes), - SR.ArgumentOutOfRange_IndexCountBuffer); + Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); if (charIndex < 0 || charIndex > chars.Length) throw new ArgumentOutOfRangeException(nameof(charIndex), - SR.ArgumentOutOfRange_Index); + Environment.GetResourceString("ArgumentOutOfRange_Index")); Contract.EndContractBlock(); @@ -172,11 +172,11 @@ namespace System.Text // Validate parameters if (chars == null || bytes == null) throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (byteCount < 0 || charCount < 0) throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Remember our flush @@ -196,23 +196,23 @@ namespace System.Text // Validate parameters if (bytes == null || chars == null) throw new ArgumentNullException((bytes == null ? nameof(bytes) : nameof(chars)), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (byteIndex < 0 || byteCount < 0) throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (charIndex < 0 || charCount < 0) throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (bytes.Length - byteIndex < byteCount) throw new ArgumentOutOfRangeException(nameof(bytes), - SR.ArgumentOutOfRange_IndexCountBuffer); + Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); if (chars.Length - charIndex < charCount) throw new ArgumentOutOfRangeException(nameof(chars), - SR.ArgumentOutOfRange_IndexCountBuffer); + Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); Contract.EndContractBlock(); @@ -242,11 +242,11 @@ namespace System.Text // Validate input parameters if (chars == null || bytes == null) throw new ArgumentNullException(chars == null ? nameof(chars) : nameof(bytes), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (byteCount < 0 || charCount < 0) throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // We don't want to throw diff --git a/src/mscorlib/src/System/Text/DecoderReplacementFallback.cs b/src/mscorlib/src/System/Text/DecoderReplacementFallback.cs index b27469156d..8147da5583 100644 --- a/src/mscorlib/src/System/Text/DecoderReplacementFallback.cs +++ b/src/mscorlib/src/System/Text/DecoderReplacementFallback.cs @@ -59,7 +59,7 @@ namespace System.Text break; } if (bFoundHigh) - throw new ArgumentException(SR.Format(SR.Argument_InvalidCharSequenceNoIndex, nameof(replacement))); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex", nameof(replacement))); strDefault = replacement; } diff --git a/src/mscorlib/src/System/Text/Encoder.cs b/src/mscorlib/src/System/Text/Encoder.cs index 82eb2ad899..9ec8231b50 100644 --- a/src/mscorlib/src/System/Text/Encoder.cs +++ b/src/mscorlib/src/System/Text/Encoder.cs @@ -55,7 +55,7 @@ namespace System.Text // Can't change fallback if buffer is wrong if (m_fallbackBuffer != null && m_fallbackBuffer.Remaining > 0) throw new ArgumentException( - SR.Argument_FallbackBufferNotEmpty, nameof(value)); + Environment.GetResourceString("Argument_FallbackBufferNotEmpty"), nameof(value)); m_fallback = value; m_fallbackBuffer = null; @@ -124,11 +124,11 @@ namespace System.Text // Validate input parameters if (chars == null) throw new ArgumentNullException(nameof(chars), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); char[] arrChar = new char[count]; @@ -185,11 +185,11 @@ namespace System.Text // Validate input parameters if (bytes == null || chars == null) throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (charCount < 0 || byteCount < 0) throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount) : nameof(byteCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Get the char array to convert @@ -242,23 +242,23 @@ namespace System.Text // Validate parameters if (chars == null || bytes == null) throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (charIndex < 0 || charCount < 0) throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (byteIndex < 0 || byteCount < 0) throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (chars.Length - charIndex < charCount) throw new ArgumentOutOfRangeException(nameof(chars), - SR.ArgumentOutOfRange_IndexCountBuffer); + Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); if (bytes.Length - byteIndex < byteCount) throw new ArgumentOutOfRangeException(nameof(bytes), - SR.ArgumentOutOfRange_IndexCountBuffer); + Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); Contract.EndContractBlock(); charsUsed = charCount; @@ -282,7 +282,7 @@ namespace System.Text } // Oops, we didn't have anything, we'll have to throw an overflow - throw new ArgumentException(SR.Argument_ConversionOverflow); + throw new ArgumentException(Environment.GetResourceString("Argument_ConversionOverflow")); } // Same thing, but using pointers @@ -300,10 +300,10 @@ namespace System.Text // Validate input parameters if (bytes == null || chars == null) throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (charCount < 0 || byteCount < 0) throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount) : nameof(byteCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Get ready to do it @@ -326,7 +326,7 @@ namespace System.Text } // Oops, we didn't have anything, we'll have to throw an overflow - throw new ArgumentException(SR.Argument_ConversionOverflow); + throw new ArgumentException(Environment.GetResourceString("Argument_ConversionOverflow")); } } } diff --git a/src/mscorlib/src/System/Text/EncoderBestFitFallback.cs b/src/mscorlib/src/System/Text/EncoderBestFitFallback.cs index eb3165526b..89e4f51d43 100644 --- a/src/mscorlib/src/System/Text/EncoderBestFitFallback.cs +++ b/src/mscorlib/src/System/Text/EncoderBestFitFallback.cs @@ -120,11 +120,13 @@ namespace System.Text // Double check input surrogate pair if (!Char.IsHighSurrogate(charUnknownHigh)) throw new ArgumentOutOfRangeException(nameof(charUnknownHigh), - SR.Format(SR.ArgumentOutOfRange_Range, 0xD800, 0xDBFF)); + Environment.GetResourceString("ArgumentOutOfRange_Range", + 0xD800, 0xDBFF)); if (!Char.IsLowSurrogate(charUnknownLow)) throw new ArgumentOutOfRangeException(nameof(charUnknownLow), - SR.Format(SR.ArgumentOutOfRange_Range, 0xDC00, 0xDFFF)); + Environment.GetResourceString("ArgumentOutOfRange_Range", + 0xDC00, 0xDFFF)); Contract.EndContractBlock(); // If we had a buffer already we're being recursive, throw, it's probably at the suspect diff --git a/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs b/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs index 251b4b440c..b64e19e598 100644 --- a/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs +++ b/src/mscorlib/src/System/Text/EncoderExceptionFallback.cs @@ -54,7 +54,8 @@ namespace System.Text { // Fall back our char throw new EncoderFallbackException( - SR.Format(SR.Argument_InvalidCodePageConversionIndex, (int)charUnknown, index), charUnknown, index); + Environment.GetResourceString("Argument_InvalidCodePageConversionIndex", + (int)charUnknown, index), charUnknown, index); } public override bool Fallback(char charUnknownHigh, char charUnknownLow, int index) @@ -62,12 +63,14 @@ namespace System.Text if (!Char.IsHighSurrogate(charUnknownHigh)) { throw new ArgumentOutOfRangeException(nameof(charUnknownHigh), - SR.Format(SR.ArgumentOutOfRange_Range, 0xD800, 0xDBFF)); + Environment.GetResourceString("ArgumentOutOfRange_Range", + 0xD800, 0xDBFF)); } if (!Char.IsLowSurrogate(charUnknownLow)) { throw new ArgumentOutOfRangeException(nameof(charUnknownLow), - SR.Format(SR.ArgumentOutOfRange_Range, 0xDC00, 0xDFFF)); + Environment.GetResourceString("ArgumentOutOfRange_Range", + 0xDC00, 0xDFFF)); } Contract.EndContractBlock(); @@ -75,7 +78,8 @@ namespace System.Text // Fall back our char throw new EncoderFallbackException( - SR.Format(SR.Argument_InvalidCodePageConversionIndex, iTemp, index), charUnknownHigh, charUnknownLow, index); + Environment.GetResourceString("Argument_InvalidCodePageConversionIndex", + iTemp, index), charUnknownHigh, charUnknownLow, index); } public override char GetNextChar() @@ -108,7 +112,7 @@ namespace System.Text private int index; public EncoderFallbackException() - : base(SR.Arg_ArgumentException) + : base(Environment.GetResourceString("Arg_ArgumentException")) { SetErrorCode(__HResults.COR_E_ARGUMENT); } @@ -142,12 +146,14 @@ namespace System.Text if (!Char.IsHighSurrogate(charUnknownHigh)) { throw new ArgumentOutOfRangeException(nameof(charUnknownHigh), - SR.Format(SR.ArgumentOutOfRange_Range, 0xD800, 0xDBFF)); + Environment.GetResourceString("ArgumentOutOfRange_Range", + 0xD800, 0xDBFF)); } if (!Char.IsLowSurrogate(charUnknownLow)) { throw new ArgumentOutOfRangeException(nameof(CharUnknownLow), - SR.Format(SR.ArgumentOutOfRange_Range, 0xDC00, 0xDFFF)); + Environment.GetResourceString("ArgumentOutOfRange_Range", + 0xDC00, 0xDFFF)); } Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/Text/EncoderFallback.cs b/src/mscorlib/src/System/Text/EncoderFallback.cs index 410b6f5016..2d1ee52c59 100644 --- a/src/mscorlib/src/System/Text/EncoderFallback.cs +++ b/src/mscorlib/src/System/Text/EncoderFallback.cs @@ -224,7 +224,8 @@ namespace System.Text { // Throw it, using our complete character throw new ArgumentException( - SR.Format(SR.Argument_RecursiveFallback, charRecursive), "chars"); + Environment.GetResourceString("Argument_RecursiveFallback", + charRecursive), "chars"); } } } diff --git a/src/mscorlib/src/System/Text/EncoderNLS.cs b/src/mscorlib/src/System/Text/EncoderNLS.cs index 99a26ca575..2ba909701c 100644 --- a/src/mscorlib/src/System/Text/EncoderNLS.cs +++ b/src/mscorlib/src/System/Text/EncoderNLS.cs @@ -41,7 +41,7 @@ namespace System.Text throw new NotSupportedException( String.Format( System.Globalization.CultureInfo.CurrentCulture, - SR.NotSupported_TypeCannotDeserialized, this.GetType())); + Environment.GetResourceString("NotSupported_TypeCannotDeserialized"), this.GetType())); } // ISerializable implementation. called during serialization. @@ -81,15 +81,15 @@ namespace System.Text // Validate input parameters if (chars == null) throw new ArgumentNullException(nameof(chars), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (index < 0 || count < 0) throw new ArgumentOutOfRangeException((index < 0 ? nameof(index) : nameof(count)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (chars.Length - index < count) throw new ArgumentOutOfRangeException(nameof(chars), - SR.ArgumentOutOfRange_IndexCountBuffer); + Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); Contract.EndContractBlock(); // Avoid empty input problem @@ -110,11 +110,11 @@ namespace System.Text // Validate input parameters if (chars == null) throw new ArgumentNullException(nameof(chars), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); this.m_mustFlush = flush; @@ -128,19 +128,19 @@ namespace System.Text // Validate parameters if (chars == null || bytes == null) throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (charIndex < 0 || charCount < 0) throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (chars.Length - charIndex < charCount) throw new ArgumentOutOfRangeException(nameof(chars), - SR.ArgumentOutOfRange_IndexCountBuffer); + Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); if (byteIndex < 0 || byteIndex > bytes.Length) throw new ArgumentOutOfRangeException(nameof(byteIndex), - SR.ArgumentOutOfRange_Index); + Environment.GetResourceString("ArgumentOutOfRange_Index")); Contract.EndContractBlock(); if (chars.Length == 0) @@ -164,11 +164,11 @@ namespace System.Text // Validate parameters if (chars == null || bytes == null) throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (byteCount < 0 || charCount < 0) throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); this.m_mustFlush = flush; @@ -185,23 +185,23 @@ namespace System.Text // Validate parameters if (chars == null || bytes == null) throw new ArgumentNullException((chars == null ? nameof(chars) : nameof(bytes)), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (charIndex < 0 || charCount < 0) throw new ArgumentOutOfRangeException((charIndex < 0 ? nameof(charIndex) : nameof(charCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (byteIndex < 0 || byteCount < 0) throw new ArgumentOutOfRangeException((byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (chars.Length - charIndex < charCount) throw new ArgumentOutOfRangeException(nameof(chars), - SR.ArgumentOutOfRange_IndexCountBuffer); + Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); if (bytes.Length - byteIndex < byteCount) throw new ArgumentOutOfRangeException(nameof(bytes), - SR.ArgumentOutOfRange_IndexCountBuffer); + Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); Contract.EndContractBlock(); @@ -231,10 +231,10 @@ namespace System.Text // Validate input parameters if (bytes == null || chars == null) throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (charCount < 0 || byteCount < 0) throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount) : nameof(byteCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // We don't want to throw diff --git a/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs b/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs index 65b807c1bd..0b8abb33a5 100644 --- a/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs +++ b/src/mscorlib/src/System/Text/EncoderReplacementFallback.cs @@ -61,7 +61,7 @@ namespace System.Text break; } if (bFoundHigh) - throw new ArgumentException(SR.Format(SR.Argument_InvalidCharSequenceNoIndex, nameof(replacement))); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex", nameof(replacement))); strDefault = replacement; } @@ -149,11 +149,13 @@ namespace System.Text // Double check input surrogate pair if (!Char.IsHighSurrogate(charUnknownHigh)) throw new ArgumentOutOfRangeException(nameof(charUnknownHigh), - SR.Format(SR.ArgumentOutOfRange_Range, 0xD800, 0xDBFF)); + Environment.GetResourceString("ArgumentOutOfRange_Range", + 0xD800, 0xDBFF)); if (!Char.IsLowSurrogate(charUnknownLow)) throw new ArgumentOutOfRangeException(nameof(charUnknownLow), - SR.Format(SR.ArgumentOutOfRange_Range, 0xDC00, 0xDFFF)); + Environment.GetResourceString("ArgumentOutOfRange_Range", + 0xDC00, 0xDFFF)); Contract.EndContractBlock(); // If we had a buffer already we're being recursive, throw, it's probably at the suspect diff --git a/src/mscorlib/src/System/Text/Encoding.cs b/src/mscorlib/src/System/Text/Encoding.cs index a7a91583d7..57e54fddde 100644 --- a/src/mscorlib/src/System/Text/Encoding.cs +++ b/src/mscorlib/src/System/Text/Encoding.cs @@ -362,12 +362,12 @@ namespace System.Text if (srcEncoding == null || dstEncoding == null) { throw new ArgumentNullException((srcEncoding == null ? nameof(srcEncoding) : nameof(dstEncoding)), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); } if (bytes == null) { throw new ArgumentNullException(nameof(bytes), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); } Contract.Ensures(Contract.Result<byte[]>() != null); @@ -397,7 +397,8 @@ namespace System.Text if (codepage < 0 || codepage > 65535) { throw new ArgumentOutOfRangeException( - nameof(codepage), SR.Format(SR.ArgumentOutOfRange_Range, 0, 65535)); + nameof(codepage), Environment.GetResourceString("ArgumentOutOfRange_Range", + 0, 65535)); } Contract.EndContractBlock(); @@ -422,14 +423,15 @@ namespace System.Text case CodePageNoMac: // 2 CP_MACCP case CodePageNoThread: // 3 CP_THREAD_ACP case CodePageNoSymbol: // 42 CP_SYMBOL - throw new ArgumentException(SR.Format(SR.Argument_CodepageNotSupported, codepage), nameof(codepage)); + throw new ArgumentException(Environment.GetResourceString( + "Argument_CodepageNotSupported", codepage), nameof(codepage)); } // Is it a valid code page? if (EncodingTable.GetCodePageDataItem(codepage) == null) { throw new NotSupportedException( - SR.Format(SR.NotSupported_NoCodepageData, codepage)); + Environment.GetResourceString("NotSupported_NoCodepageData", codepage)); } return UTF8; @@ -512,7 +514,7 @@ namespace System.Text if (dataItem == null) { throw new NotSupportedException( - SR.Format(SR.NotSupported_NoCodepageData, m_codePage)); + Environment.GetResourceString("NotSupported_NoCodepageData", m_codePage)); } } } @@ -538,7 +540,7 @@ namespace System.Text { get { - return SR.GetResourceString("Globalization.cp_" + m_codePage.ToString()); + return Environment.GetResourceString("Globalization.cp_" + m_codePage.ToString()); } } @@ -666,7 +668,7 @@ namespace System.Text set { if (this.IsReadOnly) - throw new InvalidOperationException(SR.InvalidOperation_ReadOnly); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly")); if (value == null) throw new ArgumentNullException(nameof(value)); @@ -687,7 +689,7 @@ namespace System.Text set { if (this.IsReadOnly) - throw new InvalidOperationException(SR.InvalidOperation_ReadOnly); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ReadOnly")); if (value == null) throw new ArgumentNullException(nameof(value)); @@ -737,7 +739,7 @@ namespace System.Text if (chars == null) { throw new ArgumentNullException(nameof(chars), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); } Contract.EndContractBlock(); @@ -768,16 +770,16 @@ namespace System.Text { if (s == null) throw new ArgumentNullException(nameof(s), - SR.ArgumentNull_String); + Environment.GetResourceString("ArgumentNull_String")); if (index < 0) throw new ArgumentOutOfRangeException(nameof(index), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (index > s.Length - count) throw new ArgumentOutOfRangeException(nameof(index), - SR.ArgumentOutOfRange_IndexCount); + Environment.GetResourceString("ArgumentOutOfRange_IndexCount")); Contract.EndContractBlock(); unsafe @@ -800,11 +802,11 @@ namespace System.Text // Validate input parameters if (chars == null) throw new ArgumentNullException(nameof(chars), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); char[] arrChar = new char[count]; @@ -835,7 +837,7 @@ namespace System.Text if (chars == null) { throw new ArgumentNullException(nameof(chars), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); } Contract.EndContractBlock(); return GetBytes(chars, 0, chars.Length); @@ -872,7 +874,7 @@ namespace System.Text { if (s == null) throw new ArgumentNullException(nameof(s), - SR.ArgumentNull_String); + Environment.GetResourceString("ArgumentNull_String")); Contract.EndContractBlock(); int byteCount = GetByteCount(s); @@ -890,16 +892,16 @@ namespace System.Text { if (s == null) throw new ArgumentNullException(nameof(s), - SR.ArgumentNull_String); + Environment.GetResourceString("ArgumentNull_String")); if (index < 0) throw new ArgumentOutOfRangeException(nameof(index), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); if (index > s.Length - count) throw new ArgumentOutOfRangeException(nameof(index), - SR.ArgumentOutOfRange_IndexCount); + Environment.GetResourceString("ArgumentOutOfRange_IndexCount")); Contract.EndContractBlock(); unsafe @@ -962,11 +964,11 @@ namespace System.Text // Validate input parameters if (bytes == null || chars == null) throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (charCount < 0 || byteCount < 0) throw new ArgumentOutOfRangeException((charCount < 0 ? nameof(charCount) : nameof(byteCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Get the char array to convert @@ -1008,7 +1010,7 @@ namespace System.Text if (bytes == null) { throw new ArgumentNullException(nameof(bytes), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); } Contract.EndContractBlock(); return GetCharCount(bytes, 0, bytes.Length); @@ -1029,11 +1031,11 @@ namespace System.Text // Validate input parameters if (bytes == null) throw new ArgumentNullException(nameof(bytes), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (count < 0) throw new ArgumentOutOfRangeException(nameof(count), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); byte[] arrbyte = new byte[count]; @@ -1061,7 +1063,7 @@ namespace System.Text if (bytes == null) { throw new ArgumentNullException(nameof(bytes), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); } Contract.EndContractBlock(); return GetChars(bytes, 0, bytes.Length); @@ -1116,11 +1118,11 @@ namespace System.Text // Validate input parameters if (chars == null || bytes == null) throw new ArgumentNullException(chars == null ? nameof(chars) : nameof(bytes), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); if (byteCount < 0 || charCount < 0) throw new ArgumentOutOfRangeException((byteCount < 0 ? nameof(byteCount) : nameof(charCount)), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Get the byte array to convert @@ -1167,10 +1169,10 @@ namespace System.Text public unsafe string GetString(byte* bytes, int byteCount) { if (bytes == null) - throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array); + throw new ArgumentNullException(nameof(bytes), Environment.GetResourceString("ArgumentNull_Array")); if (byteCount < 0) - throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); return String.CreateStringFromEncoding(bytes, byteCount, this); @@ -1295,7 +1297,7 @@ namespace System.Text { if (bytes == null) throw new ArgumentNullException(nameof(bytes), - SR.ArgumentNull_Array); + Environment.GetResourceString("ArgumentNull_Array")); Contract.EndContractBlock(); return GetString(bytes, 0, bytes.Length); @@ -1383,7 +1385,8 @@ namespace System.Text // Special message to include fallback type in case fallback's GetMaxCharCount is broken // This happens if user has implimented an encoder fallback with a broken GetMaxCharCount throw new ArgumentException( - SR.Format(SR.Argument_EncodingConversionOverflowBytes, EncodingName, EncoderFallback.GetType()), "bytes"); + Environment.GetResourceString("Argument_EncodingConversionOverflowBytes", + EncodingName, EncoderFallback.GetType()), "bytes"); } internal void ThrowBytesOverflow(EncoderNLS encoder, bool nothingEncoded) @@ -1406,7 +1409,8 @@ namespace System.Text // Special message to include fallback type in case fallback's GetMaxCharCount is broken // This happens if user has implimented a decoder fallback with a broken GetMaxCharCount throw new ArgumentException( - SR.Format(SR.Argument_EncodingConversionOverflowChars, EncodingName, DecoderFallback.GetType()), "chars"); + Environment.GetResourceString("Argument_EncodingConversionOverflowChars", + EncodingName, DecoderFallback.GetType()), "chars"); } internal void ThrowCharsOverflow(DecoderNLS decoder, bool nothingDecoded) @@ -1843,7 +1847,8 @@ namespace System.Text // If we're not converting we must not have data in our fallback buffer if (encoder.m_throwOnOverflow && encoder.InternalHasFallbackBuffer && this.fallbackBuffer.Remaining > 0) - throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, encoder.Encoding.EncodingName, encoder.Fallback.GetType())); + throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty", + encoder.Encoding.EncodingName, encoder.Fallback.GetType())); } fallbackBuffer.InternalInitialize(chars, charEnd, encoder, bytes != null); } diff --git a/src/mscorlib/src/System/Text/EncodingForwarder.cs b/src/mscorlib/src/System/Text/EncodingForwarder.cs index db7dda3991..1198045689 100644 --- a/src/mscorlib/src/System/Text/EncodingForwarder.cs +++ b/src/mscorlib/src/System/Text/EncodingForwarder.cs @@ -39,15 +39,15 @@ namespace System.Text Debug.Assert(encoding != null); // this parameter should only be affected internally, so just do a debug check here if (chars == null) { - throw new ArgumentNullException(nameof(chars), SR.ArgumentNull_Array); + throw new ArgumentNullException(nameof(chars), Environment.GetResourceString("ArgumentNull_Array")); } if (index < 0 || count < 0) { - throw new ArgumentOutOfRangeException(index < 0 ? nameof(index) : nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(index < 0 ? nameof(index) : nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (chars.Length - index < count) { - throw new ArgumentOutOfRangeException(nameof(chars), SR.ArgumentOutOfRange_IndexCountBuffer); + throw new ArgumentOutOfRangeException(nameof(chars), Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); } Contract.EndContractBlock(); @@ -88,11 +88,11 @@ namespace System.Text Debug.Assert(encoding != null); if (chars == null) { - throw new ArgumentNullException(nameof(chars), SR.ArgumentNull_Array); + throw new ArgumentNullException(nameof(chars), Environment.GetResourceString("ArgumentNull_Array")); } if (count < 0) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } Contract.EndContractBlock(); @@ -106,21 +106,21 @@ namespace System.Text if (s == null || bytes == null) { string stringName = encoding is ASCIIEncoding ? "chars" : nameof(s); // ASCIIEncoding calls the first parameter chars - throw new ArgumentNullException(s == null ? stringName : nameof(bytes), SR.ArgumentNull_Array); + throw new ArgumentNullException(s == null ? stringName : nameof(bytes), Environment.GetResourceString("ArgumentNull_Array")); } if (charIndex < 0 || charCount < 0) { - throw new ArgumentOutOfRangeException(charIndex < 0 ? nameof(charIndex) : nameof(charCount), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(charIndex < 0 ? nameof(charIndex) : nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (s.Length - charIndex < charCount) { string stringName = encoding is ASCIIEncoding ? "chars" : nameof(s); // ASCIIEncoding calls the first parameter chars // Duplicate the above check since we don't want the overhead of a type check on the general path - throw new ArgumentOutOfRangeException(stringName, SR.ArgumentOutOfRange_IndexCount); + throw new ArgumentOutOfRangeException(stringName, Environment.GetResourceString("ArgumentOutOfRange_IndexCount")); } if (byteIndex < 0 || byteIndex > bytes.Length) { - throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(byteIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); } Contract.EndContractBlock(); @@ -141,19 +141,19 @@ namespace System.Text Debug.Assert(encoding != null); if (chars == null || bytes == null) { - throw new ArgumentNullException(chars == null ? nameof(chars) : nameof(bytes), SR.ArgumentNull_Array); + throw new ArgumentNullException(chars == null ? nameof(chars) : nameof(bytes), Environment.GetResourceString("ArgumentNull_Array")); } if (charIndex < 0 || charCount < 0) { - throw new ArgumentOutOfRangeException(charIndex < 0 ? nameof(charIndex) : nameof(charCount), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(charIndex < 0 ? nameof(charIndex) : nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (chars.Length - charIndex < charCount) { - throw new ArgumentOutOfRangeException(nameof(chars), SR.ArgumentOutOfRange_IndexCountBuffer); + throw new ArgumentOutOfRangeException(nameof(chars), Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); } if (byteIndex < 0 || byteIndex > bytes.Length) { - throw new ArgumentOutOfRangeException(nameof(byteIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(byteIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); } Contract.EndContractBlock(); @@ -181,11 +181,11 @@ namespace System.Text Debug.Assert(encoding != null); if (bytes == null || chars == null) { - throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), SR.ArgumentNull_Array); + throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), Environment.GetResourceString("ArgumentNull_Array")); } if (charCount < 0 || byteCount < 0) { - throw new ArgumentOutOfRangeException(charCount < 0 ? nameof(charCount) : nameof(byteCount), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(charCount < 0 ? nameof(charCount) : nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } Contract.EndContractBlock(); @@ -197,15 +197,15 @@ namespace System.Text Debug.Assert(encoding != null); if (bytes == null) { - throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array); + throw new ArgumentNullException(nameof(bytes), Environment.GetResourceString("ArgumentNull_Array")); } if (index < 0 || count < 0) { - throw new ArgumentOutOfRangeException(index < 0 ? nameof(index) : nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(index < 0 ? nameof(index) : nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (bytes.Length - index < count) { - throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer); + throw new ArgumentOutOfRangeException(nameof(bytes), Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); } Contract.EndContractBlock(); @@ -223,11 +223,11 @@ namespace System.Text Debug.Assert(encoding != null); if (bytes == null) { - throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array); + throw new ArgumentNullException(nameof(bytes), Environment.GetResourceString("ArgumentNull_Array")); } if (count < 0) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } Contract.EndContractBlock(); @@ -239,19 +239,19 @@ namespace System.Text Debug.Assert(encoding != null); if (bytes == null || chars == null) { - throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), SR.ArgumentNull_Array); + throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), Environment.GetResourceString("ArgumentNull_Array")); } if (byteIndex < 0 || byteCount < 0) { - throw new ArgumentOutOfRangeException(byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(byteIndex < 0 ? nameof(byteIndex) : nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (bytes.Length - byteIndex < byteCount) { - throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer); + throw new ArgumentOutOfRangeException(nameof(bytes), Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); } if (charIndex < 0 || charIndex > chars.Length) { - throw new ArgumentOutOfRangeException(nameof(charIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(charIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); } Contract.EndContractBlock(); @@ -277,11 +277,11 @@ namespace System.Text Debug.Assert(encoding != null); if (bytes == null || chars == null) { - throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), SR.ArgumentNull_Array); + throw new ArgumentNullException(bytes == null ? nameof(bytes) : nameof(chars), Environment.GetResourceString("ArgumentNull_Array")); } if (charCount < 0 || byteCount < 0) { - throw new ArgumentOutOfRangeException(charCount < 0 ? nameof(charCount) : nameof(byteCount), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(charCount < 0 ? nameof(charCount) : nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } Contract.EndContractBlock(); @@ -293,7 +293,7 @@ namespace System.Text Debug.Assert(encoding != null); if (bytes == null) { - throw new ArgumentNullException(nameof(bytes), SR.ArgumentNull_Array); + throw new ArgumentNullException(nameof(bytes), Environment.GetResourceString("ArgumentNull_Array")); } if (index < 0 || count < 0) { @@ -301,11 +301,11 @@ namespace System.Text bool ascii = encoding is ASCIIEncoding; string indexName = ascii ? "byteIndex" : nameof(index); string countName = ascii ? "byteCount" : nameof(count); - throw new ArgumentOutOfRangeException(index < 0 ? indexName : countName, SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(index < 0 ? indexName : countName, Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (bytes.Length - index < count) { - throw new ArgumentOutOfRangeException(nameof(bytes), SR.ArgumentOutOfRange_IndexCountBuffer); + throw new ArgumentOutOfRangeException(nameof(bytes), Environment.GetResourceString("ArgumentOutOfRange_IndexCountBuffer")); } Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/Text/Latin1Encoding.cs b/src/mscorlib/src/System/Text/Latin1Encoding.cs index e456b8533d..7742f7cc52 100644 --- a/src/mscorlib/src/System/Text/Latin1Encoding.cs +++ b/src/mscorlib/src/System/Text/Latin1Encoding.cs @@ -452,7 +452,7 @@ namespace System.Text { if (charCount < 0) throw new ArgumentOutOfRangeException(nameof(charCount), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Characters would be # of characters + 1 in case high surrogate is ? * max fallback @@ -464,7 +464,7 @@ namespace System.Text // 1 to 1 for most characters. Only surrogates with fallbacks have less. if (byteCount > 0x7fffffff) - throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GetByteCountOverflow); + throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow")); return (int)byteCount; } @@ -472,7 +472,7 @@ namespace System.Text { if (byteCount < 0) throw new ArgumentOutOfRangeException(nameof(byteCount), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Just return length, SBCS stay the same length because they don't map to surrogate @@ -483,7 +483,7 @@ namespace System.Text charCount *= DecoderFallback.MaxCharCount; if (charCount > 0x7fffffff) - throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_GetCharCountOverflow); + throw new ArgumentOutOfRangeException(nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_GetCharCountOverflow")); return (int)charCount; } diff --git a/src/mscorlib/src/System/Text/Normalization.Unix.cs b/src/mscorlib/src/System/Text/Normalization.Unix.cs index 2a10d062f2..8b1d7908d7 100644 --- a/src/mscorlib/src/System/Text/Normalization.Unix.cs +++ b/src/mscorlib/src/System/Text/Normalization.Unix.cs @@ -25,7 +25,7 @@ namespace System.Text if (ret == -1) { - throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"), nameof(strInput)); } return ret == 1; @@ -50,7 +50,7 @@ namespace System.Text if (realLen == -1) { - throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"), nameof(strInput)); } if (realLen <= buf.Length) @@ -61,7 +61,7 @@ namespace System.Text buf = new char[realLen]; } - throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"), nameof(strInput)); } // ----------------------------- @@ -78,12 +78,12 @@ namespace System.Text if (normalizationForm != NormalizationForm.FormC && normalizationForm != NormalizationForm.FormD && normalizationForm != NormalizationForm.FormKC && normalizationForm != NormalizationForm.FormKD) { - throw new ArgumentException(SR.Argument_InvalidNormalizationForm, nameof(normalizationForm)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidNormalizationForm"), nameof(normalizationForm)); } if (HasInvalidUnicodeSequence(strInput)) { - throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex"), nameof(strInput)); } } diff --git a/src/mscorlib/src/System/Text/Normalization.Windows.cs b/src/mscorlib/src/System/Text/Normalization.Windows.cs index 389dba743d..e3890b1acb 100644 --- a/src/mscorlib/src/System/Text/Normalization.Windows.cs +++ b/src/mscorlib/src/System/Text/Normalization.Windows.cs @@ -45,7 +45,7 @@ namespace System.Text throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); case Interop.Errors.ERROR_NOT_ENOUGH_MEMORY: - throw new OutOfMemoryException(); + throw new OutOfMemoryException(SR.Arg_OutOfMemoryException); default: throw new InvalidOperationException(SR.Format(SR.UnknownError_Num, lastError)); @@ -83,7 +83,7 @@ namespace System.Text // a trivial math function... // Can't really be Out of Memory, but just in case: if (lastError == Interop.Errors.ERROR_NOT_ENOUGH_MEMORY) - throw new OutOfMemoryException(); + throw new OutOfMemoryException(SR.Arg_OutOfMemoryException); // Who knows what happened? Not us! throw new InvalidOperationException(SR.Format(SR.UnknownError_Num, lastError)); @@ -123,7 +123,7 @@ namespace System.Text throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex, nameof(strInput)); case Interop.Errors.ERROR_NOT_ENOUGH_MEMORY: - throw new OutOfMemoryException(); + throw new OutOfMemoryException(SR.Arg_OutOfMemoryException); default: // We shouldn't get here... diff --git a/src/mscorlib/src/System/Text/StringBuilder.cs b/src/mscorlib/src/System/Text/StringBuilder.cs index 6fb104d176..0cb0db04e1 100644 --- a/src/mscorlib/src/System/Text/StringBuilder.cs +++ b/src/mscorlib/src/System/Text/StringBuilder.cs @@ -127,16 +127,16 @@ namespace System.Text if (capacity < 0) { throw new ArgumentOutOfRangeException(nameof(capacity), - SR.Format(SR.ArgumentOutOfRange_MustBePositive, nameof(capacity))); + Environment.GetResourceString("ArgumentOutOfRange_MustBePositive", nameof(capacity))); } if (length < 0) { throw new ArgumentOutOfRangeException(nameof(length), - SR.Format(SR.ArgumentOutOfRange_MustBeNonNegNum, nameof(length))); + Environment.GetResourceString("ArgumentOutOfRange_MustBeNonNegNum", nameof(length))); } if (startIndex < 0) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex")); } Contract.EndContractBlock(); @@ -146,7 +146,7 @@ namespace System.Text } if (startIndex > value.Length - length) { - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_IndexLength); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_IndexLength")); } m_MaxCapacity = Int32.MaxValue; if (capacity == 0) @@ -172,16 +172,16 @@ namespace System.Text { if (capacity > maxCapacity) { - throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_Capacity); + throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_Capacity")); } if (maxCapacity < 1) { - throw new ArgumentOutOfRangeException(nameof(maxCapacity), SR.ArgumentOutOfRange_SmallMaxCapacity); + throw new ArgumentOutOfRangeException(nameof(maxCapacity), Environment.GetResourceString("ArgumentOutOfRange_SmallMaxCapacity")); } if (capacity < 0) { throw new ArgumentOutOfRangeException(nameof(capacity), - SR.Format(SR.ArgumentOutOfRange_MustBePositive, nameof(capacity))); + Environment.GetResourceString("ArgumentOutOfRange_MustBePositive", nameof(capacity))); } Contract.EndContractBlock(); @@ -234,7 +234,7 @@ namespace System.Text } if (persistedMaxCapacity < 1 || persistedString.Length > persistedMaxCapacity) { - throw new SerializationException(SR.Serialization_StringBuilderMaxCapacity); + throw new SerializationException(Environment.GetResourceString("Serialization_StringBuilderMaxCapacity")); } if (!capacityPresent) @@ -252,7 +252,7 @@ namespace System.Text } if (persistedCapacity < 0 || persistedCapacity < persistedString.Length || persistedCapacity > persistedMaxCapacity) { - throw new SerializationException(SR.Serialization_StringBuilderCapacity); + throw new SerializationException(Environment.GetResourceString("Serialization_StringBuilderCapacity")); } // Assign @@ -315,15 +315,15 @@ namespace System.Text { if (value < 0) { - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NegativeCapacity); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_NegativeCapacity")); } if (value > MaxCapacity) { - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_Capacity); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_Capacity")); } if (value < Length) { - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_SmallCapacity); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity")); } Contract.EndContractBlock(); @@ -351,7 +351,7 @@ namespace System.Text { if (capacity < 0) { - throw new ArgumentOutOfRangeException(nameof(capacity), SR.ArgumentOutOfRange_NegativeCapacity); + throw new ArgumentOutOfRangeException(nameof(capacity), Environment.GetResourceString("ArgumentOutOfRange_NegativeCapacity")); } Contract.EndContractBlock(); @@ -392,7 +392,7 @@ namespace System.Text } else { - throw new ArgumentOutOfRangeException(nameof(chunkLength), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(chunkLength), Environment.GetResourceString("ArgumentOutOfRange_Index")); } } chunk = chunk.m_ChunkPrevious; @@ -412,19 +412,19 @@ namespace System.Text int currentLength = this.Length; if (startIndex < 0) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex")); } if (startIndex > currentLength) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndexLargerThanLength); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndexLargerThanLength")); } if (length < 0) { - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength")); } if (startIndex > (currentLength - length)) { - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_IndexLength); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_IndexLength")); } VerifyClassInvariant(); @@ -469,7 +469,7 @@ namespace System.Text } else { - throw new ArgumentOutOfRangeException(nameof(chunkCount), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(chunkCount), Environment.GetResourceString("ArgumentOutOfRange_Index")); } } } @@ -504,12 +504,12 @@ namespace System.Text //If the new length is less than 0 or greater than our Maximum capacity, bail. if (value < 0) { - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_NegativeLength); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength")); } if (value > MaxCapacity) { - throw new ArgumentOutOfRangeException(nameof(value), SR.ArgumentOutOfRange_SmallCapacity); + throw new ArgumentOutOfRangeException(nameof(value), Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity")); } Contract.EndContractBlock(); @@ -584,13 +584,13 @@ namespace System.Text if (indexInBlock >= 0) { if (indexInBlock >= chunk.m_ChunkLength) - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index")); chunk.m_ChunkChars[indexInBlock] = value; return; } chunk = chunk.m_ChunkPrevious; if (chunk == null) - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index")); } } } @@ -600,7 +600,7 @@ namespace System.Text { if (repeatCount < 0) { - throw new ArgumentOutOfRangeException(nameof(repeatCount), SR.ArgumentOutOfRange_NegativeCount); + throw new ArgumentOutOfRangeException(nameof(repeatCount), Environment.GetResourceString("ArgumentOutOfRange_NegativeCount")); } Contract.Ensures(Contract.Result<StringBuilder>() != null); Contract.EndContractBlock(); @@ -615,7 +615,7 @@ namespace System.Text int newLength = Length + repeatCount; if (newLength > m_MaxCapacity || newLength < repeatCount) { - throw new ArgumentOutOfRangeException(nameof(repeatCount), SR.ArgumentOutOfRange_LengthGreaterThanCapacity); + throw new ArgumentOutOfRangeException(nameof(repeatCount), Environment.GetResourceString("ArgumentOutOfRange_LengthGreaterThanCapacity")); } int idx = m_ChunkLength; @@ -644,11 +644,11 @@ namespace System.Text { if (startIndex < 0) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_GenericPositive); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive")); } if (charCount < 0) { - throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GenericPositive); + throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive")); } Contract.Ensures(Contract.Result<StringBuilder>() != null); Contract.EndContractBlock(); @@ -663,7 +663,7 @@ namespace System.Text } if (charCount > value.Length - startIndex) { - throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (charCount == 0) @@ -745,12 +745,12 @@ namespace System.Text { if (startIndex < 0) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (count < 0) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_GenericPositive); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive")); } Contract.Ensures(Contract.Result<StringBuilder>() != null); @@ -772,7 +772,7 @@ namespace System.Text if (startIndex > value.Length - count) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); } unsafe @@ -808,28 +808,28 @@ namespace System.Text if (count < 0) { - throw new ArgumentOutOfRangeException(nameof(count), SR.Arg_NegativeArgCount); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("Arg_NegativeArgCount")); } if (destinationIndex < 0) { throw new ArgumentOutOfRangeException(nameof(destinationIndex), - SR.Format(SR.ArgumentOutOfRange_MustBeNonNegNum, nameof(destinationIndex))); + Environment.GetResourceString("ArgumentOutOfRange_MustBeNonNegNum", nameof(destinationIndex))); } if (destinationIndex > destination.Length - count) { - throw new ArgumentException(SR.ArgumentOutOfRange_OffsetOut); + throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_OffsetOut")); } if ((uint)sourceIndex > (uint)Length) { - throw new ArgumentOutOfRangeException(nameof(sourceIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(sourceIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (sourceIndex > Length - count) { - throw new ArgumentException(SR.Arg_LongerThanSrcString); + throw new ArgumentException(Environment.GetResourceString("Arg_LongerThanSrcString")); } Contract.EndContractBlock(); @@ -873,7 +873,7 @@ namespace System.Text { if (count < 0) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } Contract.Ensures(Contract.Result<StringBuilder>() != null); Contract.EndContractBlock(); @@ -882,7 +882,7 @@ namespace System.Text int currentLength = Length; if ((uint)index > (uint)currentLength) { - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index")); } //If value is null, empty or count is 0, do nothing. This is ECMA standard. @@ -926,17 +926,17 @@ namespace System.Text { if (length < 0) { - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_NegativeLength); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_NegativeLength")); } if (startIndex < 0) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex")); } if (length > Length - startIndex) { - throw new ArgumentOutOfRangeException(nameof(length), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(length), Environment.GetResourceString("ArgumentOutOfRange_Index")); } Contract.Ensures(Contract.Result<StringBuilder>() != null); Contract.EndContractBlock(); @@ -1200,7 +1200,7 @@ namespace System.Text { if ((uint)index > (uint)Length) { - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index")); } Contract.Ensures(Contract.Result<StringBuilder>() != null); Contract.EndContractBlock(); @@ -1285,7 +1285,7 @@ namespace System.Text { if ((uint)index > (uint)Length) { - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index")); } Contract.Ensures(Contract.Result<StringBuilder>() != null); Contract.EndContractBlock(); @@ -1306,7 +1306,7 @@ namespace System.Text int currentLength = Length; if ((uint)index > (uint)currentLength) { - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index")); } //If they passed in a null char array, just jump out quickly. @@ -1316,23 +1316,23 @@ namespace System.Text { return this; } - throw new ArgumentNullException(nameof(value), SR.ArgumentNull_String); + throw new ArgumentNullException(nameof(value), Environment.GetResourceString("ArgumentNull_String")); } //Range check the array. if (startIndex < 0) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_StartIndex); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_StartIndex")); } if (charCount < 0) { - throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GenericPositive); + throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GenericPositive")); } if (startIndex > value.Length - charCount) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (charCount > 0) @@ -1510,7 +1510,7 @@ namespace System.Text private static void FormatError() { - throw new FormatException(SR.Format_InvalidString); + throw new FormatException(Environment.GetResourceString("Format_InvalidString")); } // undocumented exclusive limits on the range for Argument Hole Index and Argument Hole Alignment. @@ -1597,7 +1597,7 @@ namespace System.Text } while (ch >= '0' && ch <= '9' && index < Index_Limit); // If value of index is not within the range of the arguments passed in then error (Index out of range) - if (index >= args.Length) throw new FormatException(SR.Format_IndexOutOfRange); + if (index >= args.Length) throw new FormatException(Environment.GetResourceString("Format_IndexOutOfRange")); // Consume optional whitespace. while (pos < len && (ch = format[pos]) == ' ') pos++; @@ -1817,11 +1817,11 @@ namespace System.Text int currentLength = Length; if ((uint)startIndex > (uint)currentLength) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (count < 0 || startIndex > currentLength - count) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (oldValue == null) { @@ -1829,7 +1829,7 @@ namespace System.Text } if (oldValue.Length == 0) { - throw new ArgumentException(SR.Argument_EmptyName, nameof(oldValue)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(oldValue)); } if (newValue == null) @@ -1906,12 +1906,12 @@ namespace System.Text int currentLength = Length; if ((uint)startIndex > (uint)currentLength) { - throw new ArgumentOutOfRangeException(nameof(startIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(startIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (count < 0 || startIndex > currentLength - count) { - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_Index")); } int endIndex = startIndex + count; @@ -1947,7 +1947,7 @@ namespace System.Text // We don't check null value as this case will throw null reference exception anyway if (valueCount < 0) { - throw new ArgumentOutOfRangeException(nameof(valueCount), SR.ArgumentOutOfRange_NegativeCount); + throw new ArgumentOutOfRangeException(nameof(valueCount), Environment.GetResourceString("ArgumentOutOfRange_NegativeCount")); } // this is where we can check if the valueCount will put us over m_MaxCapacity @@ -1955,7 +1955,7 @@ namespace System.Text int newLength = Length + valueCount; if (newLength > m_MaxCapacity || newLength < valueCount) { - throw new ArgumentOutOfRangeException(nameof(valueCount), SR.ArgumentOutOfRange_LengthGreaterThanCapacity); + throw new ArgumentOutOfRangeException(nameof(valueCount), Environment.GetResourceString("ArgumentOutOfRange_LengthGreaterThanCapacity")); } // This case is so common we want to optimize for it heavily. @@ -1995,7 +1995,7 @@ namespace System.Text { if ((uint)index > (uint)Length) { - throw new ArgumentOutOfRangeException(nameof(index), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(index), Environment.GetResourceString("ArgumentOutOfRange_Index")); } if (valueCount > 0) @@ -2143,7 +2143,7 @@ namespace System.Text } else { - throw new ArgumentOutOfRangeException(nameof(destinationIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(destinationIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); } } } @@ -2161,7 +2161,7 @@ namespace System.Text } else { - throw new ArgumentOutOfRangeException(nameof(sourceIndex), SR.ArgumentOutOfRange_Index); + throw new ArgumentOutOfRangeException(nameof(sourceIndex), Environment.GetResourceString("ArgumentOutOfRange_Index")); } } } @@ -2258,7 +2258,7 @@ namespace System.Text VerifyClassInvariant(); if ((minBlockCharCount + Length) > m_MaxCapacity || minBlockCharCount + Length < minBlockCharCount) - throw new ArgumentOutOfRangeException("requiredLength", SR.ArgumentOutOfRange_SmallCapacity); + throw new ArgumentOutOfRangeException("requiredLength", Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity")); // Compute the length of the new block we need // We make the new chunk at least big enough for the current need (minBlockCharCount) @@ -2317,7 +2317,7 @@ namespace System.Text Debug.Assert(count > 0, "Count must be strictly positive"); Debug.Assert(index >= 0, "Index can't be negative"); if (count + Length > m_MaxCapacity || count + Length < count) - throw new ArgumentOutOfRangeException("requiredLength", SR.ArgumentOutOfRange_SmallCapacity); + throw new ArgumentOutOfRangeException("requiredLength", Environment.GetResourceString("ArgumentOutOfRange_SmallCapacity")); chunk = this; while (chunk.m_ChunkOffset > index) diff --git a/src/mscorlib/src/System/Text/UTF32Encoding.cs b/src/mscorlib/src/System/Text/UTF32Encoding.cs index 37defe38ba..0e5f1f4daf 100644 --- a/src/mscorlib/src/System/Text/UTF32Encoding.cs +++ b/src/mscorlib/src/System/Text/UTF32Encoding.cs @@ -202,7 +202,8 @@ namespace System.Text // We mustn't have left over fallback data when counting if (fallbackBuffer.Remaining > 0) - throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType())); + throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty", + this.EncodingName, encoder.Fallback.GetType())); } else { @@ -300,7 +301,8 @@ namespace System.Text // Check for overflows. if (byteCount < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_GetByteCountOverflow); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString( + "ArgumentOutOfRange_GetByteCountOverflow")); // Shouldn't have anything in fallback buffer for GetByteCount // (don't have to check m_throwOnOverflow for count) @@ -337,7 +339,8 @@ namespace System.Text // We mustn't have left over fallback data when not converting if (encoder.m_throwOnOverflow && fallbackBuffer.Remaining > 0) - throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType())); + throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty", + this.EncodingName, encoder.Fallback.GetType())); } else { @@ -644,7 +647,7 @@ namespace System.Text // Check for overflows. if (charCount < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_GetByteCountOverflow); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow")); // Shouldn't have anything in fallback buffer for GetCharCount // (don't have to check m_throwOnOverflow for chars or count) @@ -904,7 +907,7 @@ namespace System.Text { if (charCount < 0) throw new ArgumentOutOfRangeException(nameof(charCount), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Characters would be # of characters + 1 in case left over high surrogate is ? * max fallback @@ -917,7 +920,7 @@ namespace System.Text byteCount *= 4; if (byteCount > 0x7fffffff) - throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GetByteCountOverflow); + throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow")); return (int)byteCount; } @@ -927,7 +930,7 @@ namespace System.Text { if (byteCount < 0) throw new ArgumentOutOfRangeException(nameof(byteCount), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // A supplementary character becomes 2 surrogate characters, so 4 input bytes becomes 2 chars, @@ -947,7 +950,7 @@ namespace System.Text } if (charCount > 0x7fffffff) - throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_GetCharCountOverflow); + throw new ArgumentOutOfRangeException(nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_GetCharCountOverflow")); return (int)charCount; } diff --git a/src/mscorlib/src/System/Text/UTF7Encoding.cs b/src/mscorlib/src/System/Text/UTF7Encoding.cs index 3a470a9479..abe6fd151d 100644 --- a/src/mscorlib/src/System/Text/UTF7Encoding.cs +++ b/src/mscorlib/src/System/Text/UTF7Encoding.cs @@ -581,7 +581,7 @@ namespace System.Text { if (charCount < 0) throw new ArgumentOutOfRangeException(nameof(charCount), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Suppose that every char can not be direct-encoded, we know that @@ -604,7 +604,7 @@ namespace System.Text // check for overflow if (byteCount > 0x7fffffff) - throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GetByteCountOverflow); + throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow")); return (int)byteCount; } @@ -614,7 +614,7 @@ namespace System.Text { if (byteCount < 0) throw new ArgumentOutOfRangeException(nameof(byteCount), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Worst case is 1 char per byte. Minimum 1 for left over bits in case decoder is being flushed @@ -869,7 +869,7 @@ namespace System.Text Debug.Assert(iCount < 0, "[DecoderUTF7FallbackBuffer.InternalFallback] Can't have recursive fallbacks"); if (bytes.Length != 1) { - throw new ArgumentException(SR.Argument_InvalidCharSequenceNoIndex); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidCharSequenceNoIndex")); } // Can't fallback a byte 0, so return for that case, 1 otherwise. diff --git a/src/mscorlib/src/System/Text/UTF8Encoding.cs b/src/mscorlib/src/System/Text/UTF8Encoding.cs index 997aa90729..cd0319dab7 100644 --- a/src/mscorlib/src/System/Text/UTF8Encoding.cs +++ b/src/mscorlib/src/System/Text/UTF8Encoding.cs @@ -231,7 +231,8 @@ namespace System.Text { fallbackBuffer = encoder.FallbackBuffer; if (fallbackBuffer.Remaining > 0) - throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType())); + throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty", + this.EncodingName, encoder.Fallback.GetType())); // Set our internal fallback interesting things. fallbackBuffer.InternalInitialize(chars, pEnd, encoder, false); @@ -581,7 +582,7 @@ namespace System.Text if (byteCount < 0) { throw new ArgumentException( - SR.Argument_ConversionOverflow); + Environment.GetResourceString("Argument_ConversionOverflow")); } #endif @@ -648,7 +649,8 @@ namespace System.Text // We always need the fallback buffer in get bytes so we can flush any remaining ones if necessary fallbackBuffer = encoder.FallbackBuffer; if (fallbackBuffer.Remaining > 0 && encoder.m_throwOnOverflow) - throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType())); + throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty", + this.EncodingName, encoder.Fallback.GetType())); // Set our internal fallback interesting things. fallbackBuffer.InternalInitialize(chars, pEnd, encoder, true); @@ -2235,7 +2237,7 @@ namespace System.Text { if (charCount < 0) throw new ArgumentOutOfRangeException(nameof(charCount), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Characters would be # of characters + 1 in case left over high surrogate is ? * max fallback @@ -2248,7 +2250,7 @@ namespace System.Text byteCount *= 3; if (byteCount > 0x7fffffff) - throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GetByteCountOverflow); + throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow")); return (int)byteCount; } @@ -2258,7 +2260,7 @@ namespace System.Text { if (byteCount < 0) throw new ArgumentOutOfRangeException(nameof(byteCount), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Figure out our length, 1 char per input byte + 1 char if 1st byte is last byte of 4 byte surrogate pair @@ -2272,7 +2274,7 @@ namespace System.Text } if (charCount > 0x7fffffff) - throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_GetCharCountOverflow); + throw new ArgumentOutOfRangeException(nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_GetCharCountOverflow")); return (int)charCount; } diff --git a/src/mscorlib/src/System/Text/UnicodeEncoding.cs b/src/mscorlib/src/System/Text/UnicodeEncoding.cs index 07de4c8f81..16d2413784 100644 --- a/src/mscorlib/src/System/Text/UnicodeEncoding.cs +++ b/src/mscorlib/src/System/Text/UnicodeEncoding.cs @@ -189,7 +189,7 @@ namespace System.Text // (If they were all invalid chars, this would actually be wrong, // but that's a ridiculously large # so we're not concerned about that case) if (byteCount < 0) - throw new ArgumentOutOfRangeException(nameof(count), SR.ArgumentOutOfRange_GetByteCountOverflow); + throw new ArgumentOutOfRangeException(nameof(count), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow")); char* charStart = chars; char* charEnd = chars + count; @@ -219,7 +219,8 @@ namespace System.Text { fallbackBuffer = encoder.FallbackBuffer; if (fallbackBuffer.Remaining > 0) - throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType())); + throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty", + this.EncodingName, encoder.Fallback.GetType())); // Set our internal fallback interesting things. fallbackBuffer.InternalInitialize(charStart, charEnd, encoder, false); @@ -442,7 +443,8 @@ namespace System.Text { // Throw it, using our complete character throw new ArgumentException( - SR.Format(SR.Argument_RecursiveFallback, charLeftOver), nameof(chars)); + Environment.GetResourceString("Argument_RecursiveFallback", + charLeftOver), nameof(chars)); } else { @@ -509,7 +511,8 @@ namespace System.Text // We always need the fallback buffer in get bytes so we can flush any remaining ones if necessary fallbackBuffer = encoder.FallbackBuffer; if (fallbackBuffer.Remaining > 0 && encoder.m_throwOnOverflow) - throw new ArgumentException(SR.Format(SR.Argument_EncoderFallbackNotEmpty, this.EncodingName, encoder.Fallback.GetType())); + throw new ArgumentException(Environment.GetResourceString("Argument_EncoderFallbackNotEmpty", + this.EncodingName, encoder.Fallback.GetType())); // Set our internal fallback interesting things. fallbackBuffer.InternalInitialize(charStart, charEnd, encoder, false); @@ -850,7 +853,8 @@ namespace System.Text { // Throw it, using our complete character throw new ArgumentException( - SR.Format(SR.Argument_RecursiveFallback, charLeftOver), nameof(chars)); + Environment.GetResourceString("Argument_RecursiveFallback", + charLeftOver), nameof(chars)); } else { @@ -1708,7 +1712,7 @@ namespace System.Text { if (charCount < 0) throw new ArgumentOutOfRangeException(nameof(charCount), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // Characters would be # of characters + 1 in case left over high surrogate is ? * max fallback @@ -1721,7 +1725,7 @@ namespace System.Text byteCount <<= 1; if (byteCount > 0x7fffffff) - throw new ArgumentOutOfRangeException(nameof(charCount), SR.ArgumentOutOfRange_GetByteCountOverflow); + throw new ArgumentOutOfRangeException(nameof(charCount), Environment.GetResourceString("ArgumentOutOfRange_GetByteCountOverflow")); return (int)byteCount; } @@ -1731,7 +1735,7 @@ namespace System.Text { if (byteCount < 0) throw new ArgumentOutOfRangeException(nameof(byteCount), - SR.ArgumentOutOfRange_NeedNonNegNum); + Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); // long because byteCount could be biggest int. @@ -1745,7 +1749,7 @@ namespace System.Text charCount *= DecoderFallback.MaxCharCount; if (charCount > 0x7fffffff) - throw new ArgumentOutOfRangeException(nameof(byteCount), SR.ArgumentOutOfRange_GetCharCountOverflow); + throw new ArgumentOutOfRangeException(nameof(byteCount), Environment.GetResourceString("ArgumentOutOfRange_GetCharCountOverflow")); return (int)charCount; } diff --git a/src/mscorlib/src/System/Threading/AbandonedMutexException.cs b/src/mscorlib/src/System/Threading/AbandonedMutexException.cs index bbc1a676bf..b39cb208b8 100644 --- a/src/mscorlib/src/System/Threading/AbandonedMutexException.cs +++ b/src/mscorlib/src/System/Threading/AbandonedMutexException.cs @@ -25,7 +25,7 @@ namespace System.Threading private Mutex m_Mutex = null; public AbandonedMutexException() - : base(SR.Threading_AbandonedMutexException) + : base(Environment.GetResourceString("Threading.AbandonedMutexException")) { SetErrorCode(__HResults.COR_E_ABANDONEDMUTEX); } @@ -43,7 +43,7 @@ namespace System.Threading } public AbandonedMutexException(int location, WaitHandle handle) - : base(SR.Threading_AbandonedMutexException) + : base(Environment.GetResourceString("Threading.AbandonedMutexException")) { SetErrorCode(__HResults.COR_E_ABANDONEDMUTEX); SetupException(location, handle); diff --git a/src/mscorlib/src/System/Threading/CancellationToken.cs b/src/mscorlib/src/System/Threading/CancellationToken.cs index 8bddfc90dd..4d8212044c 100644 --- a/src/mscorlib/src/System/Threading/CancellationToken.cs +++ b/src/mscorlib/src/System/Threading/CancellationToken.cs @@ -469,12 +469,12 @@ namespace System.Threading // Throws an OCE; separated out to enable better inlining of ThrowIfCancellationRequested private void ThrowOperationCanceledException() { - throw new OperationCanceledException(SR.OperationCanceled, this); + throw new OperationCanceledException(Environment.GetResourceString("OperationCanceled"), this); } private static void ThrowObjectDisposedException() { - throw new ObjectDisposedException(null, SR.CancellationToken_SourceDisposed); + throw new ObjectDisposedException(null, Environment.GetResourceString("CancellationToken_SourceDisposed")); } // ----------------------------------- diff --git a/src/mscorlib/src/System/Threading/CancellationTokenSource.cs b/src/mscorlib/src/System/Threading/CancellationTokenSource.cs index 3f4aaaa0b3..eef3a15644 100644 --- a/src/mscorlib/src/System/Threading/CancellationTokenSource.cs +++ b/src/mscorlib/src/System/Threading/CancellationTokenSource.cs @@ -600,7 +600,7 @@ namespace System.Threading // separation enables inlining of ThrowIfDisposed private static void ThrowObjectDisposedException() { - throw new ObjectDisposedException(null, SR.CancellationTokenSource_Disposed); + throw new ObjectDisposedException(null, Environment.GetResourceString("CancellationTokenSource_Disposed")); } /// <summary> @@ -891,7 +891,7 @@ namespace System.Threading switch (tokens.Length) { case 0: - throw new ArgumentException(SR.CancellationToken_CreateLinkedToken_TokensIsEmpty); + throw new ArgumentException(Environment.GetResourceString("CancellationToken_CreateLinkedToken_TokensIsEmpty")); case 1: return CreateLinkedTokenSource(tokens[0]); case 2: diff --git a/src/mscorlib/src/System/Threading/EventWaitHandle.cs b/src/mscorlib/src/System/Threading/EventWaitHandle.cs index 611d9de7e7..034c4b0ee6 100644 --- a/src/mscorlib/src/System/Threading/EventWaitHandle.cs +++ b/src/mscorlib/src/System/Threading/EventWaitHandle.cs @@ -46,11 +46,11 @@ namespace System.Threading if (name != null) { #if PLATFORM_UNIX - throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_NamedSynchronizationPrimitives")); #else if (System.IO.Path.MaxPath < name.Length) { - throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name)); } #endif } @@ -67,7 +67,7 @@ namespace System.Threading break; default: - throw new ArgumentException(SR.Format(SR.Argument_InvalidFlag, name)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag", name)); }; if (_handle.IsInvalid) @@ -76,7 +76,7 @@ namespace System.Threading _handle.SetHandleAsInvalid(); if (null != name && 0 != name.Length && Win32Native.ERROR_INVALID_HANDLE == errorCode) - throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name)); + throw new WaitHandleCannotBeOpenedException(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name)); __Error.WinIOError(errorCode, name); } @@ -93,11 +93,11 @@ namespace System.Threading if (name != null) { #if PLATFORM_UNIX - throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_NamedSynchronizationPrimitives")); #else if (System.IO.Path.MaxPath < name.Length) { - throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name)); } #endif } @@ -116,7 +116,7 @@ namespace System.Threading break; default: - throw new ArgumentException(SR.Format(SR.Argument_InvalidFlag, name)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidFlag", name)); }; _handle = Win32Native.CreateEvent(secAttrs, isManualReset, initialState, name); @@ -126,7 +126,7 @@ namespace System.Threading { _handle.SetHandleAsInvalid(); if (null != name && 0 != name.Length && Win32Native.ERROR_INVALID_HANDLE == errorCode) - throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name)); + throw new WaitHandleCannotBeOpenedException(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name)); __Error.WinIOError(errorCode, name); } @@ -153,7 +153,7 @@ namespace System.Threading throw new WaitHandleCannotBeOpenedException(); case OpenExistingResult.NameInvalid: - throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name)); + throw new WaitHandleCannotBeOpenedException(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name)); case OpenExistingResult.PathNotFound: __Error.WinIOError(Win32Native.ERROR_PATH_NOT_FOUND, ""); @@ -172,21 +172,21 @@ namespace System.Threading private static OpenExistingResult OpenExistingWorker(string name, EventWaitHandleRights rights, out EventWaitHandle result) { #if PLATFORM_UNIX - throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_NamedSynchronizationPrimitives")); #else if (name == null) { - throw new ArgumentNullException(nameof(name), SR.ArgumentNull_WithParamName); + throw new ArgumentNullException(nameof(name), Environment.GetResourceString("ArgumentNull_WithParamName")); } if (name.Length == 0) { - throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name)); } if (null != name && System.IO.Path.MaxPath < name.Length) { - throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name)); } Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/Threading/ExecutionContext.cs b/src/mscorlib/src/System/Threading/ExecutionContext.cs index ec125ad8d2..1e9e9b4ef1 100644 --- a/src/mscorlib/src/System/Threading/ExecutionContext.cs +++ b/src/mscorlib/src/System/Threading/ExecutionContext.cs @@ -117,7 +117,7 @@ namespace System.Threading ExecutionContext executionContext = currentThread.ExecutionContext ?? Default; if (executionContext.m_isFlowSuppressed) { - throw new InvalidOperationException(SR.InvalidOperation_CannotSupressFlowMultipleTimes); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotSupressFlowMultipleTimes")); } Contract.EndContractBlock(); @@ -134,7 +134,7 @@ namespace System.Threading ExecutionContext executionContext = currentThread.ExecutionContext; if (executionContext == null || !executionContext.m_isFlowSuppressed) { - throw new InvalidOperationException(SR.InvalidOperation_CannotRestoreUnsupressedFlow); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotRestoreUnsupressedFlow")); } Contract.EndContractBlock(); @@ -151,7 +151,7 @@ namespace System.Threading public static void Run(ExecutionContext executionContext, ContextCallback callback, Object state) { if (executionContext == null) - throw new InvalidOperationException(SR.InvalidOperation_NullContext); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_NullContext")); Thread currentThread = Thread.CurrentThread; ExecutionContextSwitcher ecsw = default(ExecutionContextSwitcher); @@ -238,7 +238,7 @@ namespace System.Threading catch (Exception ex) { Environment.FailFast( - SR.ExecutionContext_ExceptionInAsyncLocalNotification, + Environment.GetResourceString("ExecutionContext_ExceptionInAsyncLocalNotification"), ex); } } @@ -319,11 +319,11 @@ namespace System.Threading { if (_thread == null) { - throw new InvalidOperationException(SR.InvalidOperation_CannotUseAFCMultiple); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotUseAFCMultiple")); } if (Thread.CurrentThread != _thread) { - throw new InvalidOperationException(SR.InvalidOperation_CannotUseAFCOtherThread); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_CannotUseAFCOtherThread")); } // An async flow control cannot be undone when a different execution context is applied. The desktop framework @@ -338,7 +338,7 @@ namespace System.Threading // flow is suppressed. if (!ExecutionContext.IsFlowSuppressed()) { - throw new InvalidOperationException(SR.InvalidOperation_AsyncFlowCtrlCtxMismatch); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_AsyncFlowCtrlCtxMismatch")); } Contract.EndContractBlock(); diff --git a/src/mscorlib/src/System/Threading/LazyInitializer.cs b/src/mscorlib/src/System/Threading/LazyInitializer.cs index e264a8f166..6c84caa5a6 100644 --- a/src/mscorlib/src/System/Threading/LazyInitializer.cs +++ b/src/mscorlib/src/System/Threading/LazyInitializer.cs @@ -128,7 +128,7 @@ namespace System.Threading T value = valueFactory(); if (value == null) { - throw new InvalidOperationException(SR.Lazy_StaticInit_InvalidOperation); + throw new InvalidOperationException(Environment.GetResourceString("Lazy_StaticInit_InvalidOperation")); } Interlocked.CompareExchange(ref target, value, null); @@ -257,7 +257,7 @@ namespace System.Threading Volatile.Write(ref target, valueFactory()); if (target == null) { - throw new InvalidOperationException(SR.Lazy_StaticInit_InvalidOperation); + throw new InvalidOperationException(Environment.GetResourceString("Lazy_StaticInit_InvalidOperation")); } } } @@ -279,7 +279,7 @@ namespace System.Threading } catch (MissingMethodException) { - throw new MissingMemberException(SR.Lazy_CreateValue_NoParameterlessCtorForT); + throw new MissingMemberException(Environment.GetResourceString("Lazy_CreateValue_NoParameterlessCtorForT")); } } } diff --git a/src/mscorlib/src/System/Threading/ManualResetEventSlim.cs b/src/mscorlib/src/System/Threading/ManualResetEventSlim.cs index 402a76cdc7..c0bdbcece2 100644 --- a/src/mscorlib/src/System/Threading/ManualResetEventSlim.cs +++ b/src/mscorlib/src/System/Threading/ManualResetEventSlim.cs @@ -163,7 +163,7 @@ namespace System.Threading // it is possible for the max number of waiters to be exceeded via user-code, hence we use a real exception here. if (value >= NumWaitersState_MaxValue) - throw new InvalidOperationException(String.Format(SR.ManualResetEventSlim_ctor_TooManyWaiters, NumWaitersState_MaxValue)); + throw new InvalidOperationException(String.Format(Environment.GetResourceString("ManualResetEventSlim_ctor_TooManyWaiters"), NumWaitersState_MaxValue)); UpdateStateAtomically(value << NumWaitersState_ShiftCount, NumWaitersState_BitMask); } @@ -218,7 +218,7 @@ namespace System.Threading { throw new ArgumentOutOfRangeException( nameof(spinCount), - String.Format(SR.ManualResetEventSlim_ctor_SpinCountOutOfRange, SpinCountState_MaxValue)); + String.Format(Environment.GetResourceString("ManualResetEventSlim_ctor_SpinCountOutOfRange"), SpinCountState_MaxValue)); } // We will suppress default spin because the user specified a count. @@ -717,7 +717,7 @@ namespace System.Threading private void ThrowIfDisposed() { if ((m_combinedState & Dispose_BitMask) != 0) - throw new ObjectDisposedException(SR.ManualResetEventSlim_Disposed); + throw new ObjectDisposedException(Environment.GetResourceString("ManualResetEventSlim_Disposed")); } /// <summary> diff --git a/src/mscorlib/src/System/Threading/Monitor.cs b/src/mscorlib/src/System/Threading/Monitor.cs index 3ace3335aa..8cebe647bb 100644 --- a/src/mscorlib/src/System/Threading/Monitor.cs +++ b/src/mscorlib/src/System/Threading/Monitor.cs @@ -57,7 +57,7 @@ namespace System.Threading private static void ThrowLockTakenException() { - throw new ArgumentException(SR.Argument_MustBeFalse, "lockTaken"); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeFalse"), "lockTaken"); } [MethodImplAttribute(MethodImplOptions.InternalCall)] @@ -122,7 +122,7 @@ namespace System.Threading { long tm = (long)timeout.TotalMilliseconds; if (tm < -1 || tm > (long)Int32.MaxValue) - throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); return (int)tm; } diff --git a/src/mscorlib/src/System/Threading/Mutex.cs b/src/mscorlib/src/System/Threading/Mutex.cs index 5e77e35bd6..cac423f6a8 100644 --- a/src/mscorlib/src/System/Threading/Mutex.cs +++ b/src/mscorlib/src/System/Threading/Mutex.cs @@ -50,7 +50,7 @@ namespace System.Threading #if !PLATFORM_UNIX if (name != null && System.IO.Path.MaxPath < name.Length) { - throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name)); } #endif Contract.EndContractBlock(); @@ -128,11 +128,11 @@ namespace System.Threading #if PLATFORM_UNIX case Win32Native.ERROR_FILENAME_EXCED_RANGE: // On Unix, length validation is done by CoreCLR's PAL after converting to utf-8 - throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Interop.Sys.MaxName), "name"); + throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Interop.Sys.MaxName), "name"); #endif case Win32Native.ERROR_INVALID_HANDLE: - throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, m_name)); + throw new WaitHandleCannotBeOpenedException(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", m_name)); } } __Error.WinIOError(errorCode, m_name); @@ -210,7 +210,7 @@ namespace System.Threading throw new WaitHandleCannotBeOpenedException(); case OpenExistingResult.NameInvalid: - throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name)); + throw new WaitHandleCannotBeOpenedException(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name)); case OpenExistingResult.PathNotFound: __Error.WinIOError(Win32Native.ERROR_PATH_NOT_FOUND, name); @@ -230,17 +230,17 @@ namespace System.Threading { if (name == null) { - throw new ArgumentNullException(nameof(name), SR.ArgumentNull_WithParamName); + throw new ArgumentNullException(nameof(name), Environment.GetResourceString("ArgumentNull_WithParamName")); } if (name.Length == 0) { - throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name)); } #if !PLATFORM_UNIX if (System.IO.Path.MaxPath < name.Length) { - throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name)); } #endif Contract.EndContractBlock(); @@ -262,7 +262,7 @@ namespace System.Threading if (name != null && errorCode == Win32Native.ERROR_FILENAME_EXCED_RANGE) { // On Unix, length validation is done by CoreCLR's PAL after converting to utf-8 - throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Interop.Sys.MaxName), nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Interop.Sys.MaxName), nameof(name)); } #endif @@ -291,7 +291,7 @@ namespace System.Threading } else { - throw new ApplicationException(SR.Arg_SynchronizationLockException); + throw new ApplicationException(Environment.GetResourceString("Arg_SynchronizationLockException")); } } diff --git a/src/mscorlib/src/System/Threading/Overlapped.cs b/src/mscorlib/src/System/Threading/Overlapped.cs index 64ae76dbc4..8712c12c8f 100644 --- a/src/mscorlib/src/System/Threading/Overlapped.cs +++ b/src/mscorlib/src/System/Threading/Overlapped.cs @@ -166,7 +166,7 @@ namespace System.Threading { if (!m_pinSelf.IsNull()) { - throw new InvalidOperationException(SR.InvalidOperation_Overlapped_Pack); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_Overlapped_Pack")); } if (iocb != null) @@ -198,7 +198,7 @@ namespace System.Threading { if (!m_pinSelf.IsNull()) { - throw new InvalidOperationException(SR.InvalidOperation_Overlapped_Pack); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_Overlapped_Pack")); } m_userObject = userData; if (m_userObject != null) diff --git a/src/mscorlib/src/System/Threading/Semaphore.cs b/src/mscorlib/src/System/Threading/Semaphore.cs index ae353cc3e3..1eac4aaaeb 100644 --- a/src/mscorlib/src/System/Threading/Semaphore.cs +++ b/src/mscorlib/src/System/Threading/Semaphore.cs @@ -20,17 +20,17 @@ namespace System.Threading { if (initialCount < 0) { - throw new ArgumentOutOfRangeException(nameof(initialCount), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(initialCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (maximumCount < 1) { - throw new ArgumentOutOfRangeException(nameof(maximumCount), SR.ArgumentOutOfRange_NeedPosNum); + throw new ArgumentOutOfRangeException(nameof(maximumCount), Environment.GetResourceString("ArgumentOutOfRange_NeedPosNum")); } if (initialCount > maximumCount) { - throw new ArgumentException(SR.Argument_SemaphoreInitialMaximum); + throw new ArgumentException(Environment.GetResourceString("Argument_SemaphoreInitialMaximum")); } SafeWaitHandle myHandle = CreateSemaphone(initialCount, maximumCount, name); @@ -41,7 +41,7 @@ namespace System.Threading if (null != name && 0 != name.Length && Win32Native.ERROR_INVALID_HANDLE == errorCode) throw new WaitHandleCannotBeOpenedException( - SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name)); + Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name)); __Error.WinIOError(); } @@ -52,17 +52,17 @@ namespace System.Threading { if (initialCount < 0) { - throw new ArgumentOutOfRangeException(nameof(initialCount), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(initialCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (maximumCount < 1) { - throw new ArgumentOutOfRangeException(nameof(maximumCount), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(maximumCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } if (initialCount > maximumCount) { - throw new ArgumentException(SR.Argument_SemaphoreInitialMaximum); + throw new ArgumentException(Environment.GetResourceString("Argument_SemaphoreInitialMaximum")); } SafeWaitHandle myHandle = CreateSemaphone(initialCount, maximumCount, name); @@ -72,7 +72,7 @@ namespace System.Threading { if (null != name && 0 != name.Length && Win32Native.ERROR_INVALID_HANDLE == errorCode) throw new WaitHandleCannotBeOpenedException( - SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name)); + Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name)); __Error.WinIOError(); } createdNew = errorCode != Win32Native.ERROR_ALREADY_EXISTS; @@ -89,10 +89,10 @@ namespace System.Threading if (name != null) { #if PLATFORM_UNIX - throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_NamedSynchronizationPrimitives")); #else if (name.Length > Path.MaxPath) - throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name)); #endif } @@ -111,7 +111,7 @@ namespace System.Threading case OpenExistingResult.NameNotFound: throw new WaitHandleCannotBeOpenedException(); case OpenExistingResult.NameInvalid: - throw new WaitHandleCannotBeOpenedException(SR.Format(SR.Threading_WaitHandleCannotBeOpenedException_InvalidHandle, name)); + throw new WaitHandleCannotBeOpenedException(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException_InvalidHandle", name)); case OpenExistingResult.PathNotFound: throw new IOException(Win32Native.GetMessage(Win32Native.ERROR_PATH_NOT_FOUND)); default: @@ -127,14 +127,14 @@ namespace System.Threading private static OpenExistingResult OpenExistingWorker(string name, out Semaphore result) { #if PLATFORM_UNIX - throw new PlatformNotSupportedException(SR.PlatformNotSupported_NamedSynchronizationPrimitives); + throw new PlatformNotSupportedException(Environment.GetResourceString("PlatformNotSupported_NamedSynchronizationPrimitives")); #else if (name == null) - throw new ArgumentNullException(nameof(name), SR.ArgumentNull_WithParamName); + throw new ArgumentNullException(nameof(name), Environment.GetResourceString("ArgumentNull_WithParamName")); if (name.Length == 0) - throw new ArgumentException(SR.Argument_EmptyName, nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyName"), nameof(name)); if (name.Length > Path.MaxPath) - throw new ArgumentException(SR.Format(SR.Argument_WaitHandleNameTooLong, Path.MaxPath), nameof(name)); + throw new ArgumentException(Environment.GetResourceString("Argument_WaitHandleNameTooLong", Path.MaxPath), nameof(name)); const int SYNCHRONIZE = 0x00100000; const int SEMAPHORE_MODIFY_STATE = 0x00000002; @@ -173,7 +173,7 @@ namespace System.Threading { if (releaseCount < 1) { - throw new ArgumentOutOfRangeException(nameof(releaseCount), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(releaseCount), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); } //If ReleaseSempahore returns false when the specified value would cause diff --git a/src/mscorlib/src/System/Threading/SemaphoreFullException.cs b/src/mscorlib/src/System/Threading/SemaphoreFullException.cs index bbcc226f95..ca01dba07e 100644 --- a/src/mscorlib/src/System/Threading/SemaphoreFullException.cs +++ b/src/mscorlib/src/System/Threading/SemaphoreFullException.cs @@ -12,7 +12,7 @@ namespace System.Threading [ComVisibleAttribute(false)] public class SemaphoreFullException : SystemException { - public SemaphoreFullException() : base(SR.Threading_SemaphoreFullException) + public SemaphoreFullException() : base(Environment.GetResourceString("Threading_SemaphoreFullException")) { } diff --git a/src/mscorlib/src/System/Threading/SemaphoreSlim.cs b/src/mscorlib/src/System/Threading/SemaphoreSlim.cs index 98bbc53004..7be7d2fb55 100644 --- a/src/mscorlib/src/System/Threading/SemaphoreSlim.cs +++ b/src/mscorlib/src/System/Threading/SemaphoreSlim.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -916,7 +916,7 @@ namespace System.Threading /// <param name="str">The key string</param> private static string GetResourceString(string str) { - return SR.GetResourceString(str); + return Environment.GetResourceString(str); } #endregion } diff --git a/src/mscorlib/src/System/Threading/SpinWait.cs b/src/mscorlib/src/System/Threading/SpinWait.cs index ae490e8f24..e5bd3c71c2 100644 --- a/src/mscorlib/src/System/Threading/SpinWait.cs +++ b/src/mscorlib/src/System/Threading/SpinWait.cs @@ -51,7 +51,7 @@ namespace System.Threading /// <remarks> /// <para> /// <see cref="SpinWait"/> encapsulates common spinning logic. On single-processor machines, yields are - /// always used instead of busy waits, and on computers with Intel� processors employing Hyper-Threading� + /// always used instead of busy waits, and on computers with Intel™ processors employing Hyper-Threading™ /// technology, it helps to prevent hardware thread starvation. SpinWait encapsulates a good mixture of /// spinning and true yielding. /// </para> @@ -214,7 +214,7 @@ namespace System.Threading if (totalMilliseconds < -1 || totalMilliseconds > Int32.MaxValue) { throw new System.ArgumentOutOfRangeException( - nameof(timeout), timeout, SR.SpinWait_SpinUntil_TimeoutWrong); + nameof(timeout), timeout, Environment.GetResourceString("SpinWait_SpinUntil_TimeoutWrong")); } // Call wait with the timeout milliseconds @@ -236,11 +236,11 @@ namespace System.Threading if (millisecondsTimeout < Timeout.Infinite) { throw new ArgumentOutOfRangeException( - nameof(millisecondsTimeout), millisecondsTimeout, SR.SpinWait_SpinUntil_TimeoutWrong); + nameof(millisecondsTimeout), millisecondsTimeout, Environment.GetResourceString("SpinWait_SpinUntil_TimeoutWrong")); } if (condition == null) { - throw new ArgumentNullException(nameof(condition), SR.SpinWait_SpinUntil_ArgumentNull); + throw new ArgumentNullException(nameof(condition), Environment.GetResourceString("SpinWait_SpinUntil_ArgumentNull")); } uint startTime = 0; if (millisecondsTimeout != 0 && millisecondsTimeout != Timeout.Infinite) diff --git a/src/mscorlib/src/System/Threading/SynchronizationLockException.cs b/src/mscorlib/src/System/Threading/SynchronizationLockException.cs index a3b8cb4267..1f7a284ff4 100644 --- a/src/mscorlib/src/System/Threading/SynchronizationLockException.cs +++ b/src/mscorlib/src/System/Threading/SynchronizationLockException.cs @@ -23,7 +23,7 @@ namespace System.Threading public class SynchronizationLockException : SystemException { public SynchronizationLockException() - : base(SR.Arg_SynchronizationLockException) + : base(Environment.GetResourceString("Arg_SynchronizationLockException")) { SetErrorCode(__HResults.COR_E_SYNCHRONIZATIONLOCK); } diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskCanceledException.cs b/src/mscorlib/src/System/Threading/Tasks/TaskCanceledException.cs index d7690d4c7c..890a9c8b9b 100644 --- a/src/mscorlib/src/System/Threading/Tasks/TaskCanceledException.cs +++ b/src/mscorlib/src/System/Threading/Tasks/TaskCanceledException.cs @@ -28,7 +28,7 @@ namespace System.Threading.Tasks /// <summary> /// Initializes a new instance of the <see cref="T:System.Threading.Tasks.TaskCanceledException"/> class. /// </summary> - public TaskCanceledException() : base(SR.TaskCanceledException_ctor_DefaultMessage) + public TaskCanceledException() : base(Environment.GetResourceString("TaskCanceledException_ctor_DefaultMessage")) { } @@ -58,7 +58,7 @@ namespace System.Threading.Tasks /// </summary> /// <param name="task">A task that has been canceled.</param> public TaskCanceledException(Task task) : - base(SR.TaskCanceledException_ctor_DefaultMessage, task != null ? task.CancellationToken : new CancellationToken()) + base(Environment.GetResourceString("TaskCanceledException_ctor_DefaultMessage"), task != null ? task.CancellationToken : new CancellationToken()) { m_canceledTask = task; } diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskExceptionHolder.cs b/src/mscorlib/src/System/Threading/Tasks/TaskExceptionHolder.cs index 1385d907e0..2ff127d7b7 100644 --- a/src/mscorlib/src/System/Threading/Tasks/TaskExceptionHolder.cs +++ b/src/mscorlib/src/System/Threading/Tasks/TaskExceptionHolder.cs @@ -127,7 +127,7 @@ namespace System.Threading.Tasks // First, publish the unobserved exception and allow users to observe it AggregateException exceptionToThrow = new AggregateException( - SR.TaskExceptionHolder_UnhandledException, + Environment.GetResourceString("TaskExceptionHolder_UnhandledException"), m_faultExceptions); UnobservedTaskExceptionEventArgs ueea = new UnobservedTaskExceptionEventArgs(exceptionToThrow); TaskScheduler.PublishUnobservedTaskException(m_task, ueea); @@ -276,7 +276,7 @@ namespace System.Threading.Tasks // Anything else is a programming error else { - throw new ArgumentException(SR.TaskExceptionHolder_UnknownExceptionType, nameof(exceptionObject)); + throw new ArgumentException(Environment.GetResourceString("TaskExceptionHolder_UnknownExceptionType"), nameof(exceptionObject)); } } } diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs b/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs index 9f6f5057d4..fd6c7216bb 100644 --- a/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs +++ b/src/mscorlib/src/System/Threading/Tasks/TaskFactory.cs @@ -1518,9 +1518,9 @@ namespace System.Threading.Tasks { // Options detected here cause exceptions in FromAsync methods that take beginMethod as a parameter if ((creationOptions & TaskCreationOptions.LongRunning) != 0) - throw new ArgumentOutOfRangeException(nameof(creationOptions), SR.Task_FromAsync_LongRunning); + throw new ArgumentOutOfRangeException(nameof(creationOptions), Environment.GetResourceString("Task_FromAsync_LongRunning")); if ((creationOptions & TaskCreationOptions.PreferFairness) != 0) - throw new ArgumentOutOfRangeException(nameof(creationOptions), SR.Task_FromAsync_PreferFairness); + throw new ArgumentOutOfRangeException(nameof(creationOptions), Environment.GetResourceString("Task_FromAsync_PreferFairness")); } // Check for general validity of options @@ -2382,7 +2382,7 @@ namespace System.Threading.Tasks for (int i = 0; i < numTasks; i++) { var task = tasks[i]; - if (task == null) throw new ArgumentException(SR.Task_MultiTaskContinuation_NullTask, nameof(tasks)); + if (task == null) throw new ArgumentException(Environment.GetResourceString("Task_MultiTaskContinuation_NullTask"), nameof(tasks)); if (checkArgsOnly) continue; @@ -3008,7 +3008,7 @@ namespace System.Threading.Tasks if (tasks == null) throw new ArgumentNullException(nameof(tasks)); if (tasks.Length == 0) - throw new ArgumentException(SR.Task_MultiTaskContinuation_EmptyTaskList, nameof(tasks)); + throw new ArgumentException(Environment.GetResourceString("Task_MultiTaskContinuation_EmptyTaskList"), nameof(tasks)); Contract.EndContractBlock(); Task[] tasksCopy = new Task[tasks.Length]; @@ -3017,7 +3017,7 @@ namespace System.Threading.Tasks tasksCopy[i] = tasks[i]; if (tasksCopy[i] == null) - throw new ArgumentException(SR.Task_MultiTaskContinuation_NullTask, nameof(tasks)); + throw new ArgumentException(Environment.GetResourceString("Task_MultiTaskContinuation_NullTask"), nameof(tasks)); } return tasksCopy; @@ -3028,7 +3028,7 @@ namespace System.Threading.Tasks if (tasks == null) throw new ArgumentNullException(nameof(tasks)); if (tasks.Length == 0) - throw new ArgumentException(SR.Task_MultiTaskContinuation_EmptyTaskList, nameof(tasks)); + throw new ArgumentException(Environment.GetResourceString("Task_MultiTaskContinuation_EmptyTaskList"), nameof(tasks)); Contract.EndContractBlock(); Task<TResult>[] tasksCopy = new Task<TResult>[tasks.Length]; @@ -3037,7 +3037,7 @@ namespace System.Threading.Tasks tasksCopy[i] = tasks[i]; if (tasksCopy[i] == null) - throw new ArgumentException(SR.Task_MultiTaskContinuation_NullTask, nameof(tasks)); + throw new ArgumentException(Environment.GetResourceString("Task_MultiTaskContinuation_NullTask"), nameof(tasks)); } return tasksCopy; @@ -3056,7 +3056,7 @@ namespace System.Threading.Tasks const TaskContinuationOptions illegalMask = TaskContinuationOptions.ExecuteSynchronously | TaskContinuationOptions.LongRunning; if ((continuationOptions & illegalMask) == illegalMask) { - throw new ArgumentOutOfRangeException(nameof(continuationOptions), SR.Task_ContinueWith_ESandLR); + throw new ArgumentOutOfRangeException(nameof(continuationOptions), Environment.GetResourceString("Task_ContinueWith_ESandLR")); } // Check that no nonsensical options are specified. @@ -3075,7 +3075,7 @@ namespace System.Threading.Tasks // Check that no "fire" options are specified. if ((continuationOptions & NotOnAny) != 0) - throw new ArgumentOutOfRangeException(nameof(continuationOptions), SR.Task_MultiTaskContinuation_FireOptions); + throw new ArgumentOutOfRangeException(nameof(continuationOptions), Environment.GetResourceString("Task_MultiTaskContinuation_FireOptions")); Contract.EndContractBlock(); } } diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs b/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs index 45d398f0eb..94d3f1189e 100644 --- a/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs +++ b/src/mscorlib/src/System/Threading/Tasks/TaskScheduler.cs @@ -218,7 +218,7 @@ namespace System.Threading.Tasks // Otherwise the scheduler is buggy if (bInlined && !(task.IsDelegateInvoked || task.IsCanceled)) { - throw new InvalidOperationException(SR.TaskScheduler_InconsistentStateAfterTryExecuteTaskInline); + throw new InvalidOperationException(Environment.GetResourceString("TaskScheduler_InconsistentStateAfterTryExecuteTaskInline")); } return bInlined; @@ -443,7 +443,7 @@ namespace System.Threading.Tasks { if (task.ExecutingTaskScheduler != this) { - throw new InvalidOperationException(SR.TaskScheduler_ExecuteTask_WrongTaskScheduler); + throw new InvalidOperationException(Environment.GetResourceString("TaskScheduler_ExecuteTask_WrongTaskScheduler")); } return task.ExecuteEntry(); @@ -594,13 +594,13 @@ namespace System.Threading.Tasks m_taskScheduler = scheduler; } - // returns the scheduler�s Id + // returns the scheduler’s Id public Int32 Id { get { return m_taskScheduler.Id; } } - // returns the scheduler�s GetScheduledTasks + // returns the scheduler’s GetScheduledTasks public IEnumerable<Task> ScheduledTasks { get { return m_taskScheduler.GetScheduledTasks(); } @@ -631,7 +631,7 @@ namespace System.Threading.Tasks // make sure we have a synccontext to work with if (synContext == null) { - throw new InvalidOperationException(SR.TaskScheduler_FromCurrentSynchronizationContext_NoCurrent); + throw new InvalidOperationException(Environment.GetResourceString("TaskScheduler_FromCurrentSynchronizationContext_NoCurrent")); } m_synchronizationContext = synContext; diff --git a/src/mscorlib/src/System/Threading/Tasks/TaskSchedulerException.cs b/src/mscorlib/src/System/Threading/Tasks/TaskSchedulerException.cs index 148b6300ef..3726a5e18e 100644 --- a/src/mscorlib/src/System/Threading/Tasks/TaskSchedulerException.cs +++ b/src/mscorlib/src/System/Threading/Tasks/TaskSchedulerException.cs @@ -26,7 +26,7 @@ namespace System.Threading.Tasks /// <summary> /// Initializes a new instance of the <see cref="T:System.Threading.Tasks.TaskSchedulerException"/> class. /// </summary> - public TaskSchedulerException() : base(SR.TaskSchedulerException_ctor_DefaultMessage) // + public TaskSchedulerException() : base(Environment.GetResourceString("TaskSchedulerException_ctor_DefaultMessage")) // { } @@ -46,7 +46,7 @@ namespace System.Threading.Tasks /// </summary> /// <param name="innerException">The exception that is the cause of the current exception.</param> public TaskSchedulerException(Exception innerException) - : base(SR.TaskSchedulerException_ctor_DefaultMessage, innerException) + : base(Environment.GetResourceString("TaskSchedulerException_ctor_DefaultMessage"), innerException) { } diff --git a/src/mscorlib/src/System/Threading/Tasks/future.cs b/src/mscorlib/src/System/Threading/Tasks/future.cs index 26c2388e6b..147456af5f 100644 --- a/src/mscorlib/src/System/Threading/Tasks/future.cs +++ b/src/mscorlib/src/System/Threading/Tasks/future.cs @@ -374,7 +374,7 @@ namespace System.Threading.Tasks { get { - return IsRanToCompletion ? "" + m_result : SR.TaskT_DebuggerNoResult; + return IsRanToCompletion ? "" + m_result : Environment.GetResourceString("TaskT_DebuggerNoResult"); } } diff --git a/src/mscorlib/src/System/Threading/Thread.cs b/src/mscorlib/src/System/Threading/Thread.cs index 6908b17fe7..d57389fdea 100644 --- a/src/mscorlib/src/System/Threading/Thread.cs +++ b/src/mscorlib/src/System/Threading/Thread.cs @@ -172,7 +172,7 @@ namespace System.Threading throw new ArgumentNullException(nameof(start)); } if (0 > maxStackSize) - throw new ArgumentOutOfRangeException(nameof(maxStackSize), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(maxStackSize), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); SetStartHelper((Delegate)start, maxStackSize); } @@ -193,7 +193,7 @@ namespace System.Threading throw new ArgumentNullException(nameof(start)); } if (0 > maxStackSize) - throw new ArgumentOutOfRangeException(nameof(maxStackSize), SR.ArgumentOutOfRange_NeedNonNegNum); + throw new ArgumentOutOfRangeException(nameof(maxStackSize), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegNum")); Contract.EndContractBlock(); SetStartHelper((Delegate)start, maxStackSize); } @@ -218,7 +218,7 @@ namespace System.Threading // There are ways how to create an unitialized objects through remoting, etc. Avoid AVing in the EE by throwing a nice // exception here. if (thread.IsNull()) - throw new ArgumentException(null, SR.Argument_InvalidHandle); + throw new ArgumentException(null, Environment.GetResourceString("Argument_InvalidHandle")); return new ThreadHandle(thread); } @@ -248,7 +248,7 @@ namespace System.Threading //We expect the thread to be setup with a ParameterizedThreadStart // if this constructor is called. //If we got here then that wasn't the case - throw new InvalidOperationException(SR.InvalidOperation_ThreadWrongThreadStart); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_ThreadWrongThreadStart")); } m_ThreadStartArg = parameter; StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; @@ -322,7 +322,7 @@ namespace System.Threading { long tm = (long)timeout.TotalMilliseconds; if (tm < -1 || tm > (long)Int32.MaxValue) - throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); Sleep((int)tm); } @@ -538,7 +538,7 @@ namespace System.Threading lock (this) { if (m_Name != null) - throw new InvalidOperationException(SR.InvalidOperation_WriteOnce); + throw new InvalidOperationException(Environment.GetResourceString("InvalidOperation_WriteOnce")); m_Name = value; InformThreadNameChange(GetNativeHandle(), value, (value != null) ? value.Length : 0); diff --git a/src/mscorlib/src/System/Threading/ThreadLocal.cs b/src/mscorlib/src/System/Threading/ThreadLocal.cs index 64b8a60196..67407e7704 100644 --- a/src/mscorlib/src/System/Threading/ThreadLocal.cs +++ b/src/mscorlib/src/System/Threading/ThreadLocal.cs @@ -323,7 +323,7 @@ namespace System.Threading int id = ~m_idComplement; if (id < 0) { - throw new ObjectDisposedException(SR.ThreadLocal_Disposed); + throw new ObjectDisposedException(Environment.GetResourceString("ThreadLocal_Disposed")); } Debugger.NotifyOfCrossThreadDependency(); @@ -340,7 +340,7 @@ namespace System.Threading if (IsValueCreated) { - throw new InvalidOperationException(SR.ThreadLocal_Value_RecursiveCallsToValue); + throw new InvalidOperationException(Environment.GetResourceString("ThreadLocal_Value_RecursiveCallsToValue")); } } @@ -356,7 +356,7 @@ namespace System.Threading // If the object has been disposed, id will be -1. if (id < 0) { - throw new ObjectDisposedException(SR.ThreadLocal_Disposed); + throw new ObjectDisposedException(Environment.GetResourceString("ThreadLocal_Disposed")); } // If a slot array has not been created on this thread yet, create it. @@ -394,7 +394,7 @@ namespace System.Threading if (!m_initialized) { - throw new ObjectDisposedException(SR.ThreadLocal_Disposed); + throw new ObjectDisposedException(Environment.GetResourceString("ThreadLocal_Disposed")); } slot.Value = value; @@ -416,7 +416,7 @@ namespace System.Threading // Dispose also executes under a lock. if (!m_initialized) { - throw new ObjectDisposedException(SR.ThreadLocal_Disposed); + throw new ObjectDisposedException(Environment.GetResourceString("ThreadLocal_Disposed")); } LinkedSlot firstRealNode = m_linkedSlot.Next; @@ -454,11 +454,11 @@ namespace System.Threading { if (!m_trackAllValues) { - throw new InvalidOperationException(SR.ThreadLocal_ValuesNotAvailable); + throw new InvalidOperationException(Environment.GetResourceString("ThreadLocal_ValuesNotAvailable")); } var list = GetValuesAsList(); // returns null if disposed - if (list == null) throw new ObjectDisposedException(SR.ThreadLocal_Disposed); + if (list == null) throw new ObjectDisposedException(Environment.GetResourceString("ThreadLocal_Disposed")); return list; } } @@ -511,7 +511,7 @@ namespace System.Threading int id = ~m_idComplement; if (id < 0) { - throw new ObjectDisposedException(SR.ThreadLocal_Disposed); + throw new ObjectDisposedException(Environment.GetResourceString("ThreadLocal_Disposed")); } LinkedSlotVolatile[] slotArray = ts_slotArray; diff --git a/src/mscorlib/src/System/Threading/ThreadPool.cs b/src/mscorlib/src/System/Threading/ThreadPool.cs index 0084050c43..7dbb957055 100644 --- a/src/mscorlib/src/System/Threading/ThreadPool.cs +++ b/src/mscorlib/src/System/Threading/ThreadPool.cs @@ -805,8 +805,8 @@ namespace System.Threading // This will result in a "leak" of sorts (since the handle will not be cleaned up) // but the process is exiting anyway. // - // During AD-unload, we don�t finalize live objects until all threads have been - // aborted out of the AD. Since these locked regions are CERs, we won�t abort them + // During AD-unload, we don’t finalize live objects until all threads have been + // aborted out of the AD. Since these locked regions are CERs, we won’t abort them // while the lock is held. So there should be no leak on AD-unload. // if (Interlocked.CompareExchange(ref m_lock, 1, 0) == 0) @@ -1184,7 +1184,7 @@ namespace System.Threading ) { if (millisecondsTimeOutInterval < -1) - throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); Contract.EndContractBlock(); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, true); @@ -1200,7 +1200,7 @@ namespace System.Threading ) { if (millisecondsTimeOutInterval < -1) - throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); Contract.EndContractBlock(); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, false); @@ -1216,7 +1216,7 @@ namespace System.Threading ) { if (millisecondsTimeOutInterval < -1) - throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); Contract.EndContractBlock(); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, true); @@ -1232,7 +1232,7 @@ namespace System.Threading ) { if (millisecondsTimeOutInterval < -1) - throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(millisecondsTimeOutInterval), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); Contract.EndContractBlock(); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)millisecondsTimeOutInterval, executeOnlyOnce, ref stackMark, false); @@ -1249,9 +1249,9 @@ namespace System.Threading { long tm = (long)timeout.TotalMilliseconds; if (tm < -1) - throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); if (tm > (long)Int32.MaxValue) - throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_LessEqualToIntegerMaxVal); + throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_LessEqualToIntegerMaxVal")); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)tm, executeOnlyOnce, ref stackMark, true); } @@ -1267,9 +1267,9 @@ namespace System.Threading { long tm = (long)timeout.TotalMilliseconds; if (tm < -1) - throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); if (tm > (long)Int32.MaxValue) - throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_LessEqualToIntegerMaxVal); + throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_LessEqualToIntegerMaxVal")); StackCrawlMark stackMark = StackCrawlMark.LookForMyCaller; return RegisterWaitForSingleObject(waitObject, callBack, state, (UInt32)tm, executeOnlyOnce, ref stackMark, false); } diff --git a/src/mscorlib/src/System/Threading/ThreadStartException.cs b/src/mscorlib/src/System/Threading/ThreadStartException.cs index 27a0d57101..5b5ee82fc7 100644 --- a/src/mscorlib/src/System/Threading/ThreadStartException.cs +++ b/src/mscorlib/src/System/Threading/ThreadStartException.cs @@ -14,13 +14,13 @@ namespace System.Threading public sealed class ThreadStartException : SystemException { private ThreadStartException() - : base(SR.Arg_ThreadStartException) + : base(Environment.GetResourceString("Arg_ThreadStartException")) { SetErrorCode(__HResults.COR_E_THREADSTART); } private ThreadStartException(Exception reason) - : base(SR.Arg_ThreadStartException, reason) + : base(Environment.GetResourceString("Arg_ThreadStartException"), reason) { SetErrorCode(__HResults.COR_E_THREADSTART); } diff --git a/src/mscorlib/src/System/Threading/ThreadStateException.cs b/src/mscorlib/src/System/Threading/ThreadStateException.cs index 9e1cc1d49b..0df4416a93 100644 --- a/src/mscorlib/src/System/Threading/ThreadStateException.cs +++ b/src/mscorlib/src/System/Threading/ThreadStateException.cs @@ -22,7 +22,7 @@ namespace System.Threading public class ThreadStateException : SystemException { public ThreadStateException() - : base(SR.Arg_ThreadStateException) + : base(Environment.GetResourceString("Arg_ThreadStateException")) { SetErrorCode(__HResults.COR_E_THREADSTATE); } diff --git a/src/mscorlib/src/System/Threading/Timer.cs b/src/mscorlib/src/System/Threading/Timer.cs index 960f815d64..666fe70b32 100644 --- a/src/mscorlib/src/System/Threading/Timer.cs +++ b/src/mscorlib/src/System/Threading/Timer.cs @@ -455,7 +455,7 @@ namespace System.Threading lock (TimerQueue.Instance) { if (m_canceled) - throw new ObjectDisposedException(null, SR.ObjectDisposed_Generic); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_Generic")); // prevent ThreadAbort while updating state try { } @@ -666,9 +666,9 @@ namespace System.Threading int period) { if (dueTime < -1) - throw new ArgumentOutOfRangeException(nameof(dueTime), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(dueTime), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); if (period < -1) - throw new ArgumentOutOfRangeException(nameof(period), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(period), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); Contract.EndContractBlock(); TimerSetup(callback, state, (UInt32)dueTime, (UInt32)period); @@ -681,15 +681,15 @@ namespace System.Threading { long dueTm = (long)dueTime.TotalMilliseconds; if (dueTm < -1) - throw new ArgumentOutOfRangeException(nameof(dueTm), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(dueTm), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); if (dueTm > MAX_SUPPORTED_TIMEOUT) - throw new ArgumentOutOfRangeException(nameof(dueTm), SR.ArgumentOutOfRange_TimeoutTooLarge); + throw new ArgumentOutOfRangeException(nameof(dueTm), Environment.GetResourceString("ArgumentOutOfRange_TimeoutTooLarge")); long periodTm = (long)period.TotalMilliseconds; if (periodTm < -1) - throw new ArgumentOutOfRangeException(nameof(periodTm), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(periodTm), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); if (periodTm > MAX_SUPPORTED_TIMEOUT) - throw new ArgumentOutOfRangeException(nameof(periodTm), SR.ArgumentOutOfRange_PeriodTooLarge); + throw new ArgumentOutOfRangeException(nameof(periodTm), Environment.GetResourceString("ArgumentOutOfRange_PeriodTooLarge")); TimerSetup(callback, state, (UInt32)dueTm, (UInt32)periodTm); } @@ -709,13 +709,13 @@ namespace System.Threading long period) { if (dueTime < -1) - throw new ArgumentOutOfRangeException(nameof(dueTime), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(dueTime), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); if (period < -1) - throw new ArgumentOutOfRangeException(nameof(period), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(period), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); if (dueTime > MAX_SUPPORTED_TIMEOUT) - throw new ArgumentOutOfRangeException(nameof(dueTime), SR.ArgumentOutOfRange_TimeoutTooLarge); + throw new ArgumentOutOfRangeException(nameof(dueTime), Environment.GetResourceString("ArgumentOutOfRange_TimeoutTooLarge")); if (period > MAX_SUPPORTED_TIMEOUT) - throw new ArgumentOutOfRangeException(nameof(period), SR.ArgumentOutOfRange_PeriodTooLarge); + throw new ArgumentOutOfRangeException(nameof(period), Environment.GetResourceString("ArgumentOutOfRange_PeriodTooLarge")); Contract.EndContractBlock(); TimerSetup(callback, state, (UInt32)dueTime, (UInt32)period); } @@ -745,9 +745,9 @@ namespace System.Threading public bool Change(int dueTime, int period) { if (dueTime < -1) - throw new ArgumentOutOfRangeException(nameof(dueTime), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(dueTime), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); if (period < -1) - throw new ArgumentOutOfRangeException(nameof(period), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(period), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); Contract.EndContractBlock(); return m_timer.m_timer.Change((UInt32)dueTime, (UInt32)period); @@ -767,13 +767,13 @@ namespace System.Threading public bool Change(long dueTime, long period) { if (dueTime < -1) - throw new ArgumentOutOfRangeException(nameof(dueTime), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(dueTime), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); if (period < -1) - throw new ArgumentOutOfRangeException(nameof(period), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(period), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); if (dueTime > MAX_SUPPORTED_TIMEOUT) - throw new ArgumentOutOfRangeException(nameof(dueTime), SR.ArgumentOutOfRange_TimeoutTooLarge); + throw new ArgumentOutOfRangeException(nameof(dueTime), Environment.GetResourceString("ArgumentOutOfRange_TimeoutTooLarge")); if (period > MAX_SUPPORTED_TIMEOUT) - throw new ArgumentOutOfRangeException(nameof(period), SR.ArgumentOutOfRange_PeriodTooLarge); + throw new ArgumentOutOfRangeException(nameof(period), Environment.GetResourceString("ArgumentOutOfRange_PeriodTooLarge")); Contract.EndContractBlock(); return m_timer.m_timer.Change((UInt32)dueTime, (UInt32)period); diff --git a/src/mscorlib/src/System/Threading/WaitHandle.cs b/src/mscorlib/src/System/Threading/WaitHandle.cs index 50b277faca..7ffd4b8d5a 100644 --- a/src/mscorlib/src/System/Threading/WaitHandle.cs +++ b/src/mscorlib/src/System/Threading/WaitHandle.cs @@ -153,7 +153,7 @@ namespace System.Threading { if (millisecondsTimeout < -1) { - throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); } Contract.EndContractBlock(); return WaitOne((long)millisecondsTimeout, exitContext); @@ -164,7 +164,7 @@ namespace System.Threading long tm = (long)timeout.TotalMilliseconds; if (-1 > tm || (long)Int32.MaxValue < tm) { - throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); } return WaitOne(tm, exitContext); } @@ -195,7 +195,7 @@ namespace System.Threading { if (waitableSafeHandle == null) { - throw new ObjectDisposedException(null, SR.ObjectDisposed_Generic); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_Generic")); } Contract.EndContractBlock(); int ret = WaitOneNative(waitableSafeHandle, (uint)millisecondsTimeout, hasThreadAffinity, exitContext); @@ -216,7 +216,7 @@ namespace System.Threading // This is required to support the Wait which FAS needs (otherwise recursive dependency comes in) if (safeWaitHandle == null) { - throw new ObjectDisposedException(null, SR.ObjectDisposed_Generic); + throw new ObjectDisposedException(null, Environment.GetResourceString("ObjectDisposed_Generic")); } Contract.EndContractBlock(); @@ -248,7 +248,7 @@ namespace System.Threading { if (waitHandles == null) { - throw new ArgumentNullException(nameof(waitHandles), SR.ArgumentNull_Waithandles); + throw new ArgumentNullException(nameof(waitHandles), Environment.GetResourceString("ArgumentNull_Waithandles")); } if (waitHandles.Length == 0) { @@ -261,15 +261,15 @@ namespace System.Threading // in CoreCLR, and ArgumentNullException in the desktop CLR. This is ugly, but so is breaking // user code. // - throw new ArgumentException(SR.Argument_EmptyWaithandleArray); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyWaithandleArray")); } if (waitHandles.Length > MAX_WAITHANDLES) { - throw new NotSupportedException(SR.NotSupported_MaxWaitHandles); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_MaxWaitHandles")); } if (-1 > millisecondsTimeout) { - throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); } Contract.EndContractBlock(); WaitHandle[] internalWaitHandles = new WaitHandle[waitHandles.Length]; @@ -278,7 +278,7 @@ namespace System.Threading WaitHandle waitHandle = waitHandles[i]; if (waitHandle == null) - throw new ArgumentNullException("waitHandles[" + i + "]", SR.ArgumentNull_ArrayElement); + throw new ArgumentNullException("waitHandles[" + i + "]", Environment.GetResourceString("ArgumentNull_ArrayElement")); internalWaitHandles[i] = waitHandle; } @@ -312,7 +312,7 @@ namespace System.Threading long tm = (long)timeout.TotalMilliseconds; if (-1 > tm || (long)Int32.MaxValue < tm) { - throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); } return WaitAll(waitHandles, (int)tm, exitContext); } @@ -350,19 +350,19 @@ namespace System.Threading { if (waitHandles == null) { - throw new ArgumentNullException(nameof(waitHandles), SR.ArgumentNull_Waithandles); + throw new ArgumentNullException(nameof(waitHandles), Environment.GetResourceString("ArgumentNull_Waithandles")); } if (waitHandles.Length == 0) { - throw new ArgumentException(SR.Argument_EmptyWaithandleArray); + throw new ArgumentException(Environment.GetResourceString("Argument_EmptyWaithandleArray")); } if (MAX_WAITHANDLES < waitHandles.Length) { - throw new NotSupportedException(SR.NotSupported_MaxWaitHandles); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_MaxWaitHandles")); } if (-1 > millisecondsTimeout) { - throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); } Contract.EndContractBlock(); WaitHandle[] internalWaitHandles = new WaitHandle[waitHandles.Length]; @@ -371,7 +371,7 @@ namespace System.Threading WaitHandle waitHandle = waitHandles[i]; if (waitHandle == null) - throw new ArgumentNullException("waitHandles[" + i + "]", SR.ArgumentNull_ArrayElement); + throw new ArgumentNullException("waitHandles[" + i + "]", Environment.GetResourceString("ArgumentNull_ArrayElement")); internalWaitHandles[i] = waitHandle; } @@ -409,7 +409,7 @@ namespace System.Threading long tm = (long)timeout.TotalMilliseconds; if (-1 > tm || (long)Int32.MaxValue < tm) { - throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); } return WaitAny(waitHandles, (int)tm, exitContext); } @@ -466,7 +466,7 @@ namespace System.Threading long tm = (long)timeout.TotalMilliseconds; if (-1 > tm || (long)Int32.MaxValue < tm) { - throw new ArgumentOutOfRangeException(nameof(timeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(timeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); } return SignalAndWait(toSignal, toWaitOn, (int)tm, exitContext); #endif @@ -492,7 +492,7 @@ namespace System.Threading } if (-1 > millisecondsTimeout) { - throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), SR.ArgumentOutOfRange_NeedNonNegOrNegative1); + throw new ArgumentOutOfRangeException(nameof(millisecondsTimeout), Environment.GetResourceString("ArgumentOutOfRange_NeedNonNegOrNegative1")); } Contract.EndContractBlock(); @@ -507,7 +507,7 @@ namespace System.Threading if (ERROR_TOO_MANY_POSTS == ret) { - throw new InvalidOperationException(SR.Threading_WaitHandleTooManyPosts); + throw new InvalidOperationException(Environment.GetResourceString("Threading.WaitHandleTooManyPosts")); } //Object was signaled diff --git a/src/mscorlib/src/System/Threading/WaitHandleCannotBeOpenedException.cs b/src/mscorlib/src/System/Threading/WaitHandleCannotBeOpenedException.cs index 7bc6e289e3..acdb19cfac 100644 --- a/src/mscorlib/src/System/Threading/WaitHandleCannotBeOpenedException.cs +++ b/src/mscorlib/src/System/Threading/WaitHandleCannotBeOpenedException.cs @@ -15,7 +15,7 @@ namespace System.Threading public class WaitHandleCannotBeOpenedException : ApplicationException { - public WaitHandleCannotBeOpenedException() : base(SR.Threading_WaitHandleCannotBeOpenedException) + public WaitHandleCannotBeOpenedException() : base(Environment.GetResourceString("Threading.WaitHandleCannotBeOpenedException")) { SetErrorCode(__HResults.COR_E_WAITHANDLECANNOTBEOPENED); } diff --git a/src/mscorlib/src/System/ThrowHelper.cs b/src/mscorlib/src/System/ThrowHelper.cs index b6af3a8e9a..978e47a80f 100644 --- a/src/mscorlib/src/System/ThrowHelper.cs +++ b/src/mscorlib/src/System/ThrowHelper.cs @@ -9,7 +9,7 @@ // The old way to throw an exception generates quite a lot IL code and assembly code. // Following is an example: // C# source -// throw new ArgumentNullException(nameof(key), SR.ArgumentNull_Key); +// throw new ArgumentNullException(nameof(key), Environment.GetResourceString("ArgumentNull_Key")); // IL code: // IL_0003: ldstr "key" // IL_0008: ldstr "ArgumentNull_Key" @@ -52,7 +52,7 @@ namespace System internal static void ThrowInvalidTypeWithPointersNotSupported(Type targetType) { - throw new ArgumentException(SR.Format(SR.Argument_InvalidTypeWithPointersNotSupported, targetType)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidTypeWithPointersNotSupported", targetType)); } internal static void ThrowIndexOutOfRangeException() @@ -67,17 +67,17 @@ namespace System internal static void ThrowArgumentException_DestinationTooShort() { - throw new ArgumentException(SR.Argument_DestinationTooShort); + throw new ArgumentException(Environment.GetResourceString("Argument_DestinationTooShort")); } internal static void ThrowNotSupportedException_CannotCallEqualsOnSpan() { - throw new NotSupportedException(SR.NotSupported_CannotCallEqualsOnSpan); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_CannotCallEqualsOnSpan")); } internal static void ThrowNotSupportedException_CannotCallGetHashCodeOnSpan() { - throw new NotSupportedException(SR.NotSupported_CannotCallGetHashCodeOnSpan); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_CannotCallGetHashCodeOnSpan")); } internal static void ThrowArgumentOutOfRange_IndexException() @@ -122,7 +122,7 @@ namespace System private static ArgumentException GetAddingDuplicateWithKeyArgumentException(object key) { - return new ArgumentException(SR.Format(SR.Argument_AddingDuplicateWithKey, key)); + return new ArgumentException(Environment.GetResourceString("Argument_AddingDuplicateWithKey", key)); } internal static void ThrowAddingDuplicateWithKeyArgumentException(object key) @@ -290,12 +290,12 @@ namespace System private static ArgumentException GetWrongKeyTypeArgumentException(object key, Type targetType) { - return new ArgumentException(SR.Format(SR.Arg_WrongType, key, targetType), nameof(key)); + return new ArgumentException(Environment.GetResourceString("Arg_WrongType", key, targetType), nameof(key)); } private static ArgumentException GetWrongValueTypeArgumentException(object value, Type targetType) { - return new ArgumentException(SR.Format(SR.Arg_WrongType, value, targetType), nameof(value)); + return new ArgumentException(Environment.GetResourceString("Arg_WrongType", value, targetType), nameof(value)); } internal static ArgumentOutOfRangeException GetArgumentOutOfRangeException(ExceptionArgument argument, ExceptionResource resource) @@ -341,7 +341,7 @@ namespace System Debug.Assert(Enum.IsDefined(typeof(ExceptionResource), resource), "The enum value is not defined, please check the ExceptionResource Enum."); - return SR.GetResourceString(resource.ToString()); + return Environment.GetResourceString(resource.ToString()); } } diff --git a/src/mscorlib/src/System/TimeSpan.cs b/src/mscorlib/src/System/TimeSpan.cs index 35be47f25a..cd7b454694 100644 --- a/src/mscorlib/src/System/TimeSpan.cs +++ b/src/mscorlib/src/System/TimeSpan.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -93,7 +93,7 @@ namespace System { Int64 totalMilliSeconds = ((Int64)days * 3600 * 24 + (Int64)hours * 3600 + (Int64)minutes * 60 + seconds) * 1000 + milliseconds; if (totalMilliSeconds > MaxMilliSeconds || totalMilliSeconds < MinMilliSeconds) - throw new ArgumentOutOfRangeException(null, SR.Overflow_TimeSpanTooLong); + throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("Overflow_TimeSpanTooLong")); _ticks = (long)totalMilliSeconds * TicksPerMillisecond; } @@ -169,7 +169,7 @@ namespace System // sign was opposite. // >> 63 gives the sign bit (either 64 1's or 64 0's). if ((_ticks >> 63 == ts._ticks >> 63) && (_ticks >> 63 != result >> 63)) - throw new OverflowException(SR.Overflow_TimeSpanTooLong); + throw new OverflowException(Environment.GetResourceString("Overflow_TimeSpanTooLong")); return new TimeSpan(result); } @@ -189,7 +189,7 @@ namespace System { if (value == null) return 1; if (!(value is TimeSpan)) - throw new ArgumentException(SR.Arg_MustBeTimeSpan); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeTimeSpan")); long t = ((TimeSpan)value)._ticks; if (_ticks > t) return 1; if (_ticks < t) return -1; @@ -212,7 +212,7 @@ namespace System public TimeSpan Duration() { if (Ticks == TimeSpan.MinValue.Ticks) - throw new OverflowException(SR.Overflow_Duration); + throw new OverflowException(Environment.GetResourceString("Overflow_Duration")); Contract.EndContractBlock(); return new TimeSpan(_ticks >= 0 ? _ticks : -_ticks); } @@ -249,12 +249,12 @@ namespace System private static TimeSpan Interval(double value, int scale) { if (Double.IsNaN(value)) - throw new ArgumentException(SR.Arg_CannotBeNaN); + throw new ArgumentException(Environment.GetResourceString("Arg_CannotBeNaN")); Contract.EndContractBlock(); double tmp = value * scale; double millis = tmp + (value >= 0 ? 0.5 : -0.5); if ((millis > Int64.MaxValue / TicksPerMillisecond) || (millis < Int64.MinValue / TicksPerMillisecond)) - throw new OverflowException(SR.Overflow_TimeSpanTooLong); + throw new OverflowException(Environment.GetResourceString("Overflow_TimeSpanTooLong")); return new TimeSpan((long)millis * TicksPerMillisecond); } @@ -271,7 +271,7 @@ namespace System public TimeSpan Negate() { if (Ticks == TimeSpan.MinValue.Ticks) - throw new OverflowException(SR.Overflow_NegateTwosCompNum); + throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum")); Contract.EndContractBlock(); return new TimeSpan(-_ticks); } @@ -288,7 +288,7 @@ namespace System // sign was opposite from the first argument's sign. // >> 63 gives the sign bit (either 64 1's or 64 0's). if ((_ticks >> 63 != ts._ticks >> 63) && (_ticks >> 63 != result >> 63)) - throw new OverflowException(SR.Overflow_TimeSpanTooLong); + throw new OverflowException(Environment.GetResourceString("Overflow_TimeSpanTooLong")); return new TimeSpan(result); } @@ -303,7 +303,7 @@ namespace System // which is less than 2^44, meaning we won't overflow totalSeconds. long totalSeconds = (long)hour * 3600 + (long)minute * 60 + (long)second; if (totalSeconds > MaxSeconds || totalSeconds < MinSeconds) - throw new ArgumentOutOfRangeException(null, SR.Overflow_TimeSpanTooLong); + throw new ArgumentOutOfRangeException(null, Environment.GetResourceString("Overflow_TimeSpanTooLong")); return totalSeconds * TicksPerSecond; } @@ -386,7 +386,7 @@ namespace System public static TimeSpan operator -(TimeSpan t) { if (t._ticks == TimeSpan.MinValue._ticks) - throw new OverflowException(SR.Overflow_NegateTwosCompNum); + throw new OverflowException(Environment.GetResourceString("Overflow_NegateTwosCompNum")); return new TimeSpan(-t._ticks); } @@ -409,7 +409,7 @@ namespace System { if (double.IsNaN(factor)) { - throw new ArgumentException(SR.Arg_CannotBeNaN, nameof(factor)); + throw new ArgumentException(Environment.GetResourceString("Arg_CannotBeNaN"), nameof(factor)); } // Rounding to the nearest tick is as close to the result we would have with unlimited @@ -417,7 +417,7 @@ namespace System double ticks = Math.Round(timeSpan.Ticks * factor); if (ticks > long.MaxValue | ticks < long.MinValue) { - throw new OverflowException(SR.Overflow_TimeSpanTooLong); + throw new OverflowException(Environment.GetResourceString("Overflow_TimeSpanTooLong")); } return FromTicks((long)ticks); @@ -429,13 +429,13 @@ namespace System { if (double.IsNaN(divisor)) { - throw new ArgumentException(SR.Arg_CannotBeNaN, nameof(divisor)); + throw new ArgumentException(Environment.GetResourceString("Arg_CannotBeNaN"), nameof(divisor)); } double ticks = Math.Round(timeSpan.Ticks / divisor); if (ticks > long.MaxValue | ticks < long.MinValue || double.IsNaN(ticks)) { - throw new OverflowException(SR.Overflow_TimeSpanTooLong); + throw new OverflowException(Environment.GetResourceString("Overflow_TimeSpanTooLong")); } return FromTicks((long)ticks); diff --git a/src/mscorlib/src/System/TimeZoneInfo.AdjustmentRule.cs b/src/mscorlib/src/System/TimeZoneInfo.AdjustmentRule.cs index c0c27eeab7..21238fb94f 100644 --- a/src/mscorlib/src/System/TimeZoneInfo.AdjustmentRule.cs +++ b/src/mscorlib/src/System/TimeZoneInfo.AdjustmentRule.cs @@ -144,22 +144,22 @@ namespace System { if (dateStart.Kind != DateTimeKind.Unspecified && dateStart.Kind != DateTimeKind.Utc) { - throw new ArgumentException(SR.Argument_DateTimeKindMustBeUnspecifiedOrUtc, nameof(dateStart)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeKindMustBeUnspecifiedOrUtc"), nameof(dateStart)); } if (dateEnd.Kind != DateTimeKind.Unspecified && dateEnd.Kind != DateTimeKind.Utc) { - throw new ArgumentException(SR.Argument_DateTimeKindMustBeUnspecifiedOrUtc, nameof(dateEnd)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeKindMustBeUnspecifiedOrUtc"), nameof(dateEnd)); } if (daylightTransitionStart.Equals(daylightTransitionEnd) && !noDaylightTransitions) { - throw new ArgumentException(SR.Argument_TransitionTimesAreIdentical, nameof(daylightTransitionEnd)); + throw new ArgumentException(Environment.GetResourceString("Argument_TransitionTimesAreIdentical"), nameof(daylightTransitionEnd)); } if (dateStart > dateEnd) { - throw new ArgumentException(SR.Argument_OutOfOrderDateTimes, nameof(dateStart)); + throw new ArgumentException(Environment.GetResourceString("Argument_OutOfOrderDateTimes"), nameof(dateStart)); } // This cannot use UtcOffsetOutOfRange to account for the scenario where Samoa moved across the International Date Line, @@ -168,22 +168,22 @@ namespace System // to be -23 (what it takes to go from UTC+13 to UTC-10) if (daylightDelta.TotalHours < -23.0 || daylightDelta.TotalHours > 14.0) { - throw new ArgumentOutOfRangeException(nameof(daylightDelta), daylightDelta, SR.ArgumentOutOfRange_UtcOffset); + throw new ArgumentOutOfRangeException(nameof(daylightDelta), daylightDelta, Environment.GetResourceString("ArgumentOutOfRange_UtcOffset")); } if (daylightDelta.Ticks % TimeSpan.TicksPerMinute != 0) { - throw new ArgumentException(SR.Argument_TimeSpanHasSeconds, nameof(daylightDelta)); + throw new ArgumentException(Environment.GetResourceString("Argument_TimeSpanHasSeconds"), nameof(daylightDelta)); } if (dateStart != DateTime.MinValue && dateStart.Kind == DateTimeKind.Unspecified && dateStart.TimeOfDay != TimeSpan.Zero) { - throw new ArgumentException(SR.Argument_DateTimeHasTimeOfDay, nameof(dateStart)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeHasTimeOfDay"), nameof(dateStart)); } if (dateEnd != DateTime.MaxValue && dateEnd.Kind == DateTimeKind.Unspecified && dateEnd.TimeOfDay != TimeSpan.Zero) { - throw new ArgumentException(SR.Argument_DateTimeHasTimeOfDay, nameof(dateEnd)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeHasTimeOfDay"), nameof(dateEnd)); } Contract.EndContractBlock(); } @@ -200,7 +200,7 @@ namespace System } catch (ArgumentException e) { - throw new SerializationException(SR.Serialization_InvalidData, e); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e); } } diff --git a/src/mscorlib/src/System/TimeZoneInfo.StringSerializer.cs b/src/mscorlib/src/System/TimeZoneInfo.StringSerializer.cs index c52f7307d8..9c1d5c3502 100644 --- a/src/mscorlib/src/System/TimeZoneInfo.StringSerializer.cs +++ b/src/mscorlib/src/System/TimeZoneInfo.StringSerializer.cs @@ -112,11 +112,11 @@ namespace System } catch (ArgumentException ex) { - throw new SerializationException(SR.Serialization_InvalidData, ex); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), ex); } catch (InvalidTimeZoneException ex) { - throw new SerializationException(SR.Serialization_InvalidData, ex); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), ex); } } @@ -181,7 +181,7 @@ namespace System { if (c != Esc && c != Sep && c != Lhs && c != Rhs) { - throw new SerializationException(SR.Format(SR.Serialization_InvalidEscapeSequence, c)); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidEscapeSequence", c)); } } @@ -194,7 +194,7 @@ namespace System { if (_currentTokenStartIndex < 0 || _currentTokenStartIndex >= _serializedText.Length) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } State tokenState = State.NotEscaped; @@ -236,7 +236,7 @@ namespace System case '\0': // invalid character - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); default: break; @@ -244,7 +244,7 @@ namespace System } } - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } /// <summary> @@ -258,11 +258,11 @@ namespace System // first verify the internal state of the object if (_state == State.EndOfLine) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } if (_currentTokenStartIndex < 0 || _currentTokenStartIndex >= _serializedText.Length) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } State tokenState = State.NotEscaped; StringBuilder token = StringBuilderCache.Acquire(InitialCapacityForString); @@ -286,11 +286,11 @@ namespace System case Lhs: // '[' is an unexpected character - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); case Rhs: // ']' is an unexpected character - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); case Sep: _currentTokenStartIndex = i + 1; @@ -306,7 +306,7 @@ namespace System case '\0': // invalid character - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); default: token.Append(_serializedText[i]); @@ -320,10 +320,10 @@ namespace System if (tokenState == State.Escaped) { // we are at the end of the serialized text but we are in an escaped state - throw new SerializationException(SR.Format(SR.Serialization_InvalidEscapeSequence, string.Empty)); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidEscapeSequence", string.Empty)); } - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } /// <summary> @@ -335,7 +335,7 @@ namespace System DateTime time; if (!DateTime.TryParseExact(token, format, DateTimeFormatInfo.InvariantInfo, DateTimeStyles.None, out time)) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } return time; } @@ -352,7 +352,7 @@ namespace System } catch (ArgumentOutOfRangeException e) { - throw new SerializationException(SR.Serialization_InvalidData, e); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e); } } @@ -365,7 +365,7 @@ namespace System int value; if (!int.TryParse(token, NumberStyles.AllowLeadingSign /* "[sign]digits" */, CultureInfo.InvariantCulture, out value)) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } return value; } @@ -391,11 +391,11 @@ namespace System // the AdjustmentRule array must end with a separator if (_state == State.EndOfLine) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } if (_currentTokenStartIndex < 0 || _currentTokenStartIndex >= _serializedText.Length) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } return count != 0 ? rules.ToArray() : null; @@ -414,7 +414,7 @@ namespace System if (_currentTokenStartIndex < 0 || _currentTokenStartIndex >= _serializedText.Length) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } // check to see if the very first token we see is the separator @@ -426,7 +426,7 @@ namespace System // verify the current token is a left-hand-side marker ("[") if (_serializedText[_currentTokenStartIndex] != Lhs) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } _currentTokenStartIndex++; @@ -442,7 +442,7 @@ namespace System if (_state == State.EndOfLine || _currentTokenStartIndex >= _serializedText.Length) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } // Check if we have baseUtcOffsetDelta in the serialized string and then deserialize it @@ -460,7 +460,7 @@ namespace System if (_state == State.EndOfLine || _currentTokenStartIndex >= _serializedText.Length) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } if (_serializedText[_currentTokenStartIndex] != Rhs) @@ -486,7 +486,7 @@ namespace System } catch (ArgumentException e) { - throw new SerializationException(SR.Serialization_InvalidData, e); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e); } // finally set the state to either EndOfLine or StartOfToken for the next caller @@ -514,19 +514,19 @@ namespace System // // we are at the end of the line or we are starting at a "]" character // - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } if (_currentTokenStartIndex < 0 || _currentTokenStartIndex >= _serializedText.Length) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } // verify the current token is a left-hand-side marker ("[") if (_serializedText[_currentTokenStartIndex] != Lhs) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } _currentTokenStartIndex++; @@ -534,7 +534,7 @@ namespace System if (isFixedDate != 0 && isFixedDate != 1) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } TransitionTime transition; @@ -554,7 +554,7 @@ namespace System } catch (ArgumentException e) { - throw new SerializationException(SR.Serialization_InvalidData, e); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e); } } else @@ -568,7 +568,7 @@ namespace System } catch (ArgumentException e) { - throw new SerializationException(SR.Serialization_InvalidData, e); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e); } } @@ -576,7 +576,7 @@ namespace System if (_state == State.EndOfLine || _currentTokenStartIndex >= _serializedText.Length) { - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } if (_serializedText[_currentTokenStartIndex] != Rhs) @@ -606,7 +606,7 @@ namespace System if (!sepFound) { // we MUST end on a separator - throw new SerializationException(SR.Serialization_InvalidData); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData")); } // finally set the state to either EndOfLine or StartOfToken for the next caller diff --git a/src/mscorlib/src/System/TimeZoneInfo.TransitionTime.cs b/src/mscorlib/src/System/TimeZoneInfo.TransitionTime.cs index 1e1d9d328b..354d0acdb7 100644 --- a/src/mscorlib/src/System/TimeZoneInfo.TransitionTime.cs +++ b/src/mscorlib/src/System/TimeZoneInfo.TransitionTime.cs @@ -75,37 +75,37 @@ namespace System { if (timeOfDay.Kind != DateTimeKind.Unspecified) { - throw new ArgumentException(SR.Argument_DateTimeKindMustBeUnspecified, nameof(timeOfDay)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeKindMustBeUnspecified"), nameof(timeOfDay)); } // Month range 1-12 if (month < 1 || month > 12) { - throw new ArgumentOutOfRangeException(nameof(month), SR.ArgumentOutOfRange_MonthParam); + throw new ArgumentOutOfRangeException(nameof(month), Environment.GetResourceString("ArgumentOutOfRange_MonthParam")); } // Day range 1-31 if (day < 1 || day > 31) { - throw new ArgumentOutOfRangeException(nameof(day), SR.ArgumentOutOfRange_DayParam); + throw new ArgumentOutOfRangeException(nameof(day), Environment.GetResourceString("ArgumentOutOfRange_DayParam")); } // Week range 1-5 if (week < 1 || week > 5) { - throw new ArgumentOutOfRangeException(nameof(week), SR.ArgumentOutOfRange_Week); + throw new ArgumentOutOfRangeException(nameof(week), Environment.GetResourceString("ArgumentOutOfRange_Week")); } // DayOfWeek range 0-6 if ((int)dayOfWeek < 0 || (int)dayOfWeek > 6) { - throw new ArgumentOutOfRangeException(nameof(dayOfWeek), SR.ArgumentOutOfRange_DayOfWeek); + throw new ArgumentOutOfRangeException(nameof(dayOfWeek), Environment.GetResourceString("ArgumentOutOfRange_DayOfWeek")); } Contract.EndContractBlock(); if (timeOfDay.Year != 1 || timeOfDay.Month != 1 || timeOfDay.Day != 1 || (timeOfDay.Ticks % TimeSpan.TicksPerMillisecond != 0)) { - throw new ArgumentException(SR.Argument_DateTimeHasTicks, nameof(timeOfDay)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeHasTicks"), nameof(timeOfDay)); } } @@ -120,7 +120,7 @@ namespace System } catch (ArgumentException e) { - throw new SerializationException(SR.Serialization_InvalidData, e); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e); } } diff --git a/src/mscorlib/src/System/TimeZoneInfo.Unix.cs b/src/mscorlib/src/System/TimeZoneInfo.Unix.cs index 02baadcfe5..1ecf4d43e9 100644 --- a/src/mscorlib/src/System/TimeZoneInfo.Unix.cs +++ b/src/mscorlib/src/System/TimeZoneInfo.Unix.cs @@ -219,7 +219,7 @@ namespace System } catch (IOException ex) { - e = new InvalidTimeZoneException(SR.Format(SR.InvalidTimeZone_InvalidFileData, id, timeZoneFilePath), ex); + e = new InvalidTimeZoneException(Environment.GetResourceString("InvalidTimeZone_InvalidFileData", id, timeZoneFilePath), ex); return TimeZoneInfoResult.InvalidTimeZoneException; } @@ -227,7 +227,7 @@ namespace System if (value == null) { - e = new InvalidTimeZoneException(SR.Format(SR.InvalidTimeZone_InvalidFileData, id, timeZoneFilePath)); + e = new InvalidTimeZoneException(Environment.GetResourceString("InvalidTimeZone_InvalidFileData", id, timeZoneFilePath)); return TimeZoneInfoResult.InvalidTimeZoneException; } @@ -571,7 +571,7 @@ namespace System } else if (id.Length == 0 || id.Contains("\0")) { - throw new TimeZoneNotFoundException(SR.Format(SR.TimeZoneNotFound_MissingData, id)); + throw new TimeZoneNotFoundException(Environment.GetResourceString("TimeZoneNotFound_MissingData", id)); } TimeZoneInfo value; @@ -598,11 +598,11 @@ namespace System } else if (result == TimeZoneInfoResult.SecurityException) { - throw new SecurityException(SR.Format(SR.Security_CannotReadFileData, id), e); + throw new SecurityException(Environment.GetResourceString("Security_CannotReadFileData", id), e); } else { - throw new TimeZoneNotFoundException(SR.Format(SR.TimeZoneNotFound_MissingData, id), e); + throw new TimeZoneNotFoundException(Environment.GetResourceString("TimeZoneNotFound_MissingData", id), e); } } @@ -926,7 +926,7 @@ namespace System return transitionTypes[0]; } - throw new InvalidTimeZoneException(SR.InvalidTimeZone_NoTTInfoStructures); + throw new InvalidTimeZoneException(Environment.GetResourceString("InvalidTimeZone_NoTTInfoStructures")); } /// <summary> @@ -1060,7 +1060,7 @@ namespace System DayOfWeek day; if (!TZif_ParseMDateRule(date, out month, out week, out day)) { - throw new InvalidTimeZoneException(SR.Format(SR.InvalidTimeZone_UnparseablePosixMDateString, date)); + throw new InvalidTimeZoneException(Environment.GetResourceString("InvalidTimeZone_UnparseablePosixMDateString", date)); } DateTime timeOfDay; @@ -1103,7 +1103,7 @@ namespace System // One of them *could* be supported if we relaxed the TransitionTime validation rules, and allowed // "IsFixedDateRule = true, Month = 0, Day = n" to mean the nth day of the year, picking one of the rules above - throw new InvalidTimeZoneException(SR.InvalidTimeZone_JulianDayNotSupported); + throw new InvalidTimeZoneException(Environment.GetResourceString("InvalidTimeZone_JulianDayNotSupported")); } } @@ -1425,7 +1425,7 @@ namespace System { if (data == null || data.Length < index + Length) { - throw new ArgumentException(SR.Argument_TimeZoneInfoInvalidTZif, nameof(data)); + throw new ArgumentException(Environment.GetResourceString("Argument_TimeZoneInfoInvalidTZif"), nameof(data)); } Contract.EndContractBlock(); UtcOffset = new TimeSpan(0, 0, TZif_ToInt32(data, index + 00)); @@ -1461,7 +1461,7 @@ namespace System if (Magic != 0x545A6966) { // 0x545A6966 = {0x54, 0x5A, 0x69, 0x66} = "TZif" - throw new ArgumentException(SR.Argument_TimeZoneInfoBadTZif, nameof(data)); + throw new ArgumentException(Environment.GetResourceString("Argument_TimeZoneInfoBadTZif"), nameof(data)); } byte version = data[index + 04]; diff --git a/src/mscorlib/src/System/TimeZoneInfo.Win32.cs b/src/mscorlib/src/System/TimeZoneInfo.Win32.cs index 5107fee333..09a926f1aa 100644 --- a/src/mscorlib/src/System/TimeZoneInfo.Win32.cs +++ b/src/mscorlib/src/System/TimeZoneInfo.Win32.cs @@ -348,7 +348,7 @@ namespace System } else if (id.Length == 0 || id.Length > MaxKeyLength || id.Contains("\0")) { - throw new TimeZoneNotFoundException(SR.Format(SR.TimeZoneNotFound_MissingData, id)); + throw new TimeZoneNotFoundException(Environment.GetResourceString("TimeZoneNotFound_MissingData", id)); } TimeZoneInfo value; @@ -369,15 +369,15 @@ namespace System } else if (result == TimeZoneInfoResult.InvalidTimeZoneException) { - throw new InvalidTimeZoneException(SR.Format(SR.InvalidTimeZone_InvalidRegistryData, id), e); + throw new InvalidTimeZoneException(Environment.GetResourceString("InvalidTimeZone_InvalidRegistryData", id), e); } else if (result == TimeZoneInfoResult.SecurityException) { - throw new SecurityException(SR.Format(SR.Security_CannotReadRegistryData, id), e); + throw new SecurityException(Environment.GetResourceString("Security_CannotReadRegistryData", id), e); } else { - throw new TimeZoneNotFoundException(SR.Format(SR.TimeZoneNotFound_MissingData, id), e); + throw new TimeZoneNotFoundException(Environment.GetResourceString("TimeZoneNotFound_MissingData", id), e); } } diff --git a/src/mscorlib/src/System/TimeZoneInfo.cs b/src/mscorlib/src/System/TimeZoneInfo.cs index c37d81bd2b..1f628793d4 100644 --- a/src/mscorlib/src/System/TimeZoneInfo.cs +++ b/src/mscorlib/src/System/TimeZoneInfo.cs @@ -164,7 +164,7 @@ namespace System { if (!SupportsDaylightSavingTime) { - throw new ArgumentException(SR.Argument_DateTimeOffsetIsNotAmbiguous, nameof(dateTimeOffset)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeOffsetIsNotAmbiguous"), nameof(dateTimeOffset)); } Contract.EndContractBlock(); @@ -180,7 +180,7 @@ namespace System if (!isAmbiguous) { - throw new ArgumentException(SR.Argument_DateTimeOffsetIsNotAmbiguous, nameof(dateTimeOffset)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeOffsetIsNotAmbiguous"), nameof(dateTimeOffset)); } // the passed in dateTime is ambiguous in this TimeZoneInfo instance @@ -210,7 +210,7 @@ namespace System { if (!SupportsDaylightSavingTime) { - throw new ArgumentException(SR.Argument_DateTimeIsNotAmbiguous, nameof(dateTime)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeIsNotAmbiguous"), nameof(dateTime)); } Contract.EndContractBlock(); @@ -240,7 +240,7 @@ namespace System if (!isAmbiguous) { - throw new ArgumentException(SR.Argument_DateTimeIsNotAmbiguous, nameof(dateTime)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeIsNotAmbiguous"), nameof(dateTime)); } // the passed in dateTime is ambiguous in this TimeZoneInfo instance @@ -649,7 +649,7 @@ namespace System DateTimeKind sourceKind = cachedData.GetCorrespondingKind(sourceTimeZone); if (((flags & TimeZoneInfoOptions.NoThrowOnInvalidTime) == 0) && (dateTime.Kind != DateTimeKind.Unspecified) && (dateTime.Kind != sourceKind)) { - throw new ArgumentException(SR.Argument_ConvertMismatch, nameof(sourceTimeZone)); + throw new ArgumentException(Environment.GetResourceString("Argument_ConvertMismatch"), nameof(sourceTimeZone)); } // @@ -675,7 +675,7 @@ namespace System // period that supports DST if (((flags & TimeZoneInfoOptions.NoThrowOnInvalidTime) == 0) && GetIsInvalidTime(dateTime, sourceRule, sourceDaylightTime)) { - throw new ArgumentException(SR.Argument_DateTimeIsInvalid, nameof(dateTime)); + throw new ArgumentException(Environment.GetResourceString("Argument_DateTimeIsInvalid"), nameof(dateTime)); } sourceIsDaylightSavings = GetIsDaylightSavings(dateTime, sourceRule, sourceDaylightTime, flags); @@ -767,7 +767,7 @@ namespace System } if (source.Length == 0) { - throw new ArgumentException(SR.Format(SR.Argument_InvalidSerializedString, source), nameof(source)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidSerializedString", source), nameof(source)); } Contract.EndContractBlock(); @@ -1001,16 +1001,16 @@ namespace System if (adjustmentRulesSupportDst != _supportsDaylightSavingTime) { - throw new SerializationException(SR.Format(SR.Serialization_CorruptField, "SupportsDaylightSavingTime")); + throw new SerializationException(Environment.GetResourceString("Serialization_CorruptField", "SupportsDaylightSavingTime")); } } catch (ArgumentException e) { - throw new SerializationException(SR.Serialization_InvalidData, e); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e); } catch (InvalidTimeZoneException e) { - throw new SerializationException(SR.Serialization_InvalidData, e); + throw new SerializationException(Environment.GetResourceString("Serialization_InvalidData"), e); } } @@ -1880,17 +1880,17 @@ namespace System if (id.Length == 0) { - throw new ArgumentException(SR.Format(SR.Argument_InvalidId, id), nameof(id)); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidId", id), nameof(id)); } if (UtcOffsetOutOfRange(baseUtcOffset)) { - throw new ArgumentOutOfRangeException(nameof(baseUtcOffset), SR.ArgumentOutOfRange_UtcOffset); + throw new ArgumentOutOfRangeException(nameof(baseUtcOffset), Environment.GetResourceString("ArgumentOutOfRange_UtcOffset")); } if (baseUtcOffset.Ticks % TimeSpan.TicksPerMinute != 0) { - throw new ArgumentException(SR.Argument_TimeSpanHasSeconds, nameof(baseUtcOffset)); + throw new ArgumentException(Environment.GetResourceString("Argument_TimeSpanHasSeconds"), nameof(baseUtcOffset)); } Contract.EndContractBlock(); @@ -1914,7 +1914,7 @@ namespace System if (current == null) { - throw new InvalidTimeZoneException(SR.Argument_AdjustmentRulesNoNulls); + throw new InvalidTimeZoneException(Environment.GetResourceString("Argument_AdjustmentRulesNoNulls")); } // FUTURE: check to see if this rule supports Daylight Saving Time @@ -1923,13 +1923,13 @@ namespace System if (UtcOffsetOutOfRange(baseUtcOffset + current.DaylightDelta)) { - throw new InvalidTimeZoneException(SR.ArgumentOutOfRange_UtcOffsetAndDaylightDelta); + throw new InvalidTimeZoneException(Environment.GetResourceString("ArgumentOutOfRange_UtcOffsetAndDaylightDelta")); } if (prev != null && current.DateStart <= prev.DateEnd) { // verify the rules are in chronological order and the DateStart/DateEnd do not overlap - throw new InvalidTimeZoneException(SR.Argument_AdjustmentRulesOutOfOrder); + throw new InvalidTimeZoneException(Environment.GetResourceString("Argument_AdjustmentRulesOutOfOrder")); } } } diff --git a/src/mscorlib/src/System/Tuple.cs b/src/mscorlib/src/System/Tuple.cs index a118df02bd..02894c2a2b 100644 --- a/src/mscorlib/src/System/Tuple.cs +++ b/src/mscorlib/src/System/Tuple.cs @@ -148,7 +148,7 @@ namespace System if (objTuple == null) { - throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other"); + throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other"); } return comparer.Compare(m_Item1, objTuple.m_Item1); @@ -250,7 +250,7 @@ namespace System if (objTuple == null) { - throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other"); + throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other"); } int c = 0; @@ -367,7 +367,7 @@ namespace System if (objTuple == null) { - throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other"); + throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other"); } int c = 0; @@ -495,7 +495,7 @@ namespace System if (objTuple == null) { - throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other"); + throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other"); } int c = 0; @@ -634,7 +634,7 @@ namespace System if (objTuple == null) { - throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other"); + throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other"); } int c = 0; @@ -784,7 +784,7 @@ namespace System if (objTuple == null) { - throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other"); + throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other"); } int c = 0; @@ -945,7 +945,7 @@ namespace System if (objTuple == null) { - throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other"); + throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other"); } int c = 0; @@ -1077,7 +1077,7 @@ namespace System { if (!(rest is ITupleInternal)) { - throw new ArgumentException(SR.ArgumentException_TupleLastArgumentNotATuple); + throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleLastArgumentNotATuple")); } m_Item1 = item1; @@ -1122,7 +1122,7 @@ namespace System if (objTuple == null) { - throw new ArgumentException(SR.Format(SR.ArgumentException_TupleIncorrectType, this.GetType().ToString()), "other"); + throw new ArgumentException(Environment.GetResourceString("ArgumentException_TupleIncorrectType", this.GetType().ToString()), "other"); } int c = 0; diff --git a/src/mscorlib/src/System/TypeLoadException.cs b/src/mscorlib/src/System/TypeLoadException.cs index c09d3e1267..750e84ffa5 100644 --- a/src/mscorlib/src/System/TypeLoadException.cs +++ b/src/mscorlib/src/System/TypeLoadException.cs @@ -27,7 +27,7 @@ namespace System public class TypeLoadException : SystemException, ISerializable { public TypeLoadException() - : base(SR.Arg_TypeLoadException) + : base(Environment.GetResourceString("Arg_TypeLoadException")) { SetErrorCode(__HResults.COR_E_TYPELOAD); } @@ -59,14 +59,14 @@ namespace System { if ((ClassName == null) && (ResourceId == 0)) - _message = SR.Arg_TypeLoadException; + _message = Environment.GetResourceString("Arg_TypeLoadException"); else { if (AssemblyName == null) - AssemblyName = SR.IO_UnknownFileName; + AssemblyName = Environment.GetResourceString("IO_UnknownFileName"); if (ClassName == null) - ClassName = SR.IO_UnknownFileName; + ClassName = Environment.GetResourceString("IO_UnknownFileName"); String format = null; GetTypeLoadExceptionMessage(ResourceId, JitHelpers.GetStringHandleOnStack(ref format)); diff --git a/src/mscorlib/src/System/TypeNameParser.cs b/src/mscorlib/src/System/TypeNameParser.cs index f9d608968f..4dee3d4c88 100644 --- a/src/mscorlib/src/System/TypeNameParser.cs +++ b/src/mscorlib/src/System/TypeNameParser.cs @@ -74,7 +74,7 @@ namespace System if (typeName == null) throw new ArgumentNullException(nameof(typeName)); if (typeName.Length > 0 && typeName[0] == '\0') - throw new ArgumentException(SR.Format_StringZeroLength); + throw new ArgumentException(Environment.GetResourceString("Format_StringZeroLength")); Contract.EndContractBlock(); Type ret = null; @@ -143,7 +143,7 @@ namespace System { // This can only happen if the type name is an empty string or if the first char is '\0' if (throwOnError) - throw new TypeLoadException(SR.Arg_TypeLoadNullStr); + throw new TypeLoadException(Environment.GetResourceString("Arg_TypeLoadNullStr")); return null; } @@ -221,7 +221,7 @@ namespace System assembly = assemblyResolver(new AssemblyName(asmName)); if (assembly == null && throwOnError) { - throw new FileNotFoundException(SR.Format(SR.FileNotFound_ResolveAssembly, asmName)); + throw new FileNotFoundException(Environment.GetResourceString("FileNotFound_ResolveAssembly", asmName)); } } @@ -245,8 +245,8 @@ namespace System if (type == null && throwOnError) { string errorString = assembly == null ? - SR.Format(SR.TypeLoad_ResolveType, OuterMostTypeName): - SR.Format(SR.TypeLoad_ResolveTypeFromAssembly, OuterMostTypeName, assembly.FullName); + Environment.GetResourceString("TypeLoad_ResolveType", OuterMostTypeName) : + Environment.GetResourceString("TypeLoad_ResolveTypeFromAssembly", OuterMostTypeName, assembly.FullName); throw new TypeLoadException(errorString); } @@ -277,7 +277,7 @@ namespace System if (type == null) { if (throwOnError) - throw new TypeLoadException(SR.Format(SR.TypeLoad_ResolveNestedType, names[i], names[i - 1])); + throw new TypeLoadException(Environment.GetResourceString("TypeLoad_ResolveNestedType", names[i], names[i - 1])); else break; } diff --git a/src/mscorlib/src/System/TypeUnloadedException.cs b/src/mscorlib/src/System/TypeUnloadedException.cs index d1d55d55dc..841a281ea1 100644 --- a/src/mscorlib/src/System/TypeUnloadedException.cs +++ b/src/mscorlib/src/System/TypeUnloadedException.cs @@ -20,7 +20,7 @@ namespace System public class TypeUnloadedException : SystemException { public TypeUnloadedException() - : base(SR.Arg_TypeUnloadedException) + : base(Environment.GetResourceString("Arg_TypeUnloadedException")) { SetErrorCode(__HResults.COR_E_TYPEUNLOADED); } diff --git a/src/mscorlib/src/System/TypedReference.cs b/src/mscorlib/src/System/TypedReference.cs index ca65082158..eb5234ec85 100644 --- a/src/mscorlib/src/System/TypedReference.cs +++ b/src/mscorlib/src/System/TypedReference.cs @@ -31,7 +31,7 @@ namespace System throw new ArgumentNullException(nameof(flds)); Contract.EndContractBlock(); if (flds.Length == 0) - throw new ArgumentException(SR.Arg_ArrayZeroError); + throw new ArgumentException(Environment.GetResourceString("Arg_ArrayZeroError")); IntPtr[] fields = new IntPtr[flds.Length]; // For proper handling of Nullable<T> don't change GetType() to something like 'IsAssignableFrom' @@ -41,20 +41,20 @@ namespace System { RuntimeFieldInfo field = flds[i] as RuntimeFieldInfo; if (field == null) - throw new ArgumentException(SR.Argument_MustBeRuntimeFieldInfo); + throw new ArgumentException(Environment.GetResourceString("Argument_MustBeRuntimeFieldInfo")); if (field.IsInitOnly || field.IsStatic) - throw new ArgumentException(SR.Argument_TypedReferenceInvalidField); + throw new ArgumentException(Environment.GetResourceString("Argument_TypedReferenceInvalidField")); if (targetType != field.GetDeclaringTypeInternal() && !targetType.IsSubclassOf(field.GetDeclaringTypeInternal())) - throw new MissingMemberException(SR.MissingMemberTypeRef); + throw new MissingMemberException(Environment.GetResourceString("MissingMemberTypeRef")); RuntimeType fieldType = (RuntimeType)field.FieldType; if (fieldType.IsPrimitive) - throw new ArgumentException(SR.Arg_TypeRefPrimitve); + throw new ArgumentException(Environment.GetResourceString("Arg_TypeRefPrimitve")); if (i < (flds.Length - 1) && !fieldType.IsValueType) - throw new MissingMemberException(SR.MissingMemberNestErr); + throw new MissingMemberException(Environment.GetResourceString("MissingMemberNestErr")); fields[i] = field.FieldHandle.Value; targetType = fieldType; @@ -84,7 +84,7 @@ namespace System public override bool Equals(Object o) { - throw new NotSupportedException(SR.NotSupported_NYI); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_NYI")); } public unsafe static Object ToObject(TypedReference value) diff --git a/src/mscorlib/src/System/UInt16.cs b/src/mscorlib/src/System/UInt16.cs index b6893c2a49..b9b541273f 100644 --- a/src/mscorlib/src/System/UInt16.cs +++ b/src/mscorlib/src/System/UInt16.cs @@ -46,7 +46,7 @@ namespace System { return ((int)m_value - (int)(((UInt16)value).m_value)); } - throw new ArgumentException(SR.Arg_MustBeUInt16); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeUInt16")); } public int CompareTo(UInt16 value) @@ -137,10 +137,10 @@ namespace System } catch (OverflowException e) { - throw new OverflowException(SR.Overflow_UInt16, e); + throw new OverflowException(Environment.GetResourceString("Overflow_UInt16"), e); } - if (i > MaxValue) throw new OverflowException(SR.Overflow_UInt16); + if (i > MaxValue) throw new OverflowException(Environment.GetResourceString("Overflow_UInt16")); return (ushort)i; } @@ -263,7 +263,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt16", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "UInt16", "DateTime")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/UInt32.cs b/src/mscorlib/src/System/UInt32.cs index f209b798a5..503a136e2f 100644 --- a/src/mscorlib/src/System/UInt32.cs +++ b/src/mscorlib/src/System/UInt32.cs @@ -53,7 +53,7 @@ namespace System if (m_value > i) return 1; return 0; } - throw new ArgumentException(SR.Arg_MustBeUInt32); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeUInt32")); } public int CompareTo(UInt32 value) @@ -241,7 +241,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt32", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "UInt32", "DateTime")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/UInt64.cs b/src/mscorlib/src/System/UInt64.cs index 1f74940e00..f034d17de9 100644 --- a/src/mscorlib/src/System/UInt64.cs +++ b/src/mscorlib/src/System/UInt64.cs @@ -50,7 +50,7 @@ namespace System if (m_value > i) return 1; return 0; } - throw new ArgumentException(SR.Arg_MustBeUInt64); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeUInt64")); } public int CompareTo(UInt64 value) @@ -236,7 +236,7 @@ namespace System /// <internalonly/> DateTime IConvertible.ToDateTime(IFormatProvider provider) { - throw new InvalidCastException(SR.Format(SR.InvalidCast_FromTo, "UInt64", "DateTime")); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_FromTo", "UInt64", "DateTime")); } /// <internalonly/> diff --git a/src/mscorlib/src/System/UIntPtr.cs b/src/mscorlib/src/System/UIntPtr.cs index 09b7e51e89..09e61a3a50 100644 --- a/src/mscorlib/src/System/UIntPtr.cs +++ b/src/mscorlib/src/System/UIntPtr.cs @@ -57,7 +57,7 @@ namespace System if (Size == 4 && l > UInt32.MaxValue) { - throw new ArgumentException(SR.Serialization_InvalidPtrValue); + throw new ArgumentException(Environment.GetResourceString("Serialization_InvalidPtrValue")); } m_value = (void*)l; diff --git a/src/mscorlib/src/System/UnitySerializationHolder.cs b/src/mscorlib/src/System/UnitySerializationHolder.cs index 943e8cedfb..038b9b029a 100644 --- a/src/mscorlib/src/System/UnitySerializationHolder.cs +++ b/src/mscorlib/src/System/UnitySerializationHolder.cs @@ -199,14 +199,14 @@ namespace System private void ThrowInsufficientInformation(string field) { throw new SerializationException( - SR.Format(SR.Serialization_InsufficientDeserializationState, field)); + Environment.GetResourceString("Serialization_InsufficientDeserializationState", field)); } #endregion #region ISerializable public virtual void GetObjectData(SerializationInfo info, StreamingContext context) { - throw new NotSupportedException(SR.NotSupported_UnitySerHolder); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnitySerHolder")); } #endregion @@ -292,7 +292,7 @@ namespace System if (namedModule == null) throw new SerializationException( - SR.Format(SR.Serialization_UnableToFindModule, m_data, m_assemblyName)); + Environment.GetResourceString("Serialization_UnableToFindModule", m_data, m_assemblyName)); return namedModule; } @@ -311,7 +311,7 @@ namespace System } default: - throw new ArgumentException(SR.Argument_InvalidUnity); + throw new ArgumentException(Environment.GetResourceString("Argument_InvalidUnity")); } } #endregion diff --git a/src/mscorlib/src/System/ValueTuple.cs b/src/mscorlib/src/System/ValueTuple.cs index abe119a837..0f0863a2ed 100644 --- a/src/mscorlib/src/System/ValueTuple.cs +++ b/src/mscorlib/src/System/ValueTuple.cs @@ -1,4 +1,4 @@ -// Licensed to the .NET Foundation under one or more agreements. +// Licensed to the .NET Foundation under one or more agreements. // The .NET Foundation licenses this file to you under the MIT license. // See the LICENSE file in the project root for more information. @@ -1956,7 +1956,7 @@ namespace System { if (!(rest is IValueTupleInternal)) { - throw new ArgumentException(SR.ArgumentException_ValueTupleLastArgumentNotAValueTuple); + throw new ArgumentException(SR.ArgumentException_ValueTupleLastArgumentNotATuple); } Item1 = item1; diff --git a/src/mscorlib/src/System/Variant.cs b/src/mscorlib/src/System/Variant.cs index cae5bdade4..3036e5b45d 100644 --- a/src/mscorlib/src/System/Variant.cs +++ b/src/mscorlib/src/System/Variant.cs @@ -515,7 +515,7 @@ namespace System break; default: - throw new NotSupportedException(SR.Format(SR.NotSupported_UnknownTypeCode, ic.GetTypeCode())); + throw new NotSupportedException(Environment.GetResourceString("NotSupported_UnknownTypeCode", ic.GetTypeCode())); } } } @@ -561,12 +561,12 @@ namespace System } else { - throw new InvalidCastException(SR.InvalidCast_CannotCoerceByRefVariant); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_CannotCoerceByRefVariant")); } break; default: - throw new InvalidCastException(SR.InvalidCast_CannotCoerceByRefVariant); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_CannotCoerceByRefVariant")); } } else @@ -670,7 +670,7 @@ namespace System break; default: - throw new InvalidCastException(SR.InvalidCast_CannotCoerceByRefVariant); + throw new InvalidCastException(Environment.GetResourceString("InvalidCast_CannotCoerceByRefVariant")); } } } diff --git a/src/mscorlib/src/System/Version.cs b/src/mscorlib/src/System/Version.cs index 9c31786fef..03d45af395 100644 --- a/src/mscorlib/src/System/Version.cs +++ b/src/mscorlib/src/System/Version.cs @@ -38,16 +38,16 @@ namespace System public Version(int major, int minor, int build, int revision) { if (major < 0) - throw new ArgumentOutOfRangeException(nameof(major), SR.ArgumentOutOfRange_Version); + throw new ArgumentOutOfRangeException(nameof(major), Environment.GetResourceString("ArgumentOutOfRange_Version")); if (minor < 0) - throw new ArgumentOutOfRangeException(nameof(minor), SR.ArgumentOutOfRange_Version); + throw new ArgumentOutOfRangeException(nameof(minor), Environment.GetResourceString("ArgumentOutOfRange_Version")); if (build < 0) - throw new ArgumentOutOfRangeException(nameof(build), SR.ArgumentOutOfRange_Version); + throw new ArgumentOutOfRangeException(nameof(build), Environment.GetResourceString("ArgumentOutOfRange_Version")); if (revision < 0) - throw new ArgumentOutOfRangeException(nameof(revision), SR.ArgumentOutOfRange_Version); + throw new ArgumentOutOfRangeException(nameof(revision), Environment.GetResourceString("ArgumentOutOfRange_Version")); Contract.EndContractBlock(); _Major = major; @@ -59,13 +59,13 @@ namespace System public Version(int major, int minor, int build) { if (major < 0) - throw new ArgumentOutOfRangeException(nameof(major), SR.ArgumentOutOfRange_Version); + throw new ArgumentOutOfRangeException(nameof(major), Environment.GetResourceString("ArgumentOutOfRange_Version")); if (minor < 0) - throw new ArgumentOutOfRangeException(nameof(minor), SR.ArgumentOutOfRange_Version); + throw new ArgumentOutOfRangeException(nameof(minor), Environment.GetResourceString("ArgumentOutOfRange_Version")); if (build < 0) - throw new ArgumentOutOfRangeException(nameof(build), SR.ArgumentOutOfRange_Version); + throw new ArgumentOutOfRangeException(nameof(build), Environment.GetResourceString("ArgumentOutOfRange_Version")); Contract.EndContractBlock(); @@ -77,10 +77,10 @@ namespace System public Version(int major, int minor) { if (major < 0) - throw new ArgumentOutOfRangeException(nameof(major), SR.ArgumentOutOfRange_Version); + throw new ArgumentOutOfRangeException(nameof(major), Environment.GetResourceString("ArgumentOutOfRange_Version")); if (minor < 0) - throw new ArgumentOutOfRangeException(nameof(minor), SR.ArgumentOutOfRange_Version); + throw new ArgumentOutOfRangeException(nameof(minor), Environment.GetResourceString("ArgumentOutOfRange_Version")); Contract.EndContractBlock(); _Major = major; @@ -158,7 +158,7 @@ namespace System Version v = version as Version; if (v == null) { - throw new ArgumentException(SR.Arg_MustBeVersion); + throw new ArgumentException(Environment.GetResourceString("Arg_MustBeVersion")); } return CompareTo(v); @@ -230,7 +230,7 @@ namespace System return StringBuilderCache.GetStringAndRelease(sb); default: if (_Build == -1) - throw new ArgumentException(SR.Format(SR.ArgumentOutOfRange_Bounds_Lower_Upper, "0", "2"), nameof(fieldCount)); + throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper", "0", "2"), nameof(fieldCount)); if (fieldCount == 3) { @@ -244,7 +244,7 @@ namespace System } if (_Revision == -1) - throw new ArgumentException(SR.Format(SR.ArgumentOutOfRange_Bounds_Lower_Upper, "0", "3"), nameof(fieldCount)); + throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper", "0", "3"), nameof(fieldCount)); if (fieldCount == 4) { @@ -259,7 +259,7 @@ namespace System return StringBuilderCache.GetStringAndRelease(sb); } - throw new ArgumentException(SR.Format(SR.ArgumentOutOfRange_Bounds_Lower_Upper, "0", "4"), nameof(fieldCount)); + throw new ArgumentException(Environment.GetResourceString("ArgumentOutOfRange_Bounds_Lower_Upper", "0", "4"), nameof(fieldCount)); } } @@ -476,9 +476,9 @@ namespace System case ParseFailureKind.ArgumentNullException: return new ArgumentNullException(m_argumentName); case ParseFailureKind.ArgumentException: - return new ArgumentException(SR.Arg_VersionString); + return new ArgumentException(Environment.GetResourceString("Arg_VersionString")); case ParseFailureKind.ArgumentOutOfRangeException: - return new ArgumentOutOfRangeException(m_exceptionArgument, SR.ArgumentOutOfRange_Version); + return new ArgumentOutOfRangeException(m_exceptionArgument, Environment.GetResourceString("ArgumentOutOfRange_Version")); case ParseFailureKind.FormatException: // Regenerate the FormatException as would be thrown by Int32.Parse() try @@ -494,10 +494,10 @@ namespace System return e; } Debug.Assert(false, "Int32.Parse() did not throw exception but TryParse failed: " + m_exceptionArgument); - return new FormatException(SR.Format_InvalidString); + return new FormatException(Environment.GetResourceString("Format_InvalidString")); default: Debug.Assert(false, "Unmatched case in Version.GetVersionParseException() for value: " + m_failure); - return new ArgumentException(SR.Arg_VersionString); + return new ArgumentException(Environment.GetResourceString("Arg_VersionString")); } } } |