diff --git a/src/Microsoft.VisualStudio.Composition/Configuration/ExportMetadataViewInterfaceEmitProxy.cs b/src/Microsoft.VisualStudio.Composition/Configuration/ExportMetadataViewInterfaceEmitProxy.cs index 60502ad82..26034cc70 100644 --- a/src/Microsoft.VisualStudio.Composition/Configuration/ExportMetadataViewInterfaceEmitProxy.cs +++ b/src/Microsoft.VisualStudio.Composition/Configuration/ExportMetadataViewInterfaceEmitProxy.cs @@ -48,7 +48,7 @@ private static bool IsPropertyRelated(MemberInfo member) if (method != null) { return method.IsSpecialName - && method.Name.StartsWith("get_"); + && method.Name.StartsWith("get_", StringComparison.Ordinal); } return false; diff --git a/src/Microsoft.VisualStudio.Composition/ExportFactory.cs b/src/Microsoft.VisualStudio.Composition/ExportFactory.cs index 4ce212ef3..1edf96c54 100644 --- a/src/Microsoft.VisualStudio.Composition/ExportFactory.cs +++ b/src/Microsoft.VisualStudio.Composition/ExportFactory.cs @@ -27,7 +27,7 @@ internal static bool IsExportFactoryTypeV1(this Type type) if (type != null && type.GetTypeInfo().IsGenericType) { var typeDefinition = type.GetGenericTypeDefinition(); - if (typeDefinition.FullName?.StartsWith(ExportFactoryV1FullName) ?? false) + if (typeDefinition.FullName?.StartsWith(ExportFactoryV1FullName, StringComparison.Ordinal) ?? false) { return true; } @@ -43,7 +43,7 @@ internal static bool IsExportFactoryTypeV1(this TypeRef type) int arity = type.GenericTypeParameterCount + type.GenericTypeArguments.Length; if (arity > 0 && arity <= 2) { - if (type.FullName?.StartsWith(ExportFactoryV1FullName) ?? false) + if (type.FullName?.StartsWith(ExportFactoryV1FullName, StringComparison.Ordinal) ?? false) { return true; } @@ -58,7 +58,7 @@ internal static bool IsExportFactoryTypeV2(this Type type) if (type != null && type.GetTypeInfo().IsGenericType) { var typeDefinition = type.GetGenericTypeDefinition(); - if (typeDefinition.FullName?.StartsWith(ExportFactoryV2FullName) ?? false) + if (typeDefinition.FullName?.StartsWith(ExportFactoryV2FullName, StringComparison.Ordinal) ?? false) { return true; } @@ -74,7 +74,7 @@ internal static bool IsExportFactoryTypeV2(this TypeRef type) int arity = type.GenericTypeParameterCount + type.GenericTypeArguments.Length; if (arity > 0 && arity <= 2) { - if (type.FullName?.StartsWith(ExportFactoryV2FullName) ?? false) + if (type.FullName?.StartsWith(ExportFactoryV2FullName, StringComparison.Ordinal) ?? false) { return true; } diff --git a/src/Microsoft.VisualStudio.Composition/ExportProvider.cs b/src/Microsoft.VisualStudio.Composition/ExportProvider.cs index 3f290102c..592e62cf6 100644 --- a/src/Microsoft.VisualStudio.Composition/ExportProvider.cs +++ b/src/Microsoft.VisualStudio.Composition/ExportProvider.cs @@ -675,7 +675,7 @@ protected object GetStrongTypedMetadata(IReadOnlyDictionary met if (method != null) { // If the method came from a property, return the result of the property getter rather than return the delegate. - if (method.IsSpecialName && method.GetParameters().Length == 0 && method.Name.StartsWith("get_")) + if (method.IsSpecialName && method.GetParameters().Length == 0 && method.Name.StartsWith("get_", StringComparison.Ordinal)) { return method.Invoke(exportingPart, EmptyObjectArray); }