Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

More warnings for existing code in xplat verification branch from CodeAnalysis.FxCopAnalyzer #9583

Closed
heng-liu opened this issue May 19, 2020 · 1 comment

Comments

@heng-liu
Copy link
Contributor

Found more warnings: (should be all the rest warnings in xplat feature branch)

Utility\OfflineFeedUtility.cs(90,43): warning CA1307: The behavior of 'string.Contains(char)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Protocol.Core.Types.OfflineFeedUtility.ThrowIfInvalid(string)' with a call to 'string.Contains(char, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Protocol\NuGet.Protocol.csproj]
Resources\PackageDetailsUriResourceV3.cs(52,29): warning CA1307: The behavior of 'string.Replace(string, string?)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Protocol.PackageDetailsUriResourceV3.GetUri(string, NuGet.Versioning.NuGetVersion)' with a call to 'string.Replace(string, string?, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Protocol\NuGet.Protocol.csproj]
Resources\PackageDetailsUriResourceV3.cs(52,29): warning CA1307: The behavior of 'string.Replace(string, string?)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Protocol.PackageDetailsUriResourceV3.GetUri(string, NuGet.Versioning.NuGetVersion)' with a call to 'string.Replace(string, string?, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Protocol\NuGet.Protocol.csproj]
Resources\PackageUpdateResource.cs(830,21): warning CA1307: The behavior of 'string.Contains(string)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Protocol.Core.Types.PackageUpdateResource.GetSecureApiKey(NuGet.Packaging.Core.PackageIdentity, string, bool, System.TimeSpan, NuGet.Common.ILogger, System.Threading.CancellationToken)' with a call to 'string.Contains(string, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Protocol\NuGet.Protocol.csproj]
Utility\CachingUtility.cs(88,20): warning CA1307: The behavior of 'string.Replace(string, string?)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Protocol.CachingUtility.RemoveInvalidFileNameChars(string)' with a call to 'string.Replace(string, string?, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Protocol\NuGet.Protocol.csproj]
Utility\CachingUtility.cs(88,20): warning CA1307: The behavior of 'string.Replace(string, string?)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Protocol.CachingUtility.RemoveInvalidFileNameChars(string)' with a call to 'string.Replace(string, string?, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Protocol\NuGet.Protocol.csproj]
Providers\RepositorySignatureResourceProvider.cs(107,25): warning CA1307: The behavior of 'string.IndexOf(char)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Protocol.RepositorySignatureResourceProvider.GenerateCacheKey(NuGet.Protocol.ServiceIndexEntry)' with a call to 'string.IndexOf(char, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Protocol\NuGet.Protocol.csproj]
Resources\ReportAbuseResourceV3.cs(35,29): warning CA1307: The behavior of 'string.Replace(string, string?)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Protocol.ReportAbuseResourceV3.GetReportAbuseUrl(string, NuGet.Versioning.NuGetVersion)' with a call to 'string.Replace(string, string?, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Protocol\NuGet.Protocol.csproj]
Resources\ReportAbuseResourceV3.cs(35,29): warning CA1307: The behavior of 'string.Replace(string, string?)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Protocol.ReportAbuseResourceV3.GetReportAbuseUrl(string, NuGet.Versioning.NuGetVersion)' with a call to 'string.Replace(string, string?, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Protocol\NuGet.Protocol.csproj]
Utility\LocalFolderUtility.cs(967,17): warning CA1307: The behavior of 'string.IndexOf(char)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Protocol.LocalFolderUtility.EnsurePackageExtension(string, bool)' with a call to 'string.IndexOf(char, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Protocol\NuGet.Protocol.csproj]
MSBuildProjectFactory.cs(262,17): warning CA1307: The behavior of 'string.Contains(string)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Commands.MSBuildProjectFactory.GetTargetPathForSourceFile(string, string)' with a call to 'string.Contains(string, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Commands\NuGet.Commands.csproj]
MSBuildProjectFactory.cs(267,36): warning CA1307: The behavior of 'string.Replace(string, string?)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Commands.MSBuildProjectFactory.GetTargetPathForSourceFile(string, string)' with a call to 'string.Replace(string, string?, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Commands\NuGet.Commands.csproj]
RestoreCommand\Diagnostics\UnresolvedMessages.cs(77,21): warning CA1307: The behavior of 'string.IndexOf(char)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Commands.UnresolvedMessages.GetMessageAsync(string, NuGet.LibraryModel.LibraryRange, System.Collections.Generic.IList<NuGet.DependencyResolver.IRemoteDependencyProvider>, NuGet.Protocol.Core.Types.SourceCacheContext, NuGet.Common.ILogger, System.Threading.CancellationToken)' with a call to 'string.IndexOf(char, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Commands\NuGet.Commands.csproj]
RestoreCommand\Utility\LockFileUtils.cs(829,30): warning CA1307: The behavior of 'string.IndexOf(char)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Commands.LockFileUtils.ClearIfExists<T>(System.Collections.Generic.IList<T>)' with a call to 'string.IndexOf(char, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Commands\NuGet.Commands.csproj]
RestoreCommand\Utility\BuildAssetsUtils.cs(761,43): warning CA1307: The behavior of 'string.Replace(string, string?)' could vary based on the current user's locale settings. Replace this call in 'NuGet.Commands.BuildAssetsUtils.GeneratePackagePathProperty(NuGet.Repositories.LocalPackageInfo)' with a call to 'string.Replace(string, string?, System.StringComparison)'. [C:\repos\NuGet.Client\src\NuGet.Core\NuGet.Commands\NuGet.Commands.csproj] 
@heng-liu
Copy link
Contributor Author

Closed as fixed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant