CompareInfo.GetCompareInfo Method (String, Assembly)


The .NET API Reference documentation has a new home. Visit the .NET API Browser on to see the new experience.

Initializes a new CompareInfo object that is associated with the specified culture and that uses string comparison methods in the specified Assembly.

Namespace:   System.Globalization
Assembly:  mscorlib (in mscorlib.dll)

public static CompareInfo GetCompareInfo(
	string name,
	Assembly assembly


Type: System.String

A string representing the culture name.

Type: System.Reflection.Assembly

An Assembly that contains the string comparison methods to use.

Return Value

Type: System.Globalization.CompareInfo

A new CompareInfo object associated with the culture with the specified identifier and using string comparison methods in the current Assembly.

Exception Condition

name is null.


assembly is null.


name is an invalid culture name.


assembly is of an invalid type.


The behavior of this method is unpredictable. We recommend that you use a version of this method that does not take an assembly input.

The assembly parameter must be of the same type as Module.Assembly.

.NET Framework
Available since 1.1
Return to top