From 9797fbbfa50ca6aee2e7cf92889df709d215eb3d Mon Sep 17 00:00:00 2001 From: Michael Yanni Date: Fri, 22 Sep 2023 16:19:52 -0700 Subject: [PATCH] Applied cleanup for IDE0002 to the solution. --- src/BlazorWasmSdk/Tasks/GZipCompress.cs | 2 +- .../GenerateServiceWorkerAssetsManifest.cs | 2 +- .../SlnFile.cs | 4 +- .../ExponentialRetry.cs | 2 +- .../ForwardingAppImplementation.cs | 2 +- .../MSBuildForwardingAppWithoutLogging.cs | 2 +- src/Cli/Microsoft.DotNet.Cli.Utils/Uuid.cs | 2 +- .../Commands/create/InstantiateCommand.cs | 6 +- .../Commands/install/InstallCommandArgs.cs | 8 +- .../Commands/list/LegacyListCommand.cs | 2 +- .../Commands/list/ListCommandArgs.cs | 4 +- .../JExtensions.cs | 4 +- .../TemplateInvoker.cs | 4 +- .../TemplateListCoordinator.cs | 10 +- .../TemplatePackageCoordinator.cs | 20 +- .../TemplatePackageDisplay.cs | 12 +- .../TemplateResolutionResult.cs | 2 +- .../CliTemplateSearchCoordinator.cs | 10 +- src/Cli/dotnet-new3/HostFactory.cs | 2 +- .../dotnet/AspNetCoreCertificateGenerator.cs | 2 +- src/Cli/dotnet/CommonOptions.cs | 8 +- src/Cli/dotnet/CommonOptionsExtension.cs | 12 +- src/Cli/dotnet/CommonOptionsFactory.cs | 2 +- .../Windows/TimestampedFileLogger.cs | 2 +- src/Cli/dotnet/OptionForwardingExtensions.cs | 2 +- src/Cli/dotnet/ParseResultExtensions.cs | 12 +- src/Cli/dotnet/PerformanceLogEventListener.cs | 2 +- src/Cli/dotnet/Program.cs | 2 +- .../commands/InstallingWorkloadCommand.cs | 2 +- .../commands/dotnet-build/BuildCommand.cs | 2 +- .../dotnet/commands/dotnet-clean/Program.cs | 2 +- .../commands/dotnet-complete/ParseCommand.cs | 2 +- .../commands/dotnet-format/FormatCommand.cs | 2 +- .../commands/dotnet-help/HelpCommand.cs | 2 +- .../dotnet-msbuild/MSBuildForwardingApp.cs | 2 +- .../dotnet/commands/dotnet-msbuild/Program.cs | 2 +- .../commands/dotnet-new/NewCommandParser.cs | 8 +- .../commands/dotnet-new/SdkInfoProvider.cs | 2 +- .../dotnet/commands/dotnet-test/Program.cs | 2 +- .../dotnet-workload/WorkloadCommandParser.cs | 4 +- .../install/WorkloadManifestUpdater.cs | 2 +- .../LocalDaemons/KnownLocalRegistryTypes.cs | 6 +- ...ndCreateBundledNETCoreAppPackageVersion.cs | 2 +- .../toolset-tasks/PublishMutationUtilities.cs | 2 +- .../RemoveAssetFromDepsPackages.cs | 2 +- .../UpdatePortableRuntimeIdentifierGraph.cs | 2 +- src/RazorSdk/Tool/ConcurrentLruCache.cs | 2 +- src/RazorSdk/Tool/GenerateCommand.cs | 4 +- .../Tool/ServerProtocol/ServerConnection.cs | 2 +- ...rkloadManifestProvider.GlobalJsonReader.cs | 2 +- ...loadManifestProvider.InstallStateReader.cs | 2 +- .../WorkloadManifestReader.NewtonsoftJson.cs | 4 +- src/StaticWebAssetsSdk/Tasks/GZipCompress.cs | 2 +- src/StaticWebAssetsSdk/Tasks/RewriteCss.cs | 2 +- .../Tasks/StaticWebAsset.cs | 2 +- .../ConflictResolution/ConflictResolver.cs | 2 +- .../AllowEmptyTelemetry.cs | 2 +- .../LockFileCache.cs | 2 +- .../ShowMissingWorkloads.cs | 2 +- .../TarGzFileCreateFromDirectory.cs | 2 +- .../TypoCorrectionTests.cs | 2 +- ...netFirstTimeUseConfigurerWIthStateSetup.cs | 10 +- .../GivenAnMSBuildSdkResolver.cs | 2 +- .../ToolPackageInstallerTests.cs | 4 +- .../TargetsTests.cs | 24 +- .../DockerDaemonTests.cs | 2 +- ...atWeWantToBuildAnAppWithLibrariesAndRid.cs | 2 +- ...hatWeWantToControlGeneratedAssemblyInfo.cs | 6 +- .../GivenThereAreDefaultItems.cs | 2 +- ...atWeWantToPublishAFrameworkDependentApp.cs | 2 +- .../GivenThatWeWantToPublishAnAotApp.cs | 10 +- ...tWeWantAutomaticTargetingPackReferences.cs | 2 +- .../OutputPathCalculator.cs | 12 +- .../Microsoft.NET.TestFramework/TestAsset.cs | 2 +- .../TestContext.cs | 8 +- .../ToolsetInfo.cs | 2 +- .../HostDataLoaderTests.cs | 2 +- .../ParserTests/HelpTests.cs | 2 +- .../ParserTests/InstallTests.cs | 2 +- .../ParserTests/SearchTests.cs | 6 +- .../ParserTests/UninstallTests.cs | 2 +- src/Tests/crossgen.Tests/crossgen.Tests.cs | 2 +- ...ivenThatIWantToShowHelpForDotnetCommand.cs | 2 +- ...ThatWeCanPassNonProjectFilesToDotnetRun.cs | 2 +- .../dotnet-sln.Tests/GivenDotnetSlnAdd.cs | 2 +- .../GivenFileBasedWorkloadInstall.cs | 2 +- .../GivenDotnetWorkloadUpdate.cs | 8 +- .../CommandTests/ToolRestoreCommandTests.cs | 2 +- .../ParserTests/ResponseFileTests.cs | 2 +- .../GivenDotnetWorkloadClean.cs | 2 +- .../Publish/Tasks/Kudu/KuduVfsDeploy.cs | 4 +- .../Publish/Tasks/Kudu/KuduZipDeploy.cs | 2 +- .../Publish/Tasks/MsDeploy/CommonUtility.cs | 216 +++++++++--------- .../Publish/Tasks/MsDeploy/DynamicAssembly.cs | 8 +- .../Tasks/MsDeploy/VsMSDeployObject.cs | 40 ++-- .../Publish/Tasks/Tasks/Kudu/KuduDeploy.cs | 8 +- .../Tasks/MsDeploy/CreateManifestFile.cs | 2 +- .../Tasks/MsDeploy/CreateParameterFile.cs | 12 +- .../Tasks/MsDeploy/ImportParameterFile.cs | 10 +- .../Publish/Tasks/Tasks/MsDeploy/MSDeploy.cs | 90 ++++---- .../Tasks/MsDeploy/NormalizeServiceUrl.cs | 12 +- .../Tasks/Tasks/MsDeploy/VsMsdeploy.cs | 60 ++--- 102 files changed, 409 insertions(+), 409 deletions(-) diff --git a/src/BlazorWasmSdk/Tasks/GZipCompress.cs b/src/BlazorWasmSdk/Tasks/GZipCompress.cs index 1ce76d4ba237..c70c3889a943 100644 --- a/src/BlazorWasmSdk/Tasks/GZipCompress.cs +++ b/src/BlazorWasmSdk/Tasks/GZipCompress.cs @@ -24,7 +24,7 @@ public override bool Execute() Directory.CreateDirectory(OutputDirectory); - System.Threading.Tasks.Parallel.For(0, FilesToCompress.Length, i => + Parallel.For(0, FilesToCompress.Length, i => { var file = FilesToCompress[i]; var inputFullPath = file.GetMetadata("FullPath"); diff --git a/src/BlazorWasmSdk/Tasks/GenerateServiceWorkerAssetsManifest.cs b/src/BlazorWasmSdk/Tasks/GenerateServiceWorkerAssetsManifest.cs index 222b86adabc3..d3c39c0b17da 100644 --- a/src/BlazorWasmSdk/Tasks/GenerateServiceWorkerAssetsManifest.cs +++ b/src/BlazorWasmSdk/Tasks/GenerateServiceWorkerAssetsManifest.cs @@ -31,7 +31,7 @@ public override bool Execute() internal string GenerateAssetManifest(Stream stream) { var assets = new AssetsManifestFileEntry[Assets.Length]; - System.Threading.Tasks.Parallel.For(0, assets.Length, i => + Parallel.For(0, assets.Length, i => { var item = Assets[i]; var hash = item.GetMetadata("FileHash"); diff --git a/src/Cli/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs b/src/Cli/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs index a227d43e4543..2627acc75f14 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Sln.Internal/SlnFile.cs @@ -804,13 +804,13 @@ public void SetValue(string name, string value, string defaultValue = null, bool public void SetValue(string name, object value, object defaultValue = null) { - var isDefault = object.Equals(value, defaultValue); + var isDefault = Equals(value, defaultValue); if (isDefault) { // if the value is default, only remove the property if it was not already the default // to avoid unnecessary project file churn if (ContainsKey(name) && (defaultValue == null || - !object.Equals(defaultValue, GetValue(name, defaultValue.GetType(), null)))) + !Equals(defaultValue, GetValue(name, defaultValue.GetType(), null)))) { Remove(name); } diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/ExponentialRetry.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/ExponentialRetry.cs index a3557e56bae6..1b81e1cef57f 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/ExponentialRetry.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/ExponentialRetry.cs @@ -72,7 +72,7 @@ public static async Task ExecuteWithRetryOnFailure(Func> action, int maxRetryCount = 3, Func> timer = null) { - timer = timer == null ? () => ExponentialRetry.Timer(ExponentialRetry.Intervals) : timer; + timer = timer == null ? () => Timer(Intervals) : timer; return await ExecuteAsyncWithRetry(action, result => result != null && !result.Equals(default), maxRetryCount, timer); } diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs index 7412bf722004..c83369ef56cf 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/ForwardingAppImplementation.cs @@ -96,7 +96,7 @@ public ForwardingAppImplementation WithEnvironmentVariable(string name, string v private string GetHostExeName() { // Should instead make this a full path to dotnet - return System.Environment.ProcessPath; + return Environment.ProcessPath; } } } diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs index 5980424e8495..6ce33751a8cf 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/MSBuildForwardingAppWithoutLogging.cs @@ -145,7 +145,7 @@ public int ExecuteInProc(string[] arguments) try { // Execute MSBuild in the current process by calling its Main method. - return Microsoft.Build.CommandLine.MSBuildApp.Main(arguments); + return Build.CommandLine.MSBuildApp.Main(arguments); } catch (Exception exception) { diff --git a/src/Cli/Microsoft.DotNet.Cli.Utils/Uuid.cs b/src/Cli/Microsoft.DotNet.Cli.Utils/Uuid.cs index aa69cd344f36..207d35e8b781 100644 --- a/src/Cli/Microsoft.DotNet.Cli.Utils/Uuid.cs +++ b/src/Cli/Microsoft.DotNet.Cli.Utils/Uuid.cs @@ -19,7 +19,7 @@ public static Guid Create(string name) using (SHA1 hasher = SHA1.Create()) { - var nameBytes = System.Text.Encoding.UTF8.GetBytes(name ?? string.Empty); + var nameBytes = Encoding.UTF8.GetBytes(name ?? string.Empty); var namespaceBytes = namespaceId.ToByteArray(); SwapGuidByteOrder(namespaceBytes); diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs index 8b6783af7401..af4b5ddb7362 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/create/InstantiateCommand.cs @@ -465,7 +465,7 @@ private static void SuggestTypoCorrections(InstantiateCommandArgs instantiateArg foreach (string possibleMatch in possibleTemplateMatches) { Example example = useInstantiateCommand - ? Example.For(instantiateArgs.ParseResult).WithArgument(InstantiateCommand.ShortNameArgument, possibleMatch) + ? Example.For(instantiateArgs.ParseResult).WithArgument(ShortNameArgument, possibleMatch) : Example.For(instantiateArgs.ParseResult).WithArgument(NewCommand.ShortNameArgument, possibleMatch); if (helpOption) { @@ -511,7 +511,7 @@ private static void WriteListCommandExample(InstantiateCommandArgs instantiateAr Example .For(instantiateArgs.ParseResult) .WithSubcommand() - .WithArgument(ListCommand.NameArgument, instantiateArgs.ShortName)); + .WithArgument(BaseListCommand.NameArgument, instantiateArgs.ShortName)); } else { @@ -532,7 +532,7 @@ private static void WriteSearchCommandExample(InstantiateCommandArgs instantiate Example .For(instantiateArgs.ParseResult) .WithSubcommand() - .WithArgument(SearchCommand.NameArgument, instantiateArgs.ShortName)); + .WithArgument(BaseSearchCommand.NameArgument, instantiateArgs.ShortName)); } } } diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/install/InstallCommandArgs.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/install/InstallCommandArgs.cs index 07e5af052647..4c136ea17ace 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/install/InstallCommandArgs.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/install/InstallCommandArgs.cs @@ -9,13 +9,13 @@ internal class InstallCommandArgs : GlobalArgs { public InstallCommandArgs(BaseInstallCommand installCommand, ParseResult parseResult) : base(installCommand, parseResult) { - var nameResult = parseResult.GetResult(InstallCommand.NameArgument); + var nameResult = parseResult.GetResult(BaseInstallCommand.NameArgument); if (nameResult is null || nameResult.Errors.Any()) { - throw new ArgumentException($"{nameof(parseResult)} should contain at least one argument for {nameof(InstallCommand.NameArgument)}", nameof(parseResult)); + throw new ArgumentException($"{nameof(parseResult)} should contain at least one argument for {nameof(BaseInstallCommand.NameArgument)}", nameof(parseResult)); } - TemplatePackages = parseResult.GetValue(InstallCommand.NameArgument)!; + TemplatePackages = parseResult.GetValue(BaseInstallCommand.NameArgument)!; //workaround for --install source1 --install source2 case if (installCommand is LegacyInstallCommand && (TemplatePackages.Contains(installCommand.Name) || installCommand.Aliases.Any(alias => TemplatePackages.Contains(alias)))) @@ -25,7 +25,7 @@ public InstallCommandArgs(BaseInstallCommand installCommand, ParseResult parseRe if (!TemplatePackages.Any()) { - throw new ArgumentException($"{nameof(parseResult)} should contain at least one argument for {nameof(InstallCommand.NameArgument)}", nameof(parseResult)); + throw new ArgumentException($"{nameof(parseResult)} should contain at least one argument for {nameof(BaseInstallCommand.NameArgument)}", nameof(parseResult)); } Interactive = parseResult.GetValue(installCommand.InteractiveOption); diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/LegacyListCommand.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/LegacyListCommand.cs index 59a0c9839304..ebe50dcb2480 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/LegacyListCommand.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/LegacyListCommand.cs @@ -40,7 +40,7 @@ protected override Task ExecuteAsync(ListCommandArgs args, IEn private void ValidateParentCommandArguments(CommandResult commandResult) { var nameArgumentResult = commandResult.Children.FirstOrDefault( - symbol => symbol is ArgumentResult argumentResult && argumentResult.Argument == ListCommand.NameArgument); + symbol => symbol is ArgumentResult argumentResult && argumentResult.Argument == NameArgument); if (nameArgumentResult == null) { return; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/ListCommandArgs.cs b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/ListCommandArgs.cs index 146bbc1d6496..1e206c31f756 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/ListCommandArgs.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/Commands/list/ListCommandArgs.cs @@ -9,7 +9,7 @@ internal class ListCommandArgs : BaseFilterableArgs, ITabularOutputArgs { internal ListCommandArgs(BaseListCommand command, ParseResult parseResult) : base(command, parseResult) { - string? nameCriteria = parseResult.GetValue(ListCommand.NameArgument); + string? nameCriteria = parseResult.GetValue(BaseListCommand.NameArgument); if (!string.IsNullOrWhiteSpace(nameCriteria)) { ListNameCriteria = nameCriteria; @@ -28,7 +28,7 @@ internal ListCommandArgs(BaseListCommand command, ParseResult parseResult) : bas { Language = GetFilterValue(FilterOptionDefinition.LanguageFilter); } - IgnoreConstraints = parseResult.GetValue(ListCommand.IgnoreConstraintsOption); + IgnoreConstraints = parseResult.GetValue(BaseListCommand.IgnoreConstraintsOption); } public bool DisplayAllColumns { get; } diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/JExtensions.cs b/src/Cli/Microsoft.TemplateEngine.Cli/JExtensions.cs index 9e84ad6eca10..5cd2d77b6f96 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/JExtensions.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/JExtensions.cs @@ -208,7 +208,7 @@ internal static IReadOnlyList ArrayAsStrings(this JToken? token, string? internal static JObject ReadObject(this IPhysicalFileSystem fileSystem, string path) { using (Stream fileStream = fileSystem.OpenRead(path)) - using (var textReader = new StreamReader(fileStream, System.Text.Encoding.UTF8, true)) + using (var textReader = new StreamReader(fileStream, Encoding.UTF8, true)) using (var jsonReader = new JsonTextReader(textReader)) { return JObject.Load(jsonReader); @@ -218,7 +218,7 @@ internal static JObject ReadObject(this IPhysicalFileSystem fileSystem, string p internal static void WriteObject(this IPhysicalFileSystem fileSystem, string path, object obj) { using (Stream fileStream = fileSystem.CreateFile(path)) - using (var textWriter = new StreamWriter(fileStream, System.Text.Encoding.UTF8)) + using (var textWriter = new StreamWriter(fileStream, Encoding.UTF8)) using (var jsonWriter = new JsonTextWriter(textWriter)) { var serializer = new JsonSerializer(); diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateInvoker.cs b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateInvoker.cs index 5d623bfd3e92..aadf9c2f8f7f 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateInvoker.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateInvoker.cs @@ -250,10 +250,10 @@ private async Task CreateTemplateAsync(TemplateCommandArgs tem if (templatePackage != null) { Reporter.Output.WriteLine(LocalizableStrings.TemplateCreator_Hint_Uninstall); - Reporter.Output.WriteCommand(Example.For(templateArgs.ParseResult).WithArgument(UninstallCommand.NameArgument, templatePackage.DisplayName)); + Reporter.Output.WriteCommand(Example.For(templateArgs.ParseResult).WithArgument(BaseUninstallCommand.NameArgument, templatePackage.DisplayName)); Reporter.Output.WriteLine(); Reporter.Output.WriteLine(LocalizableStrings.TemplateCreator_Hint_Install); - Reporter.Output.WriteCommand(Example.For(templateArgs.ParseResult).WithArgument(InstallCommand.NameArgument, templatePackage.DisplayName)); + Reporter.Output.WriteCommand(Example.For(templateArgs.ParseResult).WithArgument(BaseInstallCommand.NameArgument, templatePackage.DisplayName)); Reporter.Output.WriteLine(); } return NewCommandStatus.NotFound; diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateListCoordinator.cs b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateListCoordinator.cs index e6661ed191dc..f79ff35dfa5d 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateListCoordinator.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateListCoordinator.cs @@ -77,7 +77,7 @@ internal async Task DisplayTemplateGroupListAsync( Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(SearchCommand.NameArgument)); + .WithArgument(BaseSearchCommand.NameArgument)); Reporter.Output.WriteLine(); return NewCommandStatus.Success; } @@ -109,7 +109,7 @@ internal async Task DisplayTemplateGroupListAsync( string.Format( LocalizableStrings.TemplateListCoordinator_Error_FailedConstraints, resolutionResult.ContraintsMismatchGroupCount, - ListCommand.IgnoreConstraintsOption.Name) + BaseListCommand.IgnoreConstraintsOption.Name) .Bold().Red()); } @@ -122,7 +122,7 @@ internal async Task DisplayTemplateGroupListAsync( Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(SearchCommand.NameArgument)); + .WithArgument(BaseSearchCommand.NameArgument)); } else { @@ -130,7 +130,7 @@ internal async Task DisplayTemplateGroupListAsync( Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(SearchCommand.NameArgument, args.ListNameCriteria)); + .WithArgument(BaseSearchCommand.NameArgument, args.ListNameCriteria)); } Reporter.Error.WriteLine(); return NewCommandStatus.NotFound; @@ -187,7 +187,7 @@ internal async Task DisplayCommandDescriptionAsync( Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(SearchCommand.NameArgument, "web")); + .WithArgument(BaseSearchCommand.NameArgument, "web")); Reporter.Output.WriteLine(); diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs b/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs index bd7de485dbaa..229cd0628a3c 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageCoordinator.cs @@ -152,7 +152,7 @@ internal void DisplayUpdateCheckResult(CheckUpdateResult versionCheckResult, ICo Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(InstallCommand.NameArgument, $"{versionCheckResult.TemplatePackage?.Identifier}::{versionCheckResult.LatestVersion}")); + .WithArgument(BaseInstallCommand.NameArgument, $"{versionCheckResult.TemplatePackage?.Identifier}::{versionCheckResult.LatestVersion}")); Reporter.Output.WriteLine(); } } @@ -171,7 +171,7 @@ internal void DisplayBuiltInPackagesCheckResult(string packageId, string version Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(UninstallCommand.NameArgument, packageId)); + .WithArgument(BaseUninstallCommand.NameArgument, packageId)); } /// @@ -635,7 +635,7 @@ private async Task ValidateInstallationRequestsAsync(InstallCommandArgs ar reporter.WriteCommand( Example .For(args.ParseResult) - .WithArgument(InstallCommand.NameArgument, installRequests.Select(ir => ir.DisplayName).ToArray()) + .WithArgument(BaseInstallCommand.NameArgument, installRequests.Select(ir => ir.DisplayName).ToArray()) .WithOption(SharedOptions.ForceOption)); return false; } @@ -736,7 +736,7 @@ private async Task ValidateInstallationRequestsAsync(InstallCommandArgs ar Example .For(commandArgs.ParseResult) .WithSubcommand() - .WithArgument(UninstallCommand.NameArgument)); + .WithArgument(BaseUninstallCommand.NameArgument)); } else { @@ -744,7 +744,7 @@ private async Task ValidateInstallationRequestsAsync(InstallCommandArgs ar Example .For(commandArgs.ParseResult) .WithSubcommand() - .WithArgument(UninstallCommand.NameArgument, managedPackages.First().Identifier)); + .WithArgument(BaseUninstallCommand.NameArgument, managedPackages.First().Identifier)); } //TODO: @@ -839,12 +839,12 @@ private void DisplayUpdateCheckResults(IEnumerable versionChe Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(InstallCommand.NameArgument, $"::")); + .WithArgument(BaseInstallCommand.NameArgument, $"::")); Reporter.Output.WriteCommand( Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(InstallCommand.NameArgument, $"{displayableResults.First().Identifier}::{displayableResults.First().LatestVersion}")); + .WithArgument(BaseInstallCommand.NameArgument, $"{displayableResults.First().Identifier}::{displayableResults.First().LatestVersion}")); Reporter.Output.WriteLine(); Reporter.Output.WriteLine(LocalizableStrings.TemplatePackageCoordinator_Update_Info_UpdateAllCommandHeader); Reporter.Output.WriteCommand( @@ -916,7 +916,7 @@ private async Task DisplayInstalledTemplatePackagesAsync(GlobalArgs args, Cancel Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(UninstallCommand.NameArgument, managedSource.Identifier), + .WithArgument(BaseUninstallCommand.NameArgument, managedSource.Identifier), indentLevel: 2); Reporter.Output.WriteLine(); @@ -998,7 +998,7 @@ private async Task DisplayInstallResultAsync(string packageToInstall, InstallerO string.Format( LocalizableStrings.TemplatePackageCoordinator_lnstall_Error_AlreadyInstalled, packageToInstall).Bold().Red()); - Reporter.Error.WriteLine(LocalizableStrings.TemplatePackageCoordinator_lnstall_Error_AlreadyInstalled_Hint, InstallCommand.ForceOption.Aliases.First()); + Reporter.Error.WriteLine(LocalizableStrings.TemplatePackageCoordinator_lnstall_Error_AlreadyInstalled_Hint, BaseInstallCommand.ForceOption.Aliases.First()); Reporter.Error.WriteCommand(Example.For(parseResult).WithArgument(BaseInstallCommand.NameArgument, packageToInstall).WithOption(BaseInstallCommand.ForceOption)); break; @@ -1091,7 +1091,7 @@ private IEnumerable LoadNuGetSources(IEnumerable? additio try { currentDirectory = Directory.GetCurrentDirectory(); - ISettings settings = global::NuGet.Configuration.Settings.LoadDefaultSettings(currentDirectory); + ISettings settings = Settings.LoadDefaultSettings(currentDirectory); PackageSourceProvider packageSourceProvider = new PackageSourceProvider(settings); defaultSources = packageSourceProvider.LoadPackageSources().Where(source => source.IsEnabled); if (includeNuGetFeed) diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageDisplay.cs b/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageDisplay.cs index 61577024e840..00d5ca56a413 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageDisplay.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/TemplatePackageDisplay.cs @@ -54,7 +54,7 @@ internal void DisplayUpdateCheckResult(CheckUpdateResult versionCheckResult, ICo Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(InstallCommand.NameArgument, $"{versionCheckResult.TemplatePackage?.Identifier}::{versionCheckResult.LatestVersion}")); + .WithArgument(BaseInstallCommand.NameArgument, $"{versionCheckResult.TemplatePackage?.Identifier}::{versionCheckResult.LatestVersion}")); _reporterOutput.WriteLine(); } } @@ -73,7 +73,7 @@ internal void DisplayBuiltInPackagesCheckResult(string packageId, string version Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(UninstallCommand.NameArgument, packageId)); + .WithArgument(BaseUninstallCommand.NameArgument, packageId)); } internal async Task DisplayInstallResultAsync( @@ -155,7 +155,7 @@ internal async Task DisplayInstallResultAsync( string.Format( LocalizableStrings.TemplatePackageCoordinator_lnstall_Error_AlreadyInstalled, packageToInstall).Bold().Red()); - _reporterError.WriteLine(LocalizableStrings.TemplatePackageCoordinator_lnstall_Error_AlreadyInstalled_Hint, InstallCommand.ForceOption.Name); + _reporterError.WriteLine(LocalizableStrings.TemplatePackageCoordinator_lnstall_Error_AlreadyInstalled_Hint, BaseInstallCommand.ForceOption.Name); _reporterError.WriteCommand(Example.For(parseResult).WithArgument(BaseInstallCommand.NameArgument, packageToInstall).WithOption(BaseInstallCommand.ForceOption)); break; @@ -266,7 +266,7 @@ internal async Task DisplayInstalledTemplatePackagesAsync(TemplatePackageManager Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(UninstallCommand.NameArgument, managedSource.Identifier), + .WithArgument(BaseUninstallCommand.NameArgument, managedSource.Identifier), indentLevel: 2); Reporter.Output.WriteLine(); @@ -302,12 +302,12 @@ internal void DisplayUpdateCheckResults(IEngineEnvironmentSettings engineEnviron Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(InstallCommand.NameArgument, $"::")); + .WithArgument(BaseInstallCommand.NameArgument, $"::")); Reporter.Output.WriteCommand( Example .For(args.ParseResult) .WithSubcommand() - .WithArgument(InstallCommand.NameArgument, $"{displayableResults.First().Identifier}::{displayableResults.First().LatestVersion}")); + .WithArgument(BaseInstallCommand.NameArgument, $"{displayableResults.First().Identifier}::{displayableResults.First().LatestVersion}")); Reporter.Output.WriteLine(); Reporter.Output.WriteLine(LocalizableStrings.TemplatePackageCoordinator_Update_Info_UpdateAllCommandHeader); Reporter.Output.WriteCommand( diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateResolution/TemplateResolutionResult.cs b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateResolution/TemplateResolutionResult.cs index 748912c26592..48f1b9d8cff5 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateResolution/TemplateResolutionResult.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateResolution/TemplateResolutionResult.cs @@ -293,7 +293,7 @@ internal bool IsParameterMismatchReason(string parameterName) matchInfo => matchInfo.GetType() == typeof(ParameterMatchInfo) && matchInfo.Name.Equals(parameterName, StringComparison.OrdinalIgnoreCase) - && matchInfo.Kind == Abstractions.TemplateFiltering.MatchKind.Mismatch))) + && matchInfo.Kind == MatchKind.Mismatch))) { return true; } diff --git a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateSearch/CliTemplateSearchCoordinator.cs b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateSearch/CliTemplateSearchCoordinator.cs index 13f7c996be91..43bc01cfb73b 100644 --- a/src/Cli/Microsoft.TemplateEngine.Cli/TemplateSearch/CliTemplateSearchCoordinator.cs +++ b/src/Cli/Microsoft.TemplateEngine.Cli/TemplateSearch/CliTemplateSearchCoordinator.cs @@ -94,13 +94,13 @@ internal static async Task SearchForTemplateMatchesAsync( Example .For(commandArgs.ParseResult) .WithSubcommand() - .WithArgument(InstallCommand.NameArgument)); + .WithArgument(BaseInstallCommand.NameArgument)); Reporter.Output.WriteLine(LocalizableStrings.Generic_ExampleHeader); Reporter.Output.WriteCommand( Example .For(commandArgs.ParseResult) .WithSubcommand() - .WithArgument(InstallCommand.NameArgument, packageIdToShow)); + .WithArgument(BaseInstallCommand.NameArgument, packageIdToShow)); return NewCommandStatus.Success; } return NewCommandStatus.NotFound; @@ -252,13 +252,13 @@ private static bool ValidateCommandInput(SearchCommandArgs commandArgs) // && !commandInput.RemainingParameters.Any()) { Reporter.Error.WriteLine(LocalizableStrings.CliTemplateSearchCoordinator_Error_NoTemplateName.Red().Bold()); - Reporter.Error.WriteLine(LocalizableStrings.CliTemplateSearchCoordinator_Info_SearchHelp, string.Join(", ", SearchCommand.SupportedFilters.Select(f => $"'{f.OptionFactory().Name}'"))); + Reporter.Error.WriteLine(LocalizableStrings.CliTemplateSearchCoordinator_Info_SearchHelp, string.Join(", ", BaseSearchCommand.SupportedFilters.Select(f => $"'{f.OptionFactory().Name}'"))); Reporter.Error.WriteLine(LocalizableStrings.Generic_ExamplesHeader); Reporter.Error.WriteCommand( Example .For(commandArgs.ParseResult) .WithSubcommand() - .WithArgument(SearchCommand.NameArgument, "web")); + .WithArgument(BaseSearchCommand.NameArgument, "web")); Reporter.Error.WriteCommand( Example @@ -270,7 +270,7 @@ private static bool ValidateCommandInput(SearchCommandArgs commandArgs) Example .For(commandArgs.ParseResult) .WithSubcommand() - .WithArgument(SearchCommand.NameArgument, "web") + .WithArgument(BaseSearchCommand.NameArgument, "web") .WithOption(SharedOptionsFactory.CreateLanguageOption(), "C#")); return false; diff --git a/src/Cli/dotnet-new3/HostFactory.cs b/src/Cli/dotnet-new3/HostFactory.cs index 14bd5fae50f7..8b66174da9a6 100644 --- a/src/Cli/dotnet-new3/HostFactory.cs +++ b/src/Cli/dotnet-new3/HostFactory.cs @@ -38,7 +38,7 @@ internal static CliTemplateEngineHost CreateHost(bool disableSdkTemplates, strin var builtIns = new List<(Type, IIdentifiedComponent)>(); builtIns.AddRange(Microsoft.TemplateEngine.Orchestrator.RunnableProjects.Components.AllComponents); builtIns.AddRange(Microsoft.TemplateEngine.Edge.Components.AllComponents); - builtIns.AddRange(Microsoft.TemplateEngine.Cli.Components.AllComponents); + builtIns.AddRange(Components.AllComponents); builtIns.AddRange(Microsoft.TemplateSearch.Common.Components.AllComponents); if (!disableSdkTemplates) { diff --git a/src/Cli/dotnet/AspNetCoreCertificateGenerator.cs b/src/Cli/dotnet/AspNetCoreCertificateGenerator.cs index 7f02b10866aa..304d52dca06d 100644 --- a/src/Cli/dotnet/AspNetCoreCertificateGenerator.cs +++ b/src/Cli/dotnet/AspNetCoreCertificateGenerator.cs @@ -10,7 +10,7 @@ public class AspNetCoreCertificateGenerator : IAspNetCoreCertificateGenerator public void GenerateAspNetCoreDevelopmentCertificate() { #if !EXCLUDE_ASPNETCORE - Microsoft.AspNetCore.DeveloperCertificates.XPlat.CertificateGenerator.GenerateAspNetHttpsCertificate(); + AspNetCore.DeveloperCertificates.XPlat.CertificateGenerator.GenerateAspNetHttpsCertificate(); #endif } } diff --git a/src/Cli/dotnet/CommonOptions.cs b/src/Cli/dotnet/CommonOptions.cs index 0f19604ab246..d8fcd5a41615 100644 --- a/src/Cli/dotnet/CommonOptions.cs +++ b/src/Cli/dotnet/CommonOptions.cs @@ -146,9 +146,9 @@ public static CliArgument DefaultToCurrentDirectory(this CliArgument - string.IsNullOrEmpty(parseResult.GetValue(CommonOptions.ArchitectureOption)) ? - parseResult.GetValue(CommonOptions.LongFormArchitectureOption) : - parseResult.GetValue(CommonOptions.ArchitectureOption); + string.IsNullOrEmpty(parseResult.GetValue(ArchitectureOption)) ? + parseResult.GetValue(LongFormArchitectureOption) : + parseResult.GetValue(ArchitectureOption); public static CliOption OperatingSystemOption = new ForwardedOption("--os") @@ -230,7 +230,7 @@ internal static string ResolveRidShorthandOptionsToRuntimeIdentifier(string os, public static string GetCurrentRuntimeId() { // Get the dotnet directory, while ignoring custom msbuild resolvers - string dotnetRootPath = Microsoft.DotNet.NativeWrapper.EnvironmentProvider.GetDotnetExeDirectory(key => + string dotnetRootPath = NativeWrapper.EnvironmentProvider.GetDotnetExeDirectory(key => key.Equals("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR", StringComparison.InvariantCultureIgnoreCase) ? null : Environment.GetEnvironmentVariable(key)); diff --git a/src/Cli/dotnet/CommonOptionsExtension.cs b/src/Cli/dotnet/CommonOptionsExtension.cs index 8578666f0787..0cfeda1a45d8 100644 --- a/src/Cli/dotnet/CommonOptionsExtension.cs +++ b/src/Cli/dotnet/CommonOptionsExtension.cs @@ -10,28 +10,28 @@ internal static class CommonOptionsExtension { public static LoggerVerbosity ToLoggerVerbosity(this VerbosityOptions verbosityOptions) { - LoggerVerbosity verbosity = Build.Framework.LoggerVerbosity.Normal; + LoggerVerbosity verbosity = LoggerVerbosity.Normal; switch (verbosityOptions) { case VerbosityOptions.d: case VerbosityOptions.detailed: - verbosity = Build.Framework.LoggerVerbosity.Detailed; + verbosity = LoggerVerbosity.Detailed; break; case VerbosityOptions.diag: case VerbosityOptions.diagnostic: - verbosity = Build.Framework.LoggerVerbosity.Diagnostic; + verbosity = LoggerVerbosity.Diagnostic; break; case VerbosityOptions.m: case VerbosityOptions.minimal: - verbosity = Build.Framework.LoggerVerbosity.Minimal; + verbosity = LoggerVerbosity.Minimal; break; case VerbosityOptions.n: case VerbosityOptions.normal: - verbosity = Build.Framework.LoggerVerbosity.Normal; + verbosity = LoggerVerbosity.Normal; break; case VerbosityOptions.q: case VerbosityOptions.quiet: - verbosity = Build.Framework.LoggerVerbosity.Quiet; + verbosity = LoggerVerbosity.Quiet; break; } return verbosity; diff --git a/src/Cli/dotnet/CommonOptionsFactory.cs b/src/Cli/dotnet/CommonOptionsFactory.cs index e65f3dae6188..e29b1acf5de8 100644 --- a/src/Cli/dotnet/CommonOptionsFactory.cs +++ b/src/Cli/dotnet/CommonOptionsFactory.cs @@ -17,7 +17,7 @@ internal static class CommonOptionsFactory /// public static CliOption CreateDiagnosticsOption(bool recursive) => new("--diagnostics", "-d") { - Description = Microsoft.DotNet.Tools.Help.LocalizableStrings.SDKDiagnosticsCommandDefinition, + Description = Tools.Help.LocalizableStrings.SDKDiagnosticsCommandDefinition, Recursive = recursive }; } diff --git a/src/Cli/dotnet/Installer/Windows/TimestampedFileLogger.cs b/src/Cli/dotnet/Installer/Windows/TimestampedFileLogger.cs index c606499ca841..47b8dcedcb47 100644 --- a/src/Cli/dotnet/Installer/Windows/TimestampedFileLogger.cs +++ b/src/Cli/dotnet/Installer/Windows/TimestampedFileLogger.cs @@ -132,7 +132,7 @@ private void ProcessLogRequests(object logPipeName) { // We'll block waiting for messages to arrive before sending them to the queue. We don't call LogMessage // directly since the external logger should have stamped the message with the process ID. - string msg = UTF8Encoding.UTF8.GetString(dispatcher.ReadMessage()); + string msg = Encoding.UTF8.GetString(dispatcher.ReadMessage()); if (!string.IsNullOrWhiteSpace(msg)) { diff --git a/src/Cli/dotnet/OptionForwardingExtensions.cs b/src/Cli/dotnet/OptionForwardingExtensions.cs index acdb4f7ac351..3864aaa26f71 100644 --- a/src/Cli/dotnet/OptionForwardingExtensions.cs +++ b/src/Cli/dotnet/OptionForwardingExtensions.cs @@ -43,7 +43,7 @@ public static ForwardedOption ForwardAsOutputPath(this ForwardedOption ForwardAsProperty(this ForwardedOption option) => option .SetForwardingFunction((optionVals) => optionVals - .SelectMany(Microsoft.DotNet.Cli.Utils.MSBuildPropertyParser.ParseProperties) + .SelectMany(Utils.MSBuildPropertyParser.ParseProperties) .Select(keyValue => $"{option.Name}:{keyValue.key}={keyValue.value}") ); diff --git a/src/Cli/dotnet/ParseResultExtensions.cs b/src/Cli/dotnet/ParseResultExtensions.cs index d7f50644a70a..34194f7ad3d3 100644 --- a/src/Cli/dotnet/ParseResultExtensions.cs +++ b/src/Cli/dotnet/ParseResultExtensions.cs @@ -29,7 +29,7 @@ public static void ShowHelp(this ParseResult parseResult) // since commands can have arguments, we must take those as well in order to get accurate help var tokenList = parseResult.Tokens.TakeWhile(token => token.Type == CliTokenType.Argument || token.Type == CliTokenType.Command || token.Type == CliTokenType.Directive).Select(t => t.Value).ToList(); tokenList.Add("-h"); - Parser.Instance.Parse(tokenList).Invoke(); + Instance.Parse(tokenList).Invoke(); } public static void ShowHelpOrErrorIfAppropriate(this ParseResult parseResult) @@ -89,19 +89,19 @@ public static string RootSubCommandResult(this ParseResult parseResult) public static bool IsDotnetBuiltInCommand(this ParseResult parseResult) { return string.IsNullOrEmpty(parseResult.RootSubCommandResult()) || - Parser.GetBuiltInCommand(parseResult.RootSubCommandResult()) != null; + GetBuiltInCommand(parseResult.RootSubCommandResult()) != null; } public static bool IsTopLevelDotnetCommand(this ParseResult parseResult) { - return parseResult.CommandResult.Command.Equals(Parser.RootCommand) && string.IsNullOrEmpty(parseResult.RootSubCommandResult()); + return parseResult.CommandResult.Command.Equals(RootCommand) && string.IsNullOrEmpty(parseResult.RootSubCommandResult()); } public static bool CanBeInvoked(this ParseResult parseResult) { - return Parser.GetBuiltInCommand(parseResult.RootSubCommandResult()) != null || + return GetBuiltInCommand(parseResult.RootSubCommandResult()) != null || parseResult.Tokens.Any(token => token.Type == CliTokenType.Directive) || - (parseResult.IsTopLevelDotnetCommand() && string.IsNullOrEmpty(parseResult.GetValue(Parser.DotnetSubCommand))); + (parseResult.IsTopLevelDotnetCommand() && string.IsNullOrEmpty(parseResult.GetValue(DotnetSubCommand))); } public static int HandleMissingCommand(this ParseResult parseResult) @@ -139,7 +139,7 @@ private static string GetSymbolResultValue(ParseResult parseResult, SymbolResult { if (symbolResult.Token() == default) { - return parseResult.GetResult(Parser.DotnetSubCommand)?.GetValueOrDefault(); + return parseResult.GetResult(DotnetSubCommand)?.GetValueOrDefault(); } else if (symbolResult.Token().Type.Equals(CliTokenType.Command)) { diff --git a/src/Cli/dotnet/PerformanceLogEventListener.cs b/src/Cli/dotnet/PerformanceLogEventListener.cs index 246fd8c534a9..fc96ee2e91b8 100644 --- a/src/Cli/dotnet/PerformanceLogEventListener.cs +++ b/src/Cli/dotnet/PerformanceLogEventListener.cs @@ -130,7 +130,7 @@ protected override void OnEventWritten(EventWrittenEventArgs eventData) s_builder.Clear(); } - s_builder.Append($"[{DateTime.UtcNow.ToString("o")}] Event={eventData.EventSource.Name}/{eventData.EventName} ProcessID={Environment.ProcessId} ThreadID={System.Threading.Thread.CurrentThread.ManagedThreadId}\t "); + s_builder.Append($"[{DateTime.UtcNow.ToString("o")}] Event={eventData.EventSource.Name}/{eventData.EventName} ProcessID={Environment.ProcessId} ThreadID={Thread.CurrentThread.ManagedThreadId}\t "); for (int i = 0; i < eventData.PayloadNames.Count; i++) { s_builder.Append($"{eventData.PayloadNames[i]}=\"{eventData.Payload[i]}\" "); diff --git a/src/Cli/dotnet/Program.cs b/src/Cli/dotnet/Program.cs index e756340ef336..c3afc0904c52 100644 --- a/src/Cli/dotnet/Program.cs +++ b/src/Cli/dotnet/Program.cs @@ -292,7 +292,7 @@ private static void ReportDotnetHomeUsage(IEnvironmentProvider provider) Reporter.Verbose.WriteLine( string.Format( - Utils.LocalizableStrings.DotnetCliHomeUsed, + LocalizableStrings.DotnetCliHomeUsed, home, CliFolderPathCalculator.DotnetHomeVariableName)); } diff --git a/src/Cli/dotnet/commands/InstallingWorkloadCommand.cs b/src/Cli/dotnet/commands/InstallingWorkloadCommand.cs index 3e44077fd323..2aba9f6b7885 100644 --- a/src/Cli/dotnet/commands/InstallingWorkloadCommand.cs +++ b/src/Cli/dotnet/commands/InstallingWorkloadCommand.cs @@ -140,7 +140,7 @@ protected async Task> GetDownloads(IEnumerable msbuildArgs, string msbuildPath = null) public static CleanCommand FromArgs(string[] args, string msbuildPath = null) { - var parser = Cli.Parser.Instance; + var parser = Parser.Instance; var result = parser.ParseFrom("dotnet clean", args); return FromParseResult(result, msbuildPath); } diff --git a/src/Cli/dotnet/commands/dotnet-complete/ParseCommand.cs b/src/Cli/dotnet/commands/dotnet-complete/ParseCommand.cs index 5d9e2961cd46..4a324fb51e3d 100644 --- a/src/Cli/dotnet/commands/dotnet-complete/ParseCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-complete/ParseCommand.cs @@ -12,7 +12,7 @@ public static int Run(ParseResult result) result.HandleDebugSwitch(); var tokens = result.Tokens.Skip(1).Select(t => t.Value).ToArray(); - var reparsed = Microsoft.DotNet.Cli.Parser.Instance.Parse(tokens); + var reparsed = Parser.Instance.Parse(tokens); Console.WriteLine(reparsed.ToString()); diff --git a/src/Cli/dotnet/commands/dotnet-format/FormatCommand.cs b/src/Cli/dotnet/commands/dotnet-format/FormatCommand.cs index 58ec4623f612..8f93537b72ff 100644 --- a/src/Cli/dotnet/commands/dotnet-format/FormatCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-format/FormatCommand.cs @@ -15,7 +15,7 @@ public FormatCommand(IEnumerable argsToForward) : base(argsToForward) public static FormatCommand FromArgs(string[] args) { - var parser = Cli.Parser.Instance; + var parser = Parser.Instance; var result = parser.ParseFrom("dotnet format", args); return FromParseResult(result); } diff --git a/src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs b/src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs index 756b4aa1a1f9..67d7264e8907 100644 --- a/src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs +++ b/src/Cli/dotnet/commands/dotnet-help/HelpCommand.cs @@ -107,7 +107,7 @@ public int Execute() private bool TryGetDocsLink(string commandName, out string docsLink) { - var command = Cli.Parser.GetBuiltInCommand(commandName); + var command = Parser.GetBuiltInCommand(commandName); if (command != null && command as DocumentedCommand != null) { docsLink = (command as DocumentedCommand).DocsLink; diff --git a/src/Cli/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs b/src/Cli/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs index 0901f459fb3a..f67488cf755b 100644 --- a/src/Cli/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs +++ b/src/Cli/dotnet/commands/dotnet-msbuild/MSBuildForwardingApp.cs @@ -76,7 +76,7 @@ private void InitializeRequiredEnvironmentVariables() internal string GetArgumentsToMSBuild() { var argumentsUnescaped = _forwardingAppWithoutLogging.GetAllArguments(); - return Cli.Utils.ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(argumentsUnescaped); + return ArgumentEscaper.EscapeAndConcatenateArgArrayForProcessStart(argumentsUnescaped); } public virtual int Execute() diff --git a/src/Cli/dotnet/commands/dotnet-msbuild/Program.cs b/src/Cli/dotnet/commands/dotnet-msbuild/Program.cs index 3bf8df7639db..b24090f78cca 100644 --- a/src/Cli/dotnet/commands/dotnet-msbuild/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-msbuild/Program.cs @@ -17,7 +17,7 @@ public MSBuildCommand public static MSBuildCommand FromArgs(string[] args, string msbuildPath = null) { - var parser = Cli.Parser.Instance; + var parser = Parser.Instance; var result = parser.ParseFrom("dotnet msbuild", args); return FromParseResult(result, msbuildPath); } diff --git a/src/Cli/dotnet/commands/dotnet-new/NewCommandParser.cs b/src/Cli/dotnet/commands/dotnet-new/NewCommandParser.cs index 8ac51699c8a9..e70fb6147ad9 100644 --- a/src/Cli/dotnet/commands/dotnet-new/NewCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-new/NewCommandParser.cs @@ -133,10 +133,10 @@ private static CliTemplateEngineHost CreateHost( LogLevel logLevel) { var builtIns = new List<(Type InterfaceType, IIdentifiedComponent Instance)>(); - builtIns.AddRange(Microsoft.TemplateEngine.Orchestrator.RunnableProjects.Components.AllComponents); - builtIns.AddRange(Microsoft.TemplateEngine.Edge.Components.AllComponents); - builtIns.AddRange(Microsoft.TemplateEngine.Cli.Components.AllComponents); - builtIns.AddRange(Microsoft.TemplateSearch.Common.Components.AllComponents); + builtIns.AddRange(TemplateEngine.Orchestrator.RunnableProjects.Components.AllComponents); + builtIns.AddRange(TemplateEngine.Edge.Components.AllComponents); + builtIns.AddRange(Components.AllComponents); + builtIns.AddRange(TemplateSearch.Common.Components.AllComponents); //post actions builtIns.AddRange(new (Type, IIdentifiedComponent)[] diff --git a/src/Cli/dotnet/commands/dotnet-new/SdkInfoProvider.cs b/src/Cli/dotnet/commands/dotnet-new/SdkInfoProvider.cs index 3eeb81175a3f..157070ccb9d5 100644 --- a/src/Cli/dotnet/commands/dotnet-new/SdkInfoProvider.cs +++ b/src/Cli/dotnet/commands/dotnet-new/SdkInfoProvider.cs @@ -32,7 +32,7 @@ public Task GetCurrentVersionAsync(CancellationToken cancellationToken) public Task> GetInstalledVersionsAsync(CancellationToken cancellationToken) { // Get the dotnet directory, while ignoring custom msbuild resolvers - string dotnetDir = Microsoft.DotNet.NativeWrapper.EnvironmentProvider.GetDotnetExeDirectory( + string dotnetDir = NativeWrapper.EnvironmentProvider.GetDotnetExeDirectory( key => key.Equals("DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR", StringComparison.InvariantCultureIgnoreCase) ? null diff --git a/src/Cli/dotnet/commands/dotnet-test/Program.cs b/src/Cli/dotnet/commands/dotnet-test/Program.cs index f50519454c8f..f2f45850d018 100644 --- a/src/Cli/dotnet/commands/dotnet-test/Program.cs +++ b/src/Cli/dotnet/commands/dotnet-test/Program.cs @@ -105,7 +105,7 @@ private static int ForwardToVSTestConsole(ParseResult parseResult, string[] args public static TestCommand FromArgs(string[] args, string testSessionCorrelationId = null, string msbuildPath = null) { - var parser = Microsoft.DotNet.Cli.Parser.Instance; + var parser = Parser.Instance; var parseResult = parser.ParseFrom("dotnet test", args); // settings parameters are after -- (including --), these should not be considered by the parser diff --git a/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs b/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs index 84ae50fe0c3a..cee33cc46261 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/WorkloadCommandParser.cs @@ -40,7 +40,7 @@ internal static void ShowWorkloadsInfo(ParseResult parseResult = null, IWorkload } IEnumerable installedList = workloadInfoHelper.InstalledSdkWorkloadIds; InstalledWorkloadsCollection installedWorkloads = workloadInfoHelper.AddInstalledVsWorkloads(installedList); - reporter ??= Cli.Utils.Reporter.Output; + reporter ??= Utils.Reporter.Output; string dotnetPath = dotnetDir ?? Path.GetDirectoryName(Environment.ProcessPath); if (installedWorkloads.Count == 0) @@ -82,7 +82,7 @@ private static int ProcessArgs(ParseResult parseResult) if (parseResult.HasOption(InfoOption) && parseResult.RootSubCommandResult() == "workload") { ShowWorkloadsInfo(parseResult); - Cli.Utils.Reporter.Output.WriteLine(""); + Utils.Reporter.Output.WriteLine(""); return 0; } return parseResult.HandleMissingCommand(); diff --git a/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs b/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs index da18d53e4e6d..a31d54776a7e 100644 --- a/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs +++ b/src/Cli/dotnet/commands/dotnet-workload/install/WorkloadManifestUpdater.cs @@ -88,7 +88,7 @@ public async static Task BackgroundUpdateAdvertisingManifestsAsync(string userPr { try { - var manifestUpdater = WorkloadManifestUpdater.GetInstance(userProfileDir); + var manifestUpdater = GetInstance(userProfileDir); await manifestUpdater.BackgroundUpdateAdvertisingManifestsWhenRequiredAsync(); } catch (Exception) diff --git a/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/KnownLocalRegistryTypes.cs b/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/KnownLocalRegistryTypes.cs index 10eee68ae2a2..bb50404e2956 100644 --- a/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/KnownLocalRegistryTypes.cs +++ b/src/Containers/Microsoft.NET.Build.Containers/LocalDaemons/KnownLocalRegistryTypes.cs @@ -22,13 +22,13 @@ internal static ILocalRegistry CreateLocalRegistry(string? type, ILoggerFactory return type switch { - KnownLocalRegistryTypes.Podman => new DockerCli(DockerCli.PodmanCommand, loggerFactory), - KnownLocalRegistryTypes.Docker => new DockerCli(DockerCli.DockerCommand, loggerFactory), + Podman => new DockerCli(DockerCli.PodmanCommand, loggerFactory), + Docker => new DockerCli(DockerCli.DockerCommand, loggerFactory), _ => throw new NotSupportedException( Resource.FormatString( nameof(Strings.UnknownLocalRegistryType), type, - string.Join(",", KnownLocalRegistryTypes.SupportedLocalRegistryTypes))) + string.Join(",", SupportedLocalRegistryTypes))) }; } } diff --git a/src/Layout/toolset-tasks/OverrideAndCreateBundledNETCoreAppPackageVersion.cs b/src/Layout/toolset-tasks/OverrideAndCreateBundledNETCoreAppPackageVersion.cs index 5c64420d60c8..07684e9cfe30 100644 --- a/src/Layout/toolset-tasks/OverrideAndCreateBundledNETCoreAppPackageVersion.cs +++ b/src/Layout/toolset-tasks/OverrideAndCreateBundledNETCoreAppPackageVersion.cs @@ -140,7 +140,7 @@ void CheckAndReplaceAttribute(XAttribute attribute) /// private static bool IsSDKServicing(string sdkVersion) { - var parsedSdkVersion = NuGet.Versioning.NuGetVersion.Parse(sdkVersion); + var parsedSdkVersion = NuGetVersion.Parse(sdkVersion); return parsedSdkVersion.Patch % 100 != 0; } diff --git a/src/Layout/toolset-tasks/PublishMutationUtilities.cs b/src/Layout/toolset-tasks/PublishMutationUtilities.cs index 8f152b58d003..92d4e280c47c 100644 --- a/src/Layout/toolset-tasks/PublishMutationUtilities.cs +++ b/src/Layout/toolset-tasks/PublishMutationUtilities.cs @@ -14,7 +14,7 @@ public static void ChangeEntryPointLibraryName(string depsFile, string newName) using (var file = File.OpenText(depsFile)) using (JsonTextReader reader = new JsonTextReader(file)) { - deps = JObject.ReadFrom(reader); + deps = JToken.ReadFrom(reader); } string version = null; diff --git a/src/Layout/toolset-tasks/RemoveAssetFromDepsPackages.cs b/src/Layout/toolset-tasks/RemoveAssetFromDepsPackages.cs index 081110328605..f1ce0729a2be 100644 --- a/src/Layout/toolset-tasks/RemoveAssetFromDepsPackages.cs +++ b/src/Layout/toolset-tasks/RemoveAssetFromDepsPackages.cs @@ -31,7 +31,7 @@ public static void DoRemoveAssetFromDepsPackages(string depsFile, string section using (var file = File.OpenText(depsFile)) using (JsonTextReader reader = new JsonTextReader(file)) { - deps = JObject.ReadFrom(reader); + deps = JToken.ReadFrom(reader); } foreach (JProperty target in deps["targets"]) diff --git a/src/Layout/toolset-tasks/UpdatePortableRuntimeIdentifierGraph.cs b/src/Layout/toolset-tasks/UpdatePortableRuntimeIdentifierGraph.cs index ab0f613e2692..764af1311983 100644 --- a/src/Layout/toolset-tasks/UpdatePortableRuntimeIdentifierGraph.cs +++ b/src/Layout/toolset-tasks/UpdatePortableRuntimeIdentifierGraph.cs @@ -34,7 +34,7 @@ public override bool Execute() using (var file = File.OpenText(InputFile)) using (JsonTextReader reader = new JsonTextReader(file)) { - json = JObject.ReadFrom(reader); + json = JToken.ReadFrom(reader); } JObject runtimes = (JObject)json["runtimes"]; diff --git a/src/RazorSdk/Tool/ConcurrentLruCache.cs b/src/RazorSdk/Tool/ConcurrentLruCache.cs index 3d910698b37b..e08064d89d77 100644 --- a/src/RazorSdk/Tool/ConcurrentLruCache.cs +++ b/src/RazorSdk/Tool/ConcurrentLruCache.cs @@ -139,7 +139,7 @@ private bool UnsafeTryGetValue(TKey key, out TValue value) private void MoveNodeToTop(LinkedListNode node) { - if (!object.ReferenceEquals(_nodeList.First, node)) + if (!ReferenceEquals(_nodeList.First, node)) { _nodeList.Remove(node); _nodeList.AddFirst(node); diff --git a/src/RazorSdk/Tool/GenerateCommand.cs b/src/RazorSdk/Tool/GenerateCommand.cs index 6383ec075434..f3399f5d9d29 100644 --- a/src/RazorSdk/Tool/GenerateCommand.cs +++ b/src/RazorSdk/Tool/GenerateCommand.cs @@ -331,9 +331,9 @@ private static SourceItem[] GetSourceItems(List sources, List ou for (var i = 0; i < items.Length; i++) { var fileKind = fileKinds.Count > 0 ? fileKinds[i] : "mvc"; - if (Microsoft.AspNetCore.Razor.Language.FileKinds.IsComponent(fileKind)) + if (AspNetCore.Razor.Language.FileKinds.IsComponent(fileKind)) { - fileKind = Microsoft.AspNetCore.Razor.Language.FileKinds.GetComponentFileKindFromFilePath(sources[i]); + fileKind = AspNetCore.Razor.Language.FileKinds.GetComponentFileKindFromFilePath(sources[i]); } var cssScopeValue = cssScopeAssociations.TryGetValue(sources[i], out var cssScopeIndex) diff --git a/src/RazorSdk/Tool/ServerProtocol/ServerConnection.cs b/src/RazorSdk/Tool/ServerProtocol/ServerConnection.cs index e607fe5a1525..0696ec173bd3 100644 --- a/src/RazorSdk/Tool/ServerProtocol/ServerConnection.cs +++ b/src/RazorSdk/Tool/ServerProtocol/ServerConnection.cs @@ -286,7 +286,7 @@ internal static bool TryCreateServerCore(string clientDir, string pipeName, out if (string.IsNullOrEmpty(expectedPath)) { #if NET - expectedPath = System.Environment.ProcessPath; + expectedPath = Environment.ProcessPath; #else expectedPath = Process.GetCurrentProcess().MainModule.FileName; #endif diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.GlobalJsonReader.cs b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.GlobalJsonReader.cs index 43dd03f24073..4eda66df1eb4 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.GlobalJsonReader.cs +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.GlobalJsonReader.cs @@ -35,7 +35,7 @@ static class GlobalJsonReader }; var reader = new Utf8JsonStreamReader(fileStream, readerOptions); #else - using var textReader = new StreamReader(fileStream, System.Text.Encoding.UTF8, true); + using var textReader = new StreamReader(fileStream, Encoding.UTF8, true); using var jsonReader = new JsonTextReader(textReader); var reader = new Utf8JsonStreamReader(jsonReader); diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.InstallStateReader.cs b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.InstallStateReader.cs index 3eb34eafc36e..720427e10711 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.InstallStateReader.cs +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/SdkDirectoryWorkloadManifestProvider.InstallStateReader.cs @@ -37,7 +37,7 @@ public static InstallState ReadInstallState(string installStatePath) }; var reader = new Utf8JsonStreamReader(fileStream, readerOptions); #else - using var textReader = new StreamReader(fileStream, System.Text.Encoding.UTF8, true); + using var textReader = new StreamReader(fileStream, Encoding.UTF8, true); using var jsonReader = new JsonTextReader(textReader); var reader = new Utf8JsonStreamReader(jsonReader); diff --git a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadManifestReader.NewtonsoftJson.cs b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadManifestReader.NewtonsoftJson.cs index 7e987b182f05..5cf8e46ce734 100644 --- a/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadManifestReader.NewtonsoftJson.cs +++ b/src/Resolvers/Microsoft.NET.Sdk.WorkloadManifestReader/WorkloadManifestReader.NewtonsoftJson.cs @@ -17,7 +17,7 @@ public partial class WorkloadManifestReader { public static WorkloadManifest ReadWorkloadManifest(string manifestId, Stream manifestStream, Stream? localizationStream, string manifestPath) { - using var textReader = new StreamReader(manifestStream, System.Text.Encoding.UTF8, true); + using var textReader = new StreamReader(manifestStream, Encoding.UTF8, true); using var jsonReader = new JsonTextReader(textReader); var manifestReader = new Utf8JsonStreamReader(jsonReader); @@ -32,7 +32,7 @@ public static WorkloadManifest ReadWorkloadManifest(string manifestId, Stream ma return null; } - using var textReader = new StreamReader(localizationStream, System.Text.Encoding.UTF8, true); + using var textReader = new StreamReader(localizationStream, Encoding.UTF8, true); using var jsonReader = new JsonTextReader(textReader); var localizationReader = new Utf8JsonStreamReader(jsonReader); diff --git a/src/StaticWebAssetsSdk/Tasks/GZipCompress.cs b/src/StaticWebAssetsSdk/Tasks/GZipCompress.cs index 69b36cb58524..ec0d3d565ac8 100644 --- a/src/StaticWebAssetsSdk/Tasks/GZipCompress.cs +++ b/src/StaticWebAssetsSdk/Tasks/GZipCompress.cs @@ -24,7 +24,7 @@ public override bool Execute() Log.LogMessage(MessageImportance.Low, "Created directory '{0}'.", outputDirectory); } - System.Threading.Tasks.Parallel.For(0, FilesToCompress.Length, i => + Parallel.For(0, FilesToCompress.Length, i => { var file = FilesToCompress[i]; var outputRelativePath = file.ItemSpec; diff --git a/src/StaticWebAssetsSdk/Tasks/RewriteCss.cs b/src/StaticWebAssetsSdk/Tasks/RewriteCss.cs index 9619b6b9ccde..2d4ca0696d4c 100644 --- a/src/StaticWebAssetsSdk/Tasks/RewriteCss.cs +++ b/src/StaticWebAssetsSdk/Tasks/RewriteCss.cs @@ -33,7 +33,7 @@ public override bool Execute() { var allDiagnostics = new ConcurrentQueue(); - System.Threading.Tasks.Parallel.For(0, FilesToTransform.Length, i => + Parallel.For(0, FilesToTransform.Length, i => { var input = FilesToTransform[i]; var inputFile = input.GetMetadata("FullPath"); diff --git a/src/StaticWebAssetsSdk/Tasks/StaticWebAsset.cs b/src/StaticWebAssetsSdk/Tasks/StaticWebAsset.cs index 0f1e3226a643..0b8c97ff1f44 100644 --- a/src/StaticWebAssetsSdk/Tasks/StaticWebAsset.cs +++ b/src/StaticWebAssetsSdk/Tasks/StaticWebAsset.cs @@ -348,7 +348,7 @@ internal static StaticWebAsset FromProperties( } internal bool HasSourceId(string source) => - StaticWebAsset.HasSourceId(SourceId, source); + HasSourceId(SourceId, source); public void Normalize() { diff --git a/src/Tasks/Common/ConflictResolution/ConflictResolver.cs b/src/Tasks/Common/ConflictResolution/ConflictResolver.cs index 50978c8c4777..f8bdb28a4028 100644 --- a/src/Tasks/Common/ConflictResolution/ConflictResolver.cs +++ b/src/Tasks/Common/ConflictResolution/ConflictResolver.cs @@ -108,7 +108,7 @@ public void ResolveConflicts(IEnumerable conflictItems, Funcproject dependency, and the logic is straightforward enough. private static string HashWithNormalizedCasing(string text) { - var utf8UpperBytes = System.Text.Encoding.UTF8.GetBytes(text.ToUpperInvariant()); + var utf8UpperBytes = Encoding.UTF8.GetBytes(text.ToUpperInvariant()); #if NETFRAMEWORK var crypt = System.Security.Cryptography.SHA256.Create(); var hash = new System.Text.StringBuilder(); diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/LockFileCache.cs b/src/Tasks/Microsoft.NET.Build.Tasks/LockFileCache.cs index 6fb82b8b7227..065f017f3fa5 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/LockFileCache.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/LockFileCache.cs @@ -129,7 +129,7 @@ public override void Log(ILogMessage message) public override System.Threading.Tasks.Task LogAsync(ILogMessage message) { Log(message); - return System.Threading.Tasks.Task.CompletedTask; + return Task.CompletedTask; } } } diff --git a/src/Tasks/Microsoft.NET.Build.Tasks/ShowMissingWorkloads.cs b/src/Tasks/Microsoft.NET.Build.Tasks/ShowMissingWorkloads.cs index 447b412b5f97..311da036ec3f 100644 --- a/src/Tasks/Microsoft.NET.Build.Tasks/ShowMissingWorkloads.cs +++ b/src/Tasks/Microsoft.NET.Build.Tasks/ShowMissingWorkloads.cs @@ -43,7 +43,7 @@ protected override void ExecuteCore() string globalJsonPath = SdkDirectoryWorkloadManifestProvider.GetGlobalJsonPath(Environment.CurrentDirectory); var workloadManifestProvider = new SdkDirectoryWorkloadManifestProvider(NetCoreRoot, NETCoreSdkVersion, userProfileDir, globalJsonPath); - var workloadResolver = WorkloadResolver.Create(workloadManifestProvider, NetCoreRoot, NETCoreSdkVersion, userProfileDir); + var workloadResolver = Create(workloadManifestProvider, NetCoreRoot, NETCoreSdkVersion, userProfileDir); var suggestedWorkloads = workloadResolver.GetWorkloadSuggestionForMissingPacks( MissingWorkloadPacks.Select(item => new WorkloadPackId(item.ItemSpec)).ToList(), diff --git a/src/Tests/HelixTasks/TarGzFileCreateFromDirectory.cs b/src/Tests/HelixTasks/TarGzFileCreateFromDirectory.cs index c84656185c45..01333b0da384 100644 --- a/src/Tests/HelixTasks/TarGzFileCreateFromDirectory.cs +++ b/src/Tests/HelixTasks/TarGzFileCreateFromDirectory.cs @@ -149,7 +149,7 @@ private string GetExcludes() protected override void LogToolCommand(string message) { - base.LogToolCommand($"{base.GetWorkingDirectory()}> {message}"); + base.LogToolCommand($"{GetWorkingDirectory()}> {message}"); } } } diff --git a/src/Tests/Microsoft.DotNet.Cli.Utils.Tests/TypoCorrectionTests.cs b/src/Tests/Microsoft.DotNet.Cli.Utils.Tests/TypoCorrectionTests.cs index f74fa1853a1d..b58a85fffdcc 100644 --- a/src/Tests/Microsoft.DotNet.Cli.Utils.Tests/TypoCorrectionTests.cs +++ b/src/Tests/Microsoft.DotNet.Cli.Utils.Tests/TypoCorrectionTests.cs @@ -30,7 +30,7 @@ public class TypoCorrectionTests public void TypoCorrection_BasicTest(string token, string possibleTokens, string expectedTokens, string checkedScenario) { TypoCorrection.GetSimilarTokens(possibleTokens.Split('|'), token) - .Should().BeEquivalentTo(expectedTokens.Split('|', System.StringSplitOptions.RemoveEmptyEntries), checkedScenario); + .Should().BeEquivalentTo(expectedTokens.Split('|', StringSplitOptions.RemoveEmptyEntries), checkedScenario); } } } diff --git a/src/Tests/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurerWIthStateSetup.cs b/src/Tests/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurerWIthStateSetup.cs index 24d5c00bc4ee..0ca75db0e22d 100644 --- a/src/Tests/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurerWIthStateSetup.cs +++ b/src/Tests/Microsoft.DotNet.Configurer.UnitTests/GivenADotnetFirstTimeUseConfigurerWIthStateSetup.cs @@ -101,7 +101,7 @@ var aspnetCertInstalledTime var printFirstTimeWelcomeMessage = new FirstRunExperienceAction( () => _reporterMock.Lines.Contains(string.Format( - Configurer.LocalizableStrings.FirstTimeMessageWelcome, + LocalizableStrings.FirstTimeMessageWelcome, DotnetFirstTimeUseConfigurer.ParseDotNetVersion(Product.Version), Product.Version)) && _reporterMock.Lines.Contains(LocalizableStrings.FirstTimeMessageMoreInformation), @@ -165,9 +165,9 @@ public void EvaluateAfterFirstRun() public void EvaluateAfterSecondRun() { - if (ActionCalledTime != ActionCalledTime.FirstRun && _tellTheActionIsRun()) + if (ActionCalledTime != FirstRun && _tellTheActionIsRun()) { - ActionCalledTime = ActionCalledTime.SecondRun; + ActionCalledTime = SecondRun; } } @@ -183,9 +183,9 @@ public void Assert(ActionCalledTime expectedActionCalledTime) private static ActionCalledTime GetCalledTime(bool predicate, ActionCalledTime actionCalledTime) { - if (actionCalledTime != ActionCalledTime.FirstRun && predicate) + if (actionCalledTime != FirstRun && predicate) { - actionCalledTime = ActionCalledTime.SecondRun; + actionCalledTime = SecondRun; } return actionCalledTime; diff --git a/src/Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs b/src/Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs index 1e04056026b7..64b82b772f1f 100644 --- a/src/Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs +++ b/src/Tests/Microsoft.DotNet.MSBuildSdkResolver.Tests/GivenAnMSBuildSdkResolver.cs @@ -708,7 +708,7 @@ public void CreateVSSettingsFile(bool disallowPreviews) return; } - System.Threading.Thread.Sleep(sleep); + Thread.Sleep(sleep); } throw new InvalidOperationException("LastWriteTime is not changing."); diff --git a/src/Tests/Microsoft.DotNet.PackageInstall.Tests/ToolPackageInstallerTests.cs b/src/Tests/Microsoft.DotNet.PackageInstall.Tests/ToolPackageInstallerTests.cs index 077a762784a3..76eeda2c86b7 100644 --- a/src/Tests/Microsoft.DotNet.PackageInstall.Tests/ToolPackageInstallerTests.cs +++ b/src/Tests/Microsoft.DotNet.PackageInstall.Tests/ToolPackageInstallerTests.cs @@ -47,7 +47,7 @@ public void GivenNoFeedInstallFailsWithException(bool testMockBehaviorIsInSync) Action a = () => installer.InstallPackage(new PackageLocation(), packageId: TestPackageId, versionRange: VersionRange.Parse(TestPackageVersion), targetFramework: _testTargetframework); - a.Should().Throw().WithMessage(Tools.Tool.Install.LocalizableStrings.ToolInstallationRestoreFailed); + a.Should().Throw().WithMessage(LocalizableStrings.ToolInstallationRestoreFailed); reporter.Lines.Count.Should().Be(1); reporter.Lines[0].Should().Contain(TestPackageId.ToString()); @@ -460,7 +460,7 @@ public void GivenFailedRestoreInstallWillRollback(bool testMockBehaviorIsInSync) } }; - a.Should().Throw().WithMessage(Tools.Tool.Install.LocalizableStrings.ToolInstallationRestoreFailed); + a.Should().Throw().WithMessage(LocalizableStrings.ToolInstallationRestoreFailed); AssertInstallRollBack(fileSystem, store); } diff --git a/src/Tests/Microsoft.NET.Build.Containers.IntegrationTests/TargetsTests.cs b/src/Tests/Microsoft.NET.Build.Containers.IntegrationTests/TargetsTests.cs index 2f90edad0631..a73bfbd2caa3 100644 --- a/src/Tests/Microsoft.NET.Build.Containers.IntegrationTests/TargetsTests.cs +++ b/src/Tests/Microsoft.NET.Build.Containers.IntegrationTests/TargetsTests.cs @@ -38,7 +38,7 @@ public void CanDeferToContainerImageNameWhenPresent() [ContainerImageName] = customImageName }); using var _ = d; - var instance = project.CreateProjectInstance(global::Microsoft.Build.Execution.ProjectInstanceSettings.None); + var instance = project.CreateProjectInstance(ProjectInstanceSettings.None); instance.Build(new[] { ComputeContainerConfig }, new[] { logger }); logger.Warnings.Should().HaveCount(1, "a warning for the use of the old ContainerImageName property should have been created"); logger.Warnings[0].Code.Should().Be(KnownStrings.ErrorCodes.CONTAINER003); @@ -58,7 +58,7 @@ public void CanNormalizeInputContainerNames(string projectName, string expectedC [AssemblyName] = projectName }, projectName: $"{nameof(CanNormalizeInputContainerNames)}_{projectName}_{expectedContainerImageName}_{shouldPass}"); using var _ = d; - var instance = project.CreateProjectInstance(global::Microsoft.Build.Execution.ProjectInstanceSettings.None); + var instance = project.CreateProjectInstance(ProjectInstanceSettings.None); instance.Build(new[] { ComputeContainerConfig }, new[] { logger }, null, out var outputs).Should().Be(shouldPass, String.Join(Environment.NewLine, logger.AllMessages)); Assert.Equal(expectedContainerImageName, instance.GetPropertyValue(ContainerRepository)); } @@ -78,7 +78,7 @@ public void CanWarnOnInvalidSDKVersions(string sdkVersion, bool isAllowed) ["PublishProfile"] = "DefaultContainer" }, projectName: $"{nameof(CanWarnOnInvalidSDKVersions)}_{sdkVersion}_{isAllowed}"); using var _ = d; - var instance = project.CreateProjectInstance(global::Microsoft.Build.Execution.ProjectInstanceSettings.None); + var instance = project.CreateProjectInstance(ProjectInstanceSettings.None); instance.Build(new[] { "_ContainerVerifySDKVersion" }, new[] { logger }, null, out var outputs).Should().Be(isAllowed); var derivedIsAllowed = Boolean.Parse(project.GetProperty("_IsSDKContainerAllowedVersion").EvaluatedValue); if (isAllowed) @@ -103,7 +103,7 @@ public void GetsConventionalLabelsByDefault(bool shouldEvaluateLabels) [ContainerGenerateLabels] = shouldEvaluateLabels.ToString() }, projectName: $"{nameof(GetsConventionalLabelsByDefault)}_{shouldEvaluateLabels}"); using var _ = d; - var instance = project.CreateProjectInstance(global::Microsoft.Build.Execution.ProjectInstanceSettings.None); + var instance = project.CreateProjectInstance(ProjectInstanceSettings.None); instance.Build(new[] { ComputeContainerConfig }, new[] { logger }, null, out var outputs).Should().BeTrue("Build should have succeeded"); if (shouldEvaluateLabels) { @@ -132,7 +132,7 @@ public void ShouldNotIncludeSourceControlLabelsUnlessUserOptsIn(bool includeSour ["SourceRevisionId"] = commitHash }, projectName: $"{nameof(ShouldNotIncludeSourceControlLabelsUnlessUserOptsIn)}_{includeSourceControl}"); using var _ = d; - var instance = project.CreateProjectInstance(global::Microsoft.Build.Execution.ProjectInstanceSettings.None); + var instance = project.CreateProjectInstance(ProjectInstanceSettings.None); instance.Build(new[] { ComputeContainerConfig }, new[] { logger }, null, out var outputs).Should().BeTrue("Build should have succeeded but failed due to {0}", String.Join("\n", logger.AllMessages)); var labels = instance.GetItems(ContainerLabel); if (includeSourceControl) @@ -178,7 +178,7 @@ public void CanComputeTagsForSupportedSDKVersions(string sdkVersion, string tfm, ["PublishProfile"] = "DefaultContainer" }, projectName: $"{nameof(CanComputeTagsForSupportedSDKVersions)}_{sdkVersion}_{tfm}_{expectedTag}"); using var _ = d; - var instance = project.CreateProjectInstance(global::Microsoft.Build.Execution.ProjectInstanceSettings.None); + var instance = project.CreateProjectInstance(ProjectInstanceSettings.None); instance.Build(new[] { "_ComputeContainerBaseImageTag" }, new[] { logger }, null, out var outputs).Should().BeTrue(String.Join(Environment.NewLine, logger.Errors)); var computedTag = instance.GetProperty("_ContainerBaseImageTag").EvaluatedValue; computedTag.Should().Be(expectedTag); @@ -201,7 +201,7 @@ public void CanComputeContainerUser(string tfm, string rid, string expectedUser) ["ContainerRuntimeIdentifier"] = rid }, projectName: $"{nameof(CanComputeContainerUser)}_{tfm}_{rid}_{expectedUser}"); using var _ = d; - var instance = project.CreateProjectInstance(global::Microsoft.Build.Execution.ProjectInstanceSettings.None); + var instance = project.CreateProjectInstance(ProjectInstanceSettings.None); instance.Build(new[] { ComputeContainerConfig }, new[] { logger }, null, out var outputs).Should().BeTrue(String.Join(Environment.NewLine, logger.Errors)); var computedTag = instance.GetProperty("ContainerUser")?.EvaluatedValue; computedTag.Should().Be(expectedUser); @@ -220,9 +220,9 @@ public void WindowsUsersGetLinuxContainers(string sdkPortableRid, string expecte ["NETCoreSdkPortableRuntimeIdentifier"] = sdkPortableRid }, projectName: $"{nameof(WindowsUsersGetLinuxContainers)}_{sdkPortableRid}_{expectedRid}"); using var _ = d; - var instance = project.CreateProjectInstance(global::Microsoft.Build.Execution.ProjectInstanceSettings.None); + var instance = project.CreateProjectInstance(ProjectInstanceSettings.None); instance.Build(new[] { ComputeContainerConfig }, null, null, out var outputs).Should().BeTrue(String.Join(Environment.NewLine, logger.Errors)); - var computedRid = instance.GetProperty(KnownStrings.Properties.ContainerRuntimeIdentifier)?.EvaluatedValue; + var computedRid = instance.GetProperty(ContainerRuntimeIdentifier)?.EvaluatedValue; computedRid.Should().Be(expectedRid); } @@ -239,12 +239,12 @@ public void CanTakeContainerBaseFamilyIntoAccount(string sdkVersion, string tfmM { ["NetCoreSdkVersion"] = sdkVersion, ["TargetFrameworkVersion"] = tfmMajMin, - [KnownStrings.Properties.ContainerFamily] = containerFamily, + [ContainerFamily] = containerFamily, }, projectName: $"{nameof(CanTakeContainerBaseFamilyIntoAccount)}_{sdkVersion}_{tfmMajMin}_{containerFamily}_{expectedTag}"); using var _ = d; - var instance = project.CreateProjectInstance(global::Microsoft.Build.Execution.ProjectInstanceSettings.None); + var instance = project.CreateProjectInstance(ProjectInstanceSettings.None); instance.Build(new[] { _ComputeContainerBaseImageTag }, null, null, out var outputs).Should().BeTrue(String.Join(Environment.NewLine, logger.Errors)); - var computedBaseImageTag = instance.GetProperty(KnownStrings.Properties._ContainerBaseImageTag)?.EvaluatedValue; + var computedBaseImageTag = instance.GetProperty(_ContainerBaseImageTag)?.EvaluatedValue; computedBaseImageTag.Should().Be(expectedTag); } } diff --git a/src/Tests/Microsoft.NET.Build.Containers.UnitTests/DockerDaemonTests.cs b/src/Tests/Microsoft.NET.Build.Containers.UnitTests/DockerDaemonTests.cs index 5dae63e44e52..46ac57cca4a3 100644 --- a/src/Tests/Microsoft.NET.Build.Containers.UnitTests/DockerDaemonTests.cs +++ b/src/Tests/Microsoft.NET.Build.Containers.UnitTests/DockerDaemonTests.cs @@ -31,7 +31,7 @@ public async Task Can_detect_when_no_daemon_is_running() // mimic no daemon running by setting the DOCKER_HOST to a nonexistent socket try { - System.Environment.SetEnvironmentVariable("DOCKER_HOST", "tcp://123.123.123.123:12345"); + Environment.SetEnvironmentVariable("DOCKER_HOST", "tcp://123.123.123.123:12345"); var available = await new DockerCli(_loggerFactory).IsAvailableAsync(default).ConfigureAwait(false); Assert.False(available, "No daemon should be listening at that port"); } diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAnAppWithLibrariesAndRid.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAnAppWithLibrariesAndRid.cs index ae47d39b56d8..43e86df8b559 100644 --- a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAnAppWithLibrariesAndRid.cs +++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToBuildAnAppWithLibrariesAndRid.cs @@ -62,7 +62,7 @@ public void It_builds_a_framework_dependent_RID_specific_runnable_output() .CopyTestAsset("AppWithLibraryAndRid", "BuildFrameworkDependentRIDSpecific") .WithSource(); - if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.OSX)) + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX)) { // .NET Core 2.1.0 packages don't support latest versions of OS X, so roll forward to the // latest patch which does diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToControlGeneratedAssemblyInfo.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToControlGeneratedAssemblyInfo.cs index f1241fdd5717..389239fbbb5d 100644 --- a/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToControlGeneratedAssemblyInfo.cs +++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThatWeWantToControlGeneratedAssemblyInfo.cs @@ -395,7 +395,7 @@ public void TestPreviewFeatures(bool enablePreviewFeatures, bool generateRequire bool contains = false; foreach (var attribute in parameterlessAttributes) { - if (attribute.Equals("RequiresPreviewFeaturesAttribute", System.StringComparison.Ordinal)) + if (attribute.Equals("RequiresPreviewFeaturesAttribute", StringComparison.Ordinal)) { contains = true; break; @@ -454,7 +454,7 @@ public void It_doesnt_includes_requires_preview_features() bool contains = false; foreach (var attribute in parameterlessAttributes) { - if (attribute.Equals("RequiresPreviewFeaturesAttribute", System.StringComparison.Ordinal)) + if (attribute.Equals("RequiresPreviewFeaturesAttribute", StringComparison.Ordinal)) { contains = true; break; @@ -508,7 +508,7 @@ public void TestDisableRuntimeMarshalling(bool disableRuntimeMarshalling, bool? bool contains = false; foreach (var attribute in parameterlessAttributes) { - if (attribute.Equals("DisableRuntimeMarshallingAttribute", System.StringComparison.Ordinal)) + if (attribute.Equals("DisableRuntimeMarshallingAttribute", StringComparison.Ordinal)) { contains = true; break; diff --git a/src/Tests/Microsoft.NET.Build.Tests/GivenThereAreDefaultItems.cs b/src/Tests/Microsoft.NET.Build.Tests/GivenThereAreDefaultItems.cs index 77fdd3103818..db03e4a9aed6 100644 --- a/src/Tests/Microsoft.NET.Build.Tests/GivenThereAreDefaultItems.cs +++ b/src/Tests/Microsoft.NET.Build.Tests/GivenThereAreDefaultItems.cs @@ -860,7 +860,7 @@ void RemoveGeneratedCompileItems(List compileItems) // Other default attributes generated by .NET SDK (for example AssemblyDescriptionAttribute and AssemblyTitleAttribute) come from // { AssemblyName}.AssemblyInfo.cs in the intermediate output path var itemsToRemove = compileItems.Where(i => - i.EndsWith("AssemblyAttributes.cs", System.StringComparison.OrdinalIgnoreCase) || + i.EndsWith("AssemblyAttributes.cs", StringComparison.OrdinalIgnoreCase) || i.EndsWith("AssemblyInfo.cs", StringComparison.OrdinalIgnoreCase)) .ToList(); diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAFrameworkDependentApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAFrameworkDependentApp.cs index ff31fa3e626b..e86e9fbc2442 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAFrameworkDependentApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAFrameworkDependentApp.cs @@ -46,7 +46,7 @@ public void It_publishes_with_or_without_apphost(string useAppHost, string targe msbuildArgs.Add($"/p:UseAppHost={useAppHost}"); } - if (System.Runtime.InteropServices.RuntimeInformation.IsOSPlatform(System.Runtime.InteropServices.OSPlatform.OSX) && + if (RuntimeInformation.IsOSPlatform(OSPlatform.OSX) && targetFramework == "netcoreapp2.1") { // .NET Core 2.1.0 packages don't support latest versions of OS X, so roll forward to the diff --git a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs index 6a78ee147610..51462e9977a2 100644 --- a/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs +++ b/src/Tests/Microsoft.NET.Publish.Tests/GivenThatWeWantToPublishAnAotApp.cs @@ -343,7 +343,7 @@ public void NativeAot_hw_runs_with_PackageReference_PublishAot_is_empty(string t [MemberData(nameof(Net7Plus), MemberType = typeof(PublishTestUtils))] public void NativeAot_hw_runs_with_cross_target_PublishAot_is_enabled(string targetFramework) { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && (RuntimeInformation.OSArchitecture == System.Runtime.InteropServices.Architecture.X64)) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && (RuntimeInformation.OSArchitecture == Architecture.X64)) { var projectName = "HellowWorldNativeAotApp"; var rid = "win-arm64"; @@ -373,7 +373,7 @@ public void NativeAot_hw_runs_with_cross_target_PublishAot_is_enabled(string tar [MemberData(nameof(Net7Plus), MemberType = typeof(PublishTestUtils))] public void NativeAot_hw_runs_with_cross_PackageReference_PublishAot_is_enabled(string targetFramework) { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && (RuntimeInformation.OSArchitecture == System.Runtime.InteropServices.Architecture.X64)) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && (RuntimeInformation.OSArchitecture == Architecture.X64)) { var projectName = "HellowWorldNativeAotApp"; var rid = "win-arm64"; @@ -409,7 +409,7 @@ public void NativeAot_hw_runs_with_cross_PackageReference_PublishAot_is_enabled( [InlineData(ToolsetInfo.CurrentTargetFramework)] public void NativeAot_hw_runs_with_cross_PackageReference_PublishAot_is_empty(string targetFramework) { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && (RuntimeInformation.OSArchitecture == System.Runtime.InteropServices.Architecture.X64)) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Windows) && (RuntimeInformation.OSArchitecture == Architecture.X64)) { var projectName = "HellowWorldNativeAotApp"; var rid = "win-arm64"; @@ -482,7 +482,7 @@ public void NativeAot_hw_fails_with_sdk6_PackageReference_PublishAot_is_enabled( [InlineData(ToolsetInfo.CurrentTargetFramework)] public void NativeAot_hw_fails_with_unsupported_target_rid(string targetFramework) { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && RuntimeInformation.OSArchitecture == System.Runtime.InteropServices.Architecture.X64) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && RuntimeInformation.OSArchitecture == Architecture.X64) { var projectName = "HelloWorldUnsupportedTargetRid"; var rid = "linux-x64"; @@ -506,7 +506,7 @@ public void NativeAot_hw_fails_with_unsupported_target_rid(string targetFramewor [InlineData(ToolsetInfo.CurrentTargetFramework)] public void NativeAot_hw_fails_with_unsupported_host_rid(string targetFramework) { - if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && RuntimeInformation.OSArchitecture == System.Runtime.InteropServices.Architecture.X64) + if (RuntimeInformation.IsOSPlatform(OSPlatform.Linux) && RuntimeInformation.OSArchitecture == Architecture.X64) { var projectName = "HelloWorldUnsupportedHostRid"; var supportedTargetRid = "linux-arm64"; diff --git a/src/Tests/Microsoft.NET.Restore.Tests/GivenThatWeWantAutomaticTargetingPackReferences.cs b/src/Tests/Microsoft.NET.Restore.Tests/GivenThatWeWantAutomaticTargetingPackReferences.cs index 6de8cfdf84ae..2e1e7f3efd7e 100644 --- a/src/Tests/Microsoft.NET.Restore.Tests/GivenThatWeWantAutomaticTargetingPackReferences.cs +++ b/src/Tests/Microsoft.NET.Restore.Tests/GivenThatWeWantAutomaticTargetingPackReferences.cs @@ -21,7 +21,7 @@ public GivenThatWeWantAutomaticTargetingPackReferences(ITestOutputHelper log) : [InlineData("4.8")] public void It_restores_net_framework_project_successfully(string version) { - var targetFrameworkVersion = (TargetDotNetFrameworkVersion)System.Enum.Parse(typeof(TargetDotNetFrameworkVersion), "Version" + string.Join("", version.Split('.'))); + var targetFrameworkVersion = (TargetDotNetFrameworkVersion)Enum.Parse(typeof(TargetDotNetFrameworkVersion), "Version" + string.Join("", version.Split('.'))); var targetFramework = "net" + string.Join("", version.Split('.')); var testProject = new TestProject() { diff --git a/src/Tests/Microsoft.NET.TestFramework/OutputPathCalculator.cs b/src/Tests/Microsoft.NET.TestFramework/OutputPathCalculator.cs index 23a607554e94..18fd2d8c9cfa 100644 --- a/src/Tests/Microsoft.NET.TestFramework/OutputPathCalculator.cs +++ b/src/Tests/Microsoft.NET.TestFramework/OutputPathCalculator.cs @@ -195,12 +195,12 @@ public string GetOutputDirectory(string targetFramework = null, string configura if (IsSdkProject) { - string output = System.IO.Path.Combine(Path.GetDirectoryName(ProjectPath), "bin", platform, configuration, targetFramework, runtimeIdentifier); + string output = Path.Combine(Path.GetDirectoryName(ProjectPath), "bin", platform, configuration, targetFramework, runtimeIdentifier); return output; } else { - string output = System.IO.Path.Combine(Path.GetDirectoryName(ProjectPath), "bin", platform, configuration); + string output = Path.Combine(Path.GetDirectoryName(ProjectPath), "bin", platform, configuration); return output; } } @@ -240,7 +240,7 @@ public string GetPublishDirectory(string targetFramework = null, string configur runtimeIdentifier ??= RuntimeIdentifier ?? string.Empty; platform ??= string.Empty; - string output = System.IO.Path.Combine(Path.GetDirectoryName(ProjectPath), "bin", platform, configuration, targetFramework, runtimeIdentifier, "publish"); + string output = Path.Combine(Path.GetDirectoryName(ProjectPath), "bin", platform, configuration, targetFramework, runtimeIdentifier, "publish"); return output; } } @@ -278,7 +278,7 @@ public string GetIntermediateDirectory(string targetFramework = null, string con configuration = configuration ?? string.Empty; runtimeIdentifier = runtimeIdentifier ?? RuntimeIdentifier ?? string.Empty; - string output = System.IO.Path.Combine(Path.GetDirectoryName(ProjectPath), "obj", configuration, targetFramework, runtimeIdentifier); + string output = Path.Combine(Path.GetDirectoryName(ProjectPath), "obj", configuration, targetFramework, runtimeIdentifier); return output; } @@ -286,11 +286,11 @@ public string GetPackageDirectory(string configuration = "Debug") { if (UseArtifactsOutput) { - return System.IO.Path.Combine(ArtifactsPath, "package", configuration.ToLowerInvariant()); + return Path.Combine(ArtifactsPath, "package", configuration.ToLowerInvariant()); } else { - return System.IO.Path.Combine(Path.GetDirectoryName(ProjectPath), "bin", configuration); + return Path.Combine(Path.GetDirectoryName(ProjectPath), "bin", configuration); } } } diff --git a/src/Tests/Microsoft.NET.TestFramework/TestAsset.cs b/src/Tests/Microsoft.NET.TestFramework/TestAsset.cs index 041f03640ac3..fa5da7569738 100644 --- a/src/Tests/Microsoft.NET.TestFramework/TestAsset.cs +++ b/src/Tests/Microsoft.NET.TestFramework/TestAsset.cs @@ -49,7 +49,7 @@ internal void FindProjectFiles() { _projectFiles = new List(); - var files = Directory.GetFiles(base.Path, "*.*", SearchOption.AllDirectories); + var files = Directory.GetFiles(Path, "*.*", SearchOption.AllDirectories); foreach (string file in files) { diff --git a/src/Tests/Microsoft.NET.TestFramework/TestContext.cs b/src/Tests/Microsoft.NET.TestFramework/TestContext.cs index 6973f6bab71d..2a82339e3723 100644 --- a/src/Tests/Microsoft.NET.TestFramework/TestContext.cs +++ b/src/Tests/Microsoft.NET.TestFramework/TestContext.cs @@ -200,11 +200,11 @@ public static void Initialize(TestCommandLine commandLine) // Important to set this before below code which ends up calling through TestContext.Current, which would // result in infinite recursion / stack overflow if TestContext.Current wasn't set - TestContext.Current = testContext; + Current = testContext; // Set up test hooks for in-process tests Environment.SetEnvironmentVariable( - DotNet.Cli.Utils.Constants.MSBUILD_EXE_PATH, + Constants.MSBUILD_EXE_PATH, Path.Combine(testContext.ToolsetUnderTest.SdkFolderUnderTest, "MSBuild.dll")); Environment.SetEnvironmentVariable( @@ -212,7 +212,7 @@ public static void Initialize(TestCommandLine commandLine) Path.Combine(testContext.ToolsetUnderTest.SdksPath)); #if NETCOREAPP - DotNet.Cli.Utils.MSBuildForwardingAppWithoutLogging.MSBuildExtensionsPathTestHook = + MSBuildForwardingAppWithoutLogging.MSBuildExtensionsPathTestHook = testContext.ToolsetUnderTest.SdkFolderUnderTest; #endif } @@ -278,7 +278,7 @@ public static void WriteGlobalJson(string path, string sdkVersion) { if (!string.IsNullOrEmpty(sdkVersion)) { - string globalJsonPath = System.IO.Path.Combine(path, "global.json"); + string globalJsonPath = Path.Combine(path, "global.json"); File.WriteAllText(globalJsonPath, @"{ ""sdk"": { ""version"": """ + sdkVersion + @""" diff --git a/src/Tests/Microsoft.NET.TestFramework/ToolsetInfo.cs b/src/Tests/Microsoft.NET.TestFramework/ToolsetInfo.cs index 5d8428d8ff9f..a15ac268b369 100644 --- a/src/Tests/Microsoft.NET.TestFramework/ToolsetInfo.cs +++ b/src/Tests/Microsoft.NET.TestFramework/ToolsetInfo.cs @@ -190,7 +190,7 @@ public void AddTestEnvironmentVariables(IDictionary environment) // We set this environment variable for in-process tests, but we don't want it to flow to out of process tests // (especially if we're trying to run on full Framework MSBuild) - environment[DotNet.Cli.Utils.Constants.MSBUILD_EXE_PATH] = ""; + environment[Constants.MSBUILD_EXE_PATH] = ""; } diff --git a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/HostDataLoaderTests.cs b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/HostDataLoaderTests.cs index bf4ee49eec78..e14efaaa0a5c 100644 --- a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/HostDataLoaderTests.cs +++ b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/HostDataLoaderTests.cs @@ -60,7 +60,7 @@ public void CanReadHostDataFromITemplateInfo() IFile? dataFile = mountPoint!.FileInfo("/Resources/dotnetcli.host.json"); Assert.NotNull(dataFile); using Stream s = dataFile.OpenRead(); - using TextReader tr = new StreamReader(s, System.Text.Encoding.UTF8, true); + using TextReader tr = new StreamReader(s, Encoding.UTF8, true); string json = tr.ReadToEnd(); ITemplateInfo template = A.Fake(builder => builder.Implements().Implements()); diff --git a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/HelpTests.cs b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/HelpTests.cs index 11297388f6d1..62a06c2148ac 100644 --- a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/HelpTests.cs +++ b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/HelpTests.cs @@ -443,7 +443,7 @@ public Task DoesNotCombineParametersWhenAliasesAreDifferent() HelpContext helpContext = new(new HelpBuilder(maxWidth: 50), myCommand, sw); InstantiateCommand.ShowTemplateSpecificOptions(new[] { templateCommand1, templateCommand2 }, helpContext); - return Verifier.Verify(sw.ToString()); + return Verify(sw.ToString()); } [Fact] diff --git a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/InstallTests.cs b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/InstallTests.cs index eb4d983e6f21..8500a82ca5da 100644 --- a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/InstallTests.cs +++ b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/InstallTests.cs @@ -235,7 +235,7 @@ public void CommandExampleCanShowParentCommandsBeyondNew() }; ParseResult parseResult = rootCommand.Parse("dotnet new install source"); - Assert.Equal("dotnet new install my-source", Example.For(parseResult).WithSubcommand().WithArgument(InstallCommand.NameArgument, "my-source")); + Assert.Equal("dotnet new install my-source", Example.For(parseResult).WithSubcommand().WithArgument(BaseInstallCommand.NameArgument, "my-source")); } } diff --git a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/SearchTests.cs b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/SearchTests.cs index 040fa059ad6a..51d647fee2df 100644 --- a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/SearchTests.cs +++ b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/SearchTests.cs @@ -250,7 +250,7 @@ public void CommandExampleCanShowParentCommandsBeyondNew() }; ParseResult parseResult = rootCommand.Parse("dotnet new search template"); - Assert.Equal("dotnet new search my-template", Example.For(parseResult).WithSubcommand().WithArgument(SearchCommand.NameArgument, "my-template")); + Assert.Equal("dotnet new search my-template", Example.For(parseResult).WithSubcommand().WithArgument(BaseSearchCommand.NameArgument, "my-template")); } [Fact] @@ -264,7 +264,7 @@ public void CommandExampleShowsMandatoryArg() }; ParseResult parseResult = rootCommand.Parse("dotnet new search template"); - Assert.Equal("dotnet new search []", Example.For(parseResult).WithSubcommand().WithArgument(SearchCommand.NameArgument)); + Assert.Equal("dotnet new search []", Example.For(parseResult).WithSubcommand().WithArgument(BaseSearchCommand.NameArgument)); } [Fact] @@ -278,7 +278,7 @@ public void CommandExampleShowsOptionalArgWhenOptionsAreGiven() }; ParseResult parseResult = rootCommand.Parse("dotnet new search template"); - Assert.Equal("dotnet new search [] --author Microsoft", Example.For(parseResult).WithSubcommand().WithArgument(SearchCommand.NameArgument).WithOption(SharedOptionsFactory.CreateAuthorOption(), "Microsoft")); + Assert.Equal("dotnet new search [] --author Microsoft", Example.For(parseResult).WithSubcommand().WithArgument(BaseSearchCommand.NameArgument).WithOption(SharedOptionsFactory.CreateAuthorOption(), "Microsoft")); } } } diff --git a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/UninstallTests.cs b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/UninstallTests.cs index bef40dcf4643..481880e42f49 100644 --- a/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/UninstallTests.cs +++ b/src/Tests/Microsoft.TemplateEngine.Cli.UnitTests/ParserTests/UninstallTests.cs @@ -96,7 +96,7 @@ public void CommandExampleCanShowParentCommandsBeyondNew() }; ParseResult parseResult = rootCommand.Parse("dotnet new uninstall source"); - Assert.Equal("dotnet new uninstall my-source", Example.For(parseResult).WithSubcommand().WithArgument(UninstallCommand.NameArgument, "my-source")); + Assert.Equal("dotnet new uninstall my-source", Example.For(parseResult).WithSubcommand().WithArgument(BaseUninstallCommand.NameArgument, "my-source")); } } } diff --git a/src/Tests/crossgen.Tests/crossgen.Tests.cs b/src/Tests/crossgen.Tests/crossgen.Tests.cs index 3fc4a65b1f09..b6885aa40282 100644 --- a/src/Tests/crossgen.Tests/crossgen.Tests.cs +++ b/src/Tests/crossgen.Tests/crossgen.Tests.cs @@ -60,7 +60,7 @@ private static void CheckDirectoryIsCrossgened(string pathToAssemblies) private static string FindDotnetDirInPath() { - string dotnetExecutable = $"dotnet{Microsoft.DotNet.Cli.Utils.FileNameSuffixes.CurrentPlatform.Exe}"; + string dotnetExecutable = $"dotnet{Cli.Utils.FileNameSuffixes.CurrentPlatform.Exe}"; foreach (string path in (Environment.GetEnvironmentVariable("PATH") ?? "").Split(Path.PathSeparator)) { string dotnetPath = Path.Combine(path, dotnetExecutable); diff --git a/src/Tests/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs b/src/Tests/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs index c8031e52bd11..ec6b11640344 100644 --- a/src/Tests/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs +++ b/src/Tests/dotnet-help.Tests/GivenThatIWantToShowHelpForDotnetCommand.cs @@ -114,7 +114,7 @@ public void WhenCommandWithoutDocLinkIsPassedToDotnetHelpItPrintsError(string co .Execute($"help", command); cmd.Should().Fail(); - cmd.StdErr.Should().Contain(string.Format(Tools.Help.LocalizableStrings.CommandDoesNotExist, command)); + cmd.StdErr.Should().Contain(string.Format(LocalizableStrings.CommandDoesNotExist, command)); cmd.StdOut.Should().ContainVisuallySameFragmentIfNotLocalized(HelpText); } diff --git a/src/Tests/dotnet-run.Tests/GivenThatWeCanPassNonProjectFilesToDotnetRun.cs b/src/Tests/dotnet-run.Tests/GivenThatWeCanPassNonProjectFilesToDotnetRun.cs index b6ef58633d5c..e35ce9fc9dc6 100644 --- a/src/Tests/dotnet-run.Tests/GivenThatWeCanPassNonProjectFilesToDotnetRun.cs +++ b/src/Tests/dotnet-run.Tests/GivenThatWeCanPassNonProjectFilesToDotnetRun.cs @@ -24,7 +24,7 @@ public void ItFailsWithAnAppropriateErrorMessage() .Should().Fail() .And.HaveStdErrContaining( string.Format( - Microsoft.DotNet.Tools.Run.LocalizableStrings.RunCommandSpecifiecFileIsNotAValidProject, + Tools.Run.LocalizableStrings.RunCommandSpecifiecFileIsNotAValidProject, slnFullPath)); } } diff --git a/src/Tests/dotnet-sln.Tests/GivenDotnetSlnAdd.cs b/src/Tests/dotnet-sln.Tests/GivenDotnetSlnAdd.cs index 8a6d6eaef133..cae22e62ff8a 100644 --- a/src/Tests/dotnet-sln.Tests/GivenDotnetSlnAdd.cs +++ b/src/Tests/dotnet-sln.Tests/GivenDotnetSlnAdd.cs @@ -1218,7 +1218,7 @@ public void WhenSolutionFolderAndInRootIsPassedItFails() .Execute($"sln", "App.sln", "add", "--solution-folder", "blah", "--in-root", projectToAdd); cmd.Should().Fail(); cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(""); - cmd.StdErr.Should().Be(Microsoft.DotNet.Tools.Sln.LocalizableStrings.SolutionFolderAndInRootMutuallyExclusive); + cmd.StdErr.Should().Be(Tools.Sln.LocalizableStrings.SolutionFolderAndInRootMutuallyExclusive); cmd.StdOut.Should().BeVisuallyEquivalentToIfNotLocalized(""); File.ReadAllText(solutionPath) diff --git a/src/Tests/dotnet-workload-install.Tests/GivenFileBasedWorkloadInstall.cs b/src/Tests/dotnet-workload-install.Tests/GivenFileBasedWorkloadInstall.cs index 10d28c468d30..31ba7e2fb20f 100644 --- a/src/Tests/dotnet-workload-install.Tests/GivenFileBasedWorkloadInstall.cs +++ b/src/Tests/dotnet-workload-install.Tests/GivenFileBasedWorkloadInstall.cs @@ -463,7 +463,7 @@ public void GivenManagedInstallItCanErrorsWhenMissingOfflineCache() var testDirectory = _testAssetsManager.CreateTestDirectory(testName, identifier: identifier).Path; var dotnetRoot = Path.Combine(testDirectory, "dotnet"); INuGetPackageDownloader nugetInstaller = failingInstaller ? new FailingNuGetPackageDownloader(testDirectory) : new MockNuGetPackageDownloader(dotnetRoot, manifestDownload); - var workloadResolver = WorkloadResolver.CreateForTests(new MockManifestProvider(new[] { _manifestPath }), dotnetRoot); + var workloadResolver = CreateForTests(new MockManifestProvider(new[] { _manifestPath }), dotnetRoot); var sdkFeatureBand = new SdkFeatureBand("6.0.300"); return (dotnetRoot, new FileBasedInstaller(_reporter, sdkFeatureBand, workloadResolver, userProfileDir: testDirectory, nugetInstaller, dotnetRoot, packageSourceLocation: packageSourceLocation), nugetInstaller); } diff --git a/src/Tests/dotnet-workload-update.Tests/GivenDotnetWorkloadUpdate.cs b/src/Tests/dotnet-workload-update.Tests/GivenDotnetWorkloadUpdate.cs index 7fd04aec0e12..c46732b63cd8 100644 --- a/src/Tests/dotnet-workload-update.Tests/GivenDotnetWorkloadUpdate.cs +++ b/src/Tests/dotnet-workload-update.Tests/GivenDotnetWorkloadUpdate.cs @@ -36,7 +36,7 @@ public void GivenWorkloadUpdateItRemovesOldPacksAfterInstall(bool userLocal) var testDirectory = _testAssetsManager.CreateTestDirectory(identifier: userLocal ? "userlocal" : "default").Path; var dotnetRoot = Path.Combine(testDirectory, "dotnet"); var userProfileDir = Path.Combine(testDirectory, "user-profile"); - var workloadResolver = WorkloadResolver.CreateForTests(new MockManifestProvider(new[] { _manifestPath }), dotnetRoot, userLocal, userProfileDir); + var workloadResolver = CreateForTests(new MockManifestProvider(new[] { _manifestPath }), dotnetRoot, userLocal, userProfileDir); var nugetDownloader = new MockNuGetPackageDownloader(dotnetRoot); var manifestUpdater = new MockWorkloadManifestUpdater(); var sdkFeatureVersion = "6.0.100"; @@ -78,7 +78,7 @@ public void GivenWorkloadUpdateItRemovesOldPacksAfterInstall(bool userLocal) } // Mock updating the manifest - workloadResolver = WorkloadResolver.CreateForTests( + workloadResolver = CreateForTests( new MockManifestProvider(new[] { Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleUpdatedManifest"), "Sample.json") }), dotnetRoot, userLocal, userProfileDir); @@ -121,7 +121,7 @@ public void GivenWorkloadUpdateAcrossFeatureBandsItUpdatesPacks(bool userLocal) var dotnetRoot = Path.Combine(testDirectory, "dotnet"); var userProfileDir = Path.Combine(testDirectory, "user-profile"); var manifestPath = Path.Combine(_testAssetsManager.GetAndValidateTestProjectDirectory("SampleManifest"), "BasicSample.json"); - var workloadResolver = WorkloadResolver.CreateForTests(new MockManifestProvider(new[] { manifestPath }), dotnetRoot, userLocal, userProfileDir); + var workloadResolver = CreateForTests(new MockManifestProvider(new[] { manifestPath }), dotnetRoot, userLocal, userProfileDir); var nugetDownloader = new MockNuGetPackageDownloader(dotnetRoot); var manifestUpdater = new MockWorkloadManifestUpdater(); var sdkFeatureVersion = "6.0.100"; @@ -448,7 +448,7 @@ public void GivenInvalidVersionInRollbackFileItErrors() var copiedManifestFile = Path.Combine(copiedManifestFolder, "WorkloadManifest.json"); File.Copy(_manifestPath, copiedManifestFile); - var workloadResolver = WorkloadResolver.CreateForTests(new MockManifestProvider(new[] { copiedManifestFile }), dotnetRoot); + var workloadResolver = CreateForTests(new MockManifestProvider(new[] { copiedManifestFile }), dotnetRoot); installer.WorkloadResolver = workloadResolver; var nugetDownloader = new MockNuGetPackageDownloader(dotnetRoot); var manifestUpdater = new MockWorkloadManifestUpdater(manifestUpdates, _manifestPath); diff --git a/src/Tests/dotnet.Tests/CommandTests/ToolRestoreCommandTests.cs b/src/Tests/dotnet.Tests/CommandTests/ToolRestoreCommandTests.cs index ab132d71f5da..7d12cc5c1cf8 100644 --- a/src/Tests/dotnet.Tests/CommandTests/ToolRestoreCommandTests.cs +++ b/src/Tests/dotnet.Tests/CommandTests/ToolRestoreCommandTests.cs @@ -392,7 +392,7 @@ public void WhenRunWithoutManifestFileItShouldPrintSpecificRestoreErrorMessage() toolRestoreCommand.Execute().Should().Be(0); _reporter.Lines.Should().Contain(l => - l.Contains(Cli.Utils.AnsiExtensions.Yellow(LocalizableStrings.NoToolsWereRestored))); + l.Contains(AnsiExtensions.Yellow(LocalizableStrings.NoToolsWereRestored))); } private class MockManifestFinder : IToolManifestFinder diff --git a/src/Tests/dotnet.Tests/ParserTests/ResponseFileTests.cs b/src/Tests/dotnet.Tests/ParserTests/ResponseFileTests.cs index aa79babc43d3..df181613f227 100644 --- a/src/Tests/dotnet.Tests/ParserTests/ResponseFileTests.cs +++ b/src/Tests/dotnet.Tests/ParserTests/ResponseFileTests.cs @@ -28,7 +28,7 @@ public void Can_safely_expand_response_file_lines() var tokens = parseResult.Tokens.Select(t => t.Value); var tokenString = string.Join(", ", tokens); - var bc = Microsoft.DotNet.Tools.Build.BuildCommand.FromParseResult(parseResult); + var bc = Tools.Build.BuildCommand.FromParseResult(parseResult); var tokenized = new[] { "build", "a b", diff --git a/src/Tests/dotnet.Tests/dotnet-workload-clean/GivenDotnetWorkloadClean.cs b/src/Tests/dotnet.Tests/dotnet-workload-clean/GivenDotnetWorkloadClean.cs index 52e69108519a..20bceed45752 100644 --- a/src/Tests/dotnet.Tests/dotnet-workload-clean/GivenDotnetWorkloadClean.cs +++ b/src/Tests/dotnet.Tests/dotnet-workload-clean/GivenDotnetWorkloadClean.cs @@ -171,7 +171,7 @@ private void AssertExtraneousPacksAreRemoved(string extraPackPath, string extraP private void AssertWorkloadInstallationRecordIsRemoved(string workloadInstallationRecordDirectory) { - Assert.Equal(Directory.GetFiles(workloadInstallationRecordDirectory), System.Array.Empty()); + Assert.Equal(Directory.GetFiles(workloadInstallationRecordDirectory), Array.Empty()); } private void AssertValidPackCountsMatchExpected(string installRoot, int expectedPackCount, int expectedPackRecordCount) diff --git a/src/WebSdk/Publish/Tasks/Kudu/KuduVfsDeploy.cs b/src/WebSdk/Publish/Tasks/Kudu/KuduVfsDeploy.cs index b18edca37c03..ff5cb6f1f798 100644 --- a/src/WebSdk/Publish/Tasks/Kudu/KuduVfsDeploy.cs +++ b/src/WebSdk/Publish/Tasks/Kudu/KuduVfsDeploy.cs @@ -74,14 +74,14 @@ private System.Threading.Tasks.Task PostFilesAsync(string file, string sourcePat { lock (_syncObject) { - _logger.LogMessage(Microsoft.Build.Framework.MessageImportance.High, String.Format(Resources.KUDUDEPLOY_AddingFileFailed, ConnectionInfo.SiteName + "/" + relUrl, response.ReasonPhrase)); + _logger.LogMessage(Build.Framework.MessageImportance.High, String.Format(Resources.KUDUDEPLOY_AddingFileFailed, ConnectionInfo.SiteName + "/" + relUrl, response.ReasonPhrase)); } } else { lock (_syncObject) { - _logger.LogMessage(Microsoft.Build.Framework.MessageImportance.High, String.Format(Resources.KUDUDEPLOY_AddingFile, ConnectionInfo.SiteName + "/" + relUrl)); + _logger.LogMessage(Build.Framework.MessageImportance.High, String.Format(Resources.KUDUDEPLOY_AddingFile, ConnectionInfo.SiteName + "/" + relUrl)); } } } diff --git a/src/WebSdk/Publish/Tasks/Kudu/KuduZipDeploy.cs b/src/WebSdk/Publish/Tasks/Kudu/KuduZipDeploy.cs index 4cd09a605529..4658cdd969ce 100644 --- a/src/WebSdk/Publish/Tasks/Kudu/KuduZipDeploy.cs +++ b/src/WebSdk/Publish/Tasks/Kudu/KuduZipDeploy.cs @@ -58,7 +58,7 @@ private async System.Threading.Tasks.Task PostZipAsync(string zipFilePath) req.Headers.Add("Authorization", "Basic " + AuthorizationInfo); req.Content = content; - _logger.LogMessage(Microsoft.Build.Framework.MessageImportance.High, Resources.KUDUDEPLOY_PublishAzure); + _logger.LogMessage(Build.Framework.MessageImportance.High, Resources.KUDUDEPLOY_PublishAzure); using (var response = await client.SendAsync(req)) { if (!response.IsSuccessStatusCode) diff --git a/src/WebSdk/Publish/Tasks/MsDeploy/CommonUtility.cs b/src/WebSdk/Publish/Tasks/MsDeploy/CommonUtility.cs index c655c6921721..59f3b96c4208 100644 --- a/src/WebSdk/Publish/Tasks/MsDeploy/CommonUtility.cs +++ b/src/WebSdk/Publish/Tasks/MsDeploy/CommonUtility.cs @@ -254,11 +254,11 @@ internal enum IISExpressMetadata public static bool IsInternalMsdeployWellKnownItemMetadata(string name) { IISExpressMetadata iisExpressMetadata; - if (System.Enum.TryParse(name, out iisExpressMetadata)) + if (Enum.TryParse(name, out iisExpressMetadata)) { return true; } - if (string.Compare(name, "Path", System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(name, "Path", StringComparison.OrdinalIgnoreCase) == 0) { return true; } @@ -291,7 +291,7 @@ public static bool IsMSBuildWellKnownItemMetadata(string name) "DefiningProjectFullPath", "DefiningProjectName" }; - m_wellKnownNamesDict = new System.Collections.Generic.Dictionary(wellKnownNames.GetLength(0), System.StringComparer.OrdinalIgnoreCase); + m_wellKnownNamesDict = new System.Collections.Generic.Dictionary(wellKnownNames.GetLength(0), StringComparer.OrdinalIgnoreCase); foreach (string wellKnownName in wellKnownNames) { @@ -316,7 +316,7 @@ public static bool IsMsDeployWellKnownLocationInfo(string name) "authType", "prefetchPayload", }; - m_wellKnownNamesMsdeployDict = new System.Collections.Generic.Dictionary(wellKnownNames.GetLength(0), System.StringComparer.OrdinalIgnoreCase); + m_wellKnownNamesMsdeployDict = new System.Collections.Generic.Dictionary(wellKnownNames.GetLength(0), StringComparer.OrdinalIgnoreCase); foreach (string wellKnownName in wellKnownNames) { @@ -371,7 +371,7 @@ public static uint GetInstalledMajorIisVersion() { if (registryKey != null) { - iisMajorVersion = System.Convert.ToUInt16(registryKey.GetValue(@"MajorVersion", 0), CultureInfo.InvariantCulture); + iisMajorVersion = Convert.ToUInt16(registryKey.GetValue(@"MajorVersion", 0), CultureInfo.InvariantCulture); } } return iisMajorVersion; @@ -423,7 +423,7 @@ public static bool IsMSDeployInstalled } catch (System.IO.FileNotFoundException ex) { - _strErrorMessage = string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYLOADFAIL, + _strErrorMessage = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYLOADFAIL, Resources.VSMSDEPLOY_MSDEPLOY32bit, Resources.VSMSDEPLOY_MSDEPLOY64bit, ex.Message); @@ -463,7 +463,7 @@ public static void SaveDocument(Xml.XmlDocument document, string outputFileName, { #if NET472 Xml.XmlTextWriter textWriter = new Xml.XmlTextWriter(outputFileName, encode); - textWriter.Formatting = System.Xml.Formatting.Indented; + textWriter.Formatting = Formatting.Indented; document.Save(textWriter); textWriter.Close(); #else @@ -536,7 +536,7 @@ private static bool CheckMSDeploymentVersion() } } - System.Diagnostics.Debug.Assert(MSWebDeploymentAssembly.DynamicAssembly != null && MSWebDeploymentAssembly.DynamicAssembly.Assembly != null); + Debug.Assert(MSWebDeploymentAssembly.DynamicAssembly != null && MSWebDeploymentAssembly.DynamicAssembly.Assembly != null); if (MSWebDeploymentAssembly.DynamicAssembly != null && MSWebDeploymentAssembly.DynamicAssembly.Assembly != null) { System.Reflection.AssemblyName assemblyName = MSWebDeploymentAssembly.DynamicAssembly.Assembly.GetName(); @@ -551,7 +551,7 @@ private static bool CheckMSDeploymentVersion() if (fMinVersionNotMeet) { - _strErrorMessage = string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYLOADFAIL, + _strErrorMessage = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYLOADFAIL, Resources.VSMSDEPLOY_MSDEPLOY32bit, Resources.VSMSDEPLOY_MSDEPLOY64bit, assemblyVersion, @@ -564,13 +564,13 @@ private static bool CheckMSDeploymentVersion() else { #if NET472 - _strErrorMessage = string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYLOADFAIL, + _strErrorMessage = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYLOADFAIL, Resources.VSMSDEPLOY_MSDEPLOY32bit, Resources.VSMSDEPLOY_MSDEPLOY64bit, new System.Version(), currentMinVersion); #else - _strErrorMessage = string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYLOADFAIL, + _strErrorMessage = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYLOADFAIL, Resources.VSMSDEPLOY_MSDEPLOY32bit, Resources.VSMSDEPLOY_MSDEPLOY64bit, new System.Version(3, 6), @@ -617,7 +617,7 @@ public static string GetNodeFromProjectFile(Xml.XmlDocument doc, Xml.XmlNamespac /// static internal void BuildArgumentsBaseOnEnumTypeName(Framework.ITaskItem item, System.Collections.Generic.List arguments, System.Type enumType, string valueQuote) { - string[] enumNames = System.Enum.GetNames(enumType); + string[] enumNames = Enum.GetNames(enumType); foreach (string enumName in enumNames) { string data = item.GetMetadata(enumName); @@ -625,7 +625,7 @@ static internal void BuildArgumentsBaseOnEnumTypeName(Framework.ITaskItem item, { string valueData = PutValueInQuote(data, valueQuote); #if NET472 - arguments.Add(string.Concat(enumName.ToLower(System.Globalization.CultureInfo.InvariantCulture), "=", valueData)); + arguments.Add(string.Concat(enumName.ToLower(CultureInfo.InvariantCulture), "=", valueData)); #else arguments.Add(string.Concat(enumName.ToLower(), "=", valueData)); #endif @@ -705,24 +705,24 @@ public static void MsDeployExeEndOfExecuteMessage(bool bSuccess, string destType if (bSuccess) { #if NET472 - if (IsOneof(destType, packageArchivedir, System.StringComparison.InvariantCultureIgnoreCase)) + if (IsOneof(destType, packageArchivedir, StringComparison.InvariantCultureIgnoreCase)) #else - if (IsOneof(destType, packageArchivedir, System.StringComparison.OrdinalIgnoreCase)) + if (IsOneof(destType, packageArchivedir, StringComparison.OrdinalIgnoreCase)) #endif { //strip off the trailing slash, so IO.Path.GetDirectoryName/GetFileName will return values correctly destRoot = StripOffTrailingSlashes(destRoot); - string dir = IO.Path.GetDirectoryName(destRoot); + string dir = Path.GetDirectoryName(destRoot); string dirUri = ConvertAbsPhysicalPathToAbsUriPath(dir); #if NET472 - if (IsOneof(destType, ArchiveDirOnly, System.StringComparison.InvariantCultureIgnoreCase)) + if (IsOneof(destType, ArchiveDirOnly, StringComparison.InvariantCultureIgnoreCase)) #else - if (IsOneof(destType, ArchiveDirOnly, System.StringComparison.OrdinalIgnoreCase)) + if (IsOneof(destType, ArchiveDirOnly, StringComparison.OrdinalIgnoreCase)) #endif - strSucceedFailMsg = string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_SucceedArchiveDir, string.IsNullOrEmpty(dirUri) ? destRoot : dirUri); + strSucceedFailMsg = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_SucceedArchiveDir, string.IsNullOrEmpty(dirUri) ? destRoot : dirUri); else - strSucceedFailMsg = string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_SucceedPackage, IO.Path.GetFileName(destRoot), string.IsNullOrEmpty(dirUri) ? destRoot : dirUri); + strSucceedFailMsg = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_SucceedPackage, Path.GetFileName(destRoot), string.IsNullOrEmpty(dirUri) ? destRoot : dirUri); fNeedUnpackageHelpLink = true; } else @@ -733,9 +733,9 @@ public static void MsDeployExeEndOfExecuteMessage(bool bSuccess, string destType else { #if NET472 - if (IsOneof(destType, packageArchivedir, System.StringComparison.InvariantCultureIgnoreCase)) + if (IsOneof(destType, packageArchivedir, StringComparison.InvariantCultureIgnoreCase)) #else - if (IsOneof(destType, packageArchivedir, System.StringComparison.OrdinalIgnoreCase)) + if (IsOneof(destType, packageArchivedir, StringComparison.OrdinalIgnoreCase)) #endif { strSucceedFailMsg = Resources.VSMSDEPLOY_FailedPackage; @@ -766,14 +766,14 @@ public static void MsDeployEndOfExecuteMessage(bool bSuccess, string destType, s System.Type DeploymentWellKnownProviderType = MSWebDeploymentAssembly.DynamicAssembly.GetType(MSDeploy.TypeName.DeploymentWellKnownProvider); dynamic wellKnownProvider = MSWebDeploymentAssembly.DynamicAssembly.GetEnumValue(MSDeploy.TypeName.DeploymentWellKnownProvider, "Unknown"); #if NET472 - if (string.Compare(destType, MSDeploy.Provider.DbDacFx, System.StringComparison.InvariantCultureIgnoreCase) != 0) + if (string.Compare(destType, MSDeploy.Provider.DbDacFx, StringComparison.InvariantCultureIgnoreCase) != 0) #else - if (string.Compare(destType, MSDeploy.Provider.DbDacFx, System.StringComparison.OrdinalIgnoreCase) != 0) + if (string.Compare(destType, MSDeploy.Provider.DbDacFx, StringComparison.OrdinalIgnoreCase) != 0) #endif { try { - wellKnownProvider = System.Enum.Parse(DeploymentWellKnownProviderType, destType, true); + wellKnownProvider = Enum.Parse(DeploymentWellKnownProviderType, destType, true); } catch { @@ -790,12 +790,12 @@ public static void MsDeployEndOfExecuteMessage(bool bSuccess, string destType, s //strip off the trailing slash, so IO.Path.GetDirectoryName/GetFileName will return values correctly destRoot = StripOffTrailingSlashes(destRoot); - string dir = IO.Path.GetDirectoryName(destRoot); + string dir = Path.GetDirectoryName(destRoot); string dirUri = ConvertAbsPhysicalPathToAbsUriPath(dir); if (wellKnownProvider.Equals(MSWebDeploymentAssembly.DynamicAssembly.GetEnumValue(MSDeploy.TypeName.DeploymentWellKnownProvider, MSDeploy.Provider.ArchiveDir))) - strSucceedFailMsg = string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_SucceedArchiveDir, string.IsNullOrEmpty(dirUri) ? destRoot : dirUri); + strSucceedFailMsg = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_SucceedArchiveDir, string.IsNullOrEmpty(dirUri) ? destRoot : dirUri); else - strSucceedFailMsg = string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_SucceedPackage, IO.Path.GetFileName(destRoot), string.IsNullOrEmpty(dirUri) ? destRoot : dirUri); + strSucceedFailMsg = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_SucceedPackage, Path.GetFileName(destRoot), string.IsNullOrEmpty(dirUri) ? destRoot : dirUri); fNeedUnpackageHelpLink = true; } else @@ -846,12 +846,12 @@ static public void AddReplaceRulesToOptions(/*Deployment.DeploymentRuleCollectio foreach (Framework.ITaskItem item in replaceRuleItems) { string ruleName = item.ItemSpec; - string objectName = item.GetMetadata(MsDeploy.ReplaceRuleMetadata.ObjectName.ToString()); - string matchRegularExpression = item.GetMetadata(MsDeploy.ReplaceRuleMetadata.Match.ToString()); - string replaceWith = item.GetMetadata(MsDeploy.ReplaceRuleMetadata.Replace.ToString()); - string scopeAttributeName = item.GetMetadata(MsDeploy.ReplaceRuleMetadata.ScopeAttributeName.ToString()); - string scopeAttributeValue = item.GetMetadata(MsDeploy.ReplaceRuleMetadata.ScopeAttributeValue.ToString()); - string targetAttributeName = item.GetMetadata(MsDeploy.ReplaceRuleMetadata.TargetAttributeName.ToString()); + string objectName = item.GetMetadata(ReplaceRuleMetadata.ObjectName.ToString()); + string matchRegularExpression = item.GetMetadata(ReplaceRuleMetadata.Match.ToString()); + string replaceWith = item.GetMetadata(ReplaceRuleMetadata.Replace.ToString()); + string scopeAttributeName = item.GetMetadata(ReplaceRuleMetadata.ScopeAttributeName.ToString()); + string scopeAttributeValue = item.GetMetadata(ReplaceRuleMetadata.ScopeAttributeValue.ToString()); + string targetAttributeName = item.GetMetadata(ReplaceRuleMetadata.TargetAttributeName.ToString()); ///*Deployment.DeploymentReplaceRule*/ dynamic replaceRule = @@ -885,17 +885,17 @@ static internal void AdjsutSkipDirectives(/*Deployment.DeploymentBaseOptions*/ d { foreach (/*Deployment.DeploymentSkipDirective*/ dynamic skipDirective in baseOptions.SkipDirectives) { - if (string.Compare(skipDirective.Name, name, System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(skipDirective.Name, name, StringComparison.OrdinalIgnoreCase) == 0) { if (skipDirective.Enabled != enabled) { skipDirective.Enabled = enabled; } - log.LogMessage(string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_SkipDirectiveSetEnable, skipDirective.Name, enabled.ToString())); + log.LogMessage(string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_SkipDirectiveSetEnable, skipDirective.Name, enabled.ToString())); } } - log.LogWarning(string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_UnknownSkipDirective, name)); + log.LogWarning(string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_UnknownSkipDirective, name)); } } } @@ -914,7 +914,7 @@ static public void AddSkipDirectiveToBaseOptions(/*Deployment.DeploymentBaseOpti foreach (Framework.ITaskItem item in skipRuleItems) { arguments.Clear(); - MsDeploy.Utility.BuildArgumentsBaseOnEnumTypeName(item, arguments, typeof(SkipRuleMetadata), "\""); + BuildArgumentsBaseOnEnumTypeName(item, arguments, typeof(SkipRuleMetadata), "\""); if (arguments.Count > 0) { string name = item.ItemSpec; @@ -941,15 +941,15 @@ static public void AddDeclarParameterToOptions(/*VSMSDeploySyncOption*/ dynamic if (item != null && vSMSDeploySyncOption != null) { string name = item.ItemSpec; - string elemment = item.GetMetadata(MsDeploy.ExistingParameterValiationMetadata.Element.ToString()); + string elemment = item.GetMetadata(ExistingParameterValiationMetadata.Element.ToString()); if (string.IsNullOrEmpty(elemment)) elemment = "parameterEntry"; - string kind = item.GetMetadata(MsDeploy.DeclareParameterMetadata.Kind.ToString()); - string scope = item.GetMetadata(MsDeploy.DeclareParameterMetadata.Scope.ToString()); - string matchRegularExpression = item.GetMetadata(MsDeploy.DeclareParameterMetadata.Match.ToString()); - string description = item.GetMetadata(MsDeploy.DeclareParameterMetadata.Description.ToString()); - string defaultValue = item.GetMetadata(MsDeploy.DeclareParameterMetadata.DefaultValue.ToString()); - string tags = item.GetMetadata(MsDeploy.DeclareParameterMetadata.Tags.ToString()); + string kind = item.GetMetadata(DeclareParameterMetadata.Kind.ToString()); + string scope = item.GetMetadata(DeclareParameterMetadata.Scope.ToString()); + string matchRegularExpression = item.GetMetadata(DeclareParameterMetadata.Match.ToString()); + string description = item.GetMetadata(DeclareParameterMetadata.Description.ToString()); + string defaultValue = item.GetMetadata(DeclareParameterMetadata.DefaultValue.ToString()); + string tags = item.GetMetadata(DeclareParameterMetadata.Tags.ToString()); dynamic deploymentSyncParameter = null; // the following have out argument, can't use dynamic on it @@ -964,14 +964,14 @@ static public void AddDeclarParameterToOptions(/*VSMSDeploySyncOption*/ dynamic } if (!string.IsNullOrEmpty(kind)) { - if (string.Compare(elemment, "parameterEntry", System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(elemment, "parameterEntry", StringComparison.OrdinalIgnoreCase) == 0) { bool fAddEntry = true; foreach (dynamic entry in deploymentSyncParameter.Entries) { if (scope.Equals(entry.Scope) && matchRegularExpression.Equals(entry.Match) && - string.Compare(entry.Kind.ToString(), kind, System.StringComparison.OrdinalIgnoreCase) == 0) + string.Compare(entry.Kind.ToString(), kind, StringComparison.OrdinalIgnoreCase) == 0) { fAddEntry = false; } @@ -983,11 +983,11 @@ static public void AddDeclarParameterToOptions(/*VSMSDeploySyncOption*/ dynamic deploymentSyncParameter.Add(parameterEntry); } } - else if (string.Compare(elemment, "parameterValidation", System.StringComparison.OrdinalIgnoreCase) == 0) + else if (string.Compare(elemment, "parameterValidation", StringComparison.OrdinalIgnoreCase) == 0) { // this is bogus assertion because by default msdeploy always setup the validation which is never be null // System.Diagnostics.Debug.Assert(deploymentSyncParameter.Validation == null, "deploymentSyncParameter.Validation is already set"); - string validationString = item.GetMetadata(MsDeploy.ExistingParameterValiationMetadata.ValidationString.ToString()); + string validationString = item.GetMetadata(ExistingParameterValiationMetadata.ValidationString.ToString()); object validationKindNone = MSWebDeploymentAssembly.DynamicAssembly.GetEnumValue("Microsoft.Web.Deployment.DeploymentSyncParameterValidationKind", "None"); dynamic validationKind = validationKindNone; @@ -1000,7 +1000,7 @@ static public void AddDeclarParameterToOptions(/*VSMSDeploySyncOption*/ dynamic { if (MSWebDeploymentAssembly.DynamicAssembly.TryGetEnumValue("Microsoft.Web.Deployment.DeploymentSyncParameterValidationKind", strValidationKind, out currentvalidationKind)) { - validationKind = System.Enum.ToObject(validationKindType, ((int)(validationKind)) | ((int)(currentvalidationKind))); + validationKind = Enum.ToObject(validationKindType, ((int)(validationKind)) | ((int)(currentvalidationKind))); } } // dynamic doesn't compare, since this is enum, cast to int to compare @@ -1037,7 +1037,7 @@ static public void SetDynamicProperty(dynamic thisObj, string propertyName, obje /// static public void AddDeclareParametersToOptions(/*VSMSDeploySyncOption*/ dynamic vSMSDeploySyncOption, Framework.ITaskItem[] originalItems, bool fOptimisticPickNextDefaultValue) { - System.Collections.Generic.IList items = MsDeploy.Utility.SortParametersTaskItems(originalItems, fOptimisticPickNextDefaultValue, MsDeploy.DeclareParameterMetadata.DefaultValue.ToString()); + System.Collections.Generic.IList items = SortParametersTaskItems(originalItems, fOptimisticPickNextDefaultValue, DeclareParameterMetadata.DefaultValue.ToString()); if (vSMSDeploySyncOption != null && items != null) { foreach (Framework.ITaskItem item in items) @@ -1097,7 +1097,7 @@ static public void AddSetParametersFilesToObject(/*Deployment.DeploymentObject*/ /// static public void AddSimpleSetParametersVsMsDeployObject(MsDeploy.VSMSDeployObject srcVsMsDeployobject, Framework.ITaskItem[] originalItems, bool fOptimisticPickNextDefaultValue) { - System.Collections.Generic.IList items = MsDeploy.Utility.SortParametersTaskItems(originalItems, fOptimisticPickNextDefaultValue, MsDeploy.SimpleSyncParameterMetadata.Value.ToString()); + System.Collections.Generic.IList items = SortParametersTaskItems(originalItems, fOptimisticPickNextDefaultValue, SimpleSyncParameterMetadata.Value.ToString()); if (srcVsMsDeployobject != null && items != null) { string lastItemName = string.Empty; @@ -1106,7 +1106,7 @@ static public void AddSimpleSetParametersVsMsDeployObject(MsDeploy.VSMSDeployObj string name = item.ItemSpec; if (string.CompareOrdinal(name, lastItemName) != 0) { - string value = item.GetMetadata(MsDeploy.SimpleSyncParameterMetadata.Value.ToString()); + string value = item.GetMetadata(SimpleSyncParameterMetadata.Value.ToString()); srcVsMsDeployobject.SyncParameter(name, value); lastItemName = name; } @@ -1125,7 +1125,7 @@ static public void AddProviderOptions(/*Deployment.DeploymentProviderOptions*/ d string value = item.Value; // Error handling is not required here if the providerOptions list is different from deploymentProviderOptions.ProviderSettings. // providerOptions list contains metadata from MSBuild and this may be different from deploymentProviderOptions.ProviderSettings. - if (string.Compare(factoryName, deploymentProviderOptions.Factory.Name, System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(factoryName, deploymentProviderOptions.Factory.Name, StringComparison.OrdinalIgnoreCase) == 0) { dynamic setting = null; @@ -1150,7 +1150,7 @@ static public void AddSimpleSetParametersToObject(/*Deployment.DeploymentObject* { if (deploymentObject != null && parameters != null) { - Generic.Dictionary nameValueDictionary = new System.Collections.Generic.Dictionary(parameters.Count, System.StringComparer.OrdinalIgnoreCase); + Generic.Dictionary nameValueDictionary = new System.Collections.Generic.Dictionary(parameters.Count, StringComparer.OrdinalIgnoreCase); foreach (ParameterInfo item in parameters) { string name = item.Name; @@ -1163,7 +1163,7 @@ static public void AddSimpleSetParametersToObject(/*Deployment.DeploymentObject* dynamic parameter = null; // deploymentObject.SyncParameters.TryGetValue(name, out parameter); MSWebDeploymentAssembly.DeploymentTryGetValueContains(deploymentObject.SyncParameters, name, out parameter); - string msg = string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_AddParameterIntoObject, name, value, deploymentObject.Name); + string msg = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_AddParameterIntoObject, name, value, deploymentObject.Name); host.Log.LogMessage(msg); if (parameter != null) { @@ -1172,7 +1172,7 @@ static public void AddSimpleSetParametersToObject(/*Deployment.DeploymentObject* else { // Try to get error message to show. - Text.StringBuilder sb = MsDeploy.Utility.CleanStringBuilder; + Text.StringBuilder sb = CleanStringBuilder; foreach (dynamic param in deploymentObject.SyncParameters) { if (sb.Length != 0) @@ -1182,7 +1182,7 @@ static public void AddSimpleSetParametersToObject(/*Deployment.DeploymentObject* sb.Append(param.Name); } // To do, change this to resource - string errMessage = string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_UnknownParameter, name, sb.ToString()); + string errMessage = string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_UnknownParameter, name, sb.ToString()); if (host != null) { throw new System.InvalidOperationException(errMessage); @@ -1202,7 +1202,7 @@ static public void AddSetParametersToObject(/*Deployment.DeploymentObject*/ dyna { if (deploymentObject != null && parameters != null) { - Generic.Dictionary nameValueDictionary = new System.Collections.Generic.Dictionary(parameters.Count, System.StringComparer.OrdinalIgnoreCase); + Generic.Dictionary nameValueDictionary = new System.Collections.Generic.Dictionary(parameters.Count, StringComparer.OrdinalIgnoreCase); Generic.Dictionary entryIdentityDictionary = new System.Collections.Generic.Dictionary(parameters.Count); foreach (ParameterInfoWithEntry item in parameters) @@ -1224,12 +1224,12 @@ static public void AddSetParametersToObject(/*Deployment.DeploymentObject*/ dyna string identityString = string.Join(";", new string[] { item.Name, item.Kind, item.Scope, item.Match, item.Element, item.ValidationString }); if (!entryIdentityDictionary.ContainsKey(identityString)) { - if (string.Compare(item.Element, "parameterEntry", System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(item.Element, "parameterEntry", StringComparison.OrdinalIgnoreCase) == 0) { parameterEntry = MSWebDeploymentAssembly.DynamicAssembly.CreateObject("Microsoft.Web.Deployment.DeploymentSyncParameterEntry", new object[] { item.Kind, item.Scope, item.Match, string.Empty }); } - else if (string.Compare(item.Element, "parameterValidation", System.StringComparison.OrdinalIgnoreCase) == 0) + else if (string.Compare(item.Element, "parameterValidation", StringComparison.OrdinalIgnoreCase) == 0) { // this is bogus assertion because by default msdeploy always setup the validation which is never be null @@ -1247,7 +1247,7 @@ static public void AddSetParametersToObject(/*Deployment.DeploymentObject*/ dyna { if (MSWebDeploymentAssembly.DynamicAssembly.TryGetEnumValue("Microsoft.Web.Deployment.DeploymentSyncParameterValidationKind", strValidationKind, out currentvalidationKind)) { - validationKind = System.Enum.ToObject(validationKindType, ((int)(validationKind)) | ((int)(currentvalidationKind))); + validationKind = Enum.ToObject(validationKindType, ((int)(validationKind)) | ((int)(currentvalidationKind))); } } // dynamic doesn't compare, since this is enum, cast to int to compare @@ -1320,23 +1320,23 @@ static public void AddSetParametersToObject(/*Deployment.DeploymentObject*/ dyna /// static public void AddSetParametersVsMsDeployObject(MsDeploy.VSMSDeployObject srcVsMsDeployobject, Framework.ITaskItem[] originalItems, bool fOptimisticPickNextDefaultValue) { - System.Collections.Generic.IList items = MsDeploy.Utility.SortParametersTaskItems(originalItems, fOptimisticPickNextDefaultValue, MsDeploy.SyncParameterMetadata.DefaultValue.ToString()); + System.Collections.Generic.IList items = SortParametersTaskItems(originalItems, fOptimisticPickNextDefaultValue, SyncParameterMetadata.DefaultValue.ToString()); if (srcVsMsDeployobject != null && items != null) { foreach (Framework.ITaskItem item in items) { string name = item.ItemSpec; - string kind = item.GetMetadata(MsDeploy.SyncParameterMetadata.Kind.ToString()); - string scope = item.GetMetadata(MsDeploy.SyncParameterMetadata.Scope.ToString()); - string matchRegularExpression = item.GetMetadata(MsDeploy.SyncParameterMetadata.Match.ToString()); - string value = item.GetMetadata(MsDeploy.SyncParameterMetadata.Value.ToString()); - string description = item.GetMetadata(MsDeploy.SyncParameterMetadata.Description.ToString()); - string defaultValue = item.GetMetadata(MsDeploy.SyncParameterMetadata.DefaultValue.ToString()); - string tags = item.GetMetadata(MsDeploy.SyncParameterMetadata.Tags.ToString()); - string element = item.GetMetadata(MsDeploy.ExistingParameterValiationMetadata.Element.ToString()); + string kind = item.GetMetadata(SyncParameterMetadata.Kind.ToString()); + string scope = item.GetMetadata(SyncParameterMetadata.Scope.ToString()); + string matchRegularExpression = item.GetMetadata(SyncParameterMetadata.Match.ToString()); + string value = item.GetMetadata(SyncParameterMetadata.Value.ToString()); + string description = item.GetMetadata(SyncParameterMetadata.Description.ToString()); + string defaultValue = item.GetMetadata(SyncParameterMetadata.DefaultValue.ToString()); + string tags = item.GetMetadata(SyncParameterMetadata.Tags.ToString()); + string element = item.GetMetadata(ExistingParameterValiationMetadata.Element.ToString()); if (string.IsNullOrEmpty(element)) element = "parameterEntry"; - string validationString = item.GetMetadata(MsDeploy.ExistingParameterValiationMetadata.ValidationString.ToString()); + string validationString = item.GetMetadata(ExistingParameterValiationMetadata.ValidationString.ToString()); if (string.IsNullOrEmpty(value)) @@ -1367,7 +1367,7 @@ static public void AddSetParametersFilesVsMsDeployObject(VSMSDeployObject srcVsM static public string DumpITeaskItem(Framework.ITaskItem iTaskItem) { - Text.StringBuilder sb = MsDeploy.Utility.CleanStringBuilder; + Text.StringBuilder sb = CleanStringBuilder; string itemspec = iTaskItem.ItemSpec; sb.Append(" internal static void RemoveAllEmptyDirectories(string dirPath, Utilities.TaskLoggingHelper Log) { - if (!string.IsNullOrEmpty(dirPath) && IO.Directory.Exists(dirPath)) + if (!string.IsNullOrEmpty(dirPath) && Directory.Exists(dirPath)) { IO.DirectoryInfo dirInfo = new System.IO.DirectoryInfo(dirPath); RemoveAllEmptyDirectories(dirInfo, Log); @@ -1442,7 +1442,7 @@ internal static void RemoveAllEmptyDirectories(IO.DirectoryInfo dirinfo, Utiliti dirinfo.Delete(); if (log != null) { - log.LogMessage(Microsoft.Build.Framework.MessageImportance.Normal, string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.BUILDTASK_RemoveEmptyDirectories_Deleting, dirinfo.FullName)); + log.LogMessage(Framework.MessageImportance.Normal, string.Format(CultureInfo.CurrentCulture, Resources.BUILDTASK_RemoveEmptyDirectories_Deleting, dirinfo.FullName)); } } @@ -1474,7 +1474,7 @@ internal static PriorityIndexComparer ParameterTaskComparer { Generic.List optimizedValueList = new System.Collections.Generic.List(sortedList); - Generic.Dictionary FoundDictionary = new System.Collections.Generic.Dictionary(optimizedValueList.Count, System.StringComparer.OrdinalIgnoreCase); + Generic.Dictionary FoundDictionary = new System.Collections.Generic.Dictionary(optimizedValueList.Count, StringComparer.OrdinalIgnoreCase); int maxCount = sortedList.Count; int i = 0; @@ -1503,7 +1503,7 @@ internal static PriorityIndexComparer ParameterTaskComparer while (next < maxCount) { Framework.ITaskItem nextitem = optimizedValueList[next++]; - if (string.Compare(itemSpec, nextitem.ItemSpec, System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(itemSpec, nextitem.ItemSpec, StringComparison.OrdinalIgnoreCase) == 0) { string itemData = nextitem.GetMetadata(PropertyName); if (!string.IsNullOrEmpty(itemData)) @@ -1550,14 +1550,14 @@ static int ContainMsdeployFwlink(string errorMessage, out string provider) { string fwlink = Fwlinks[i]; int lastIndexOfFwLink = -1; - if ((lastIndexOfFwLink = errorMessage.LastIndexOf(fwlink, System.StringComparison.OrdinalIgnoreCase)) >= 0) + if ((lastIndexOfFwLink = errorMessage.LastIndexOf(fwlink, StringComparison.OrdinalIgnoreCase)) >= 0) { index = i; if (i == 0) { string subError = errorMessage.Substring(0, lastIndexOfFwLink); subError = subError.Trim(); - if ((lastIndexOfFwLink = subError.LastIndexOf(" ", System.StringComparison.Ordinal)) >= 0) + if ((lastIndexOfFwLink = subError.LastIndexOf(" ", StringComparison.Ordinal)) >= 0) { provider = subError.Substring(lastIndexOfFwLink + 1); } @@ -1583,7 +1583,7 @@ internal static bool IsType(System.Type type, System.Type checkType) internal static string EnsureTrailingSlash(string str) { - if (str != null && !str.EndsWith("/", System.StringComparison.Ordinal)) + if (str != null && !str.EndsWith("/", StringComparison.Ordinal)) { str += "/"; } @@ -1591,7 +1591,7 @@ internal static string EnsureTrailingSlash(string str) } internal static string EnsureTrailingBackSlash(string str) { - if (str != null && !str.EndsWith("\\", System.StringComparison.Ordinal)) + if (str != null && !str.EndsWith("\\", StringComparison.Ordinal)) { str += "\\"; } @@ -1634,23 +1634,23 @@ internal static void LogVsMsDeployException(Utilities.TaskLoggingHelper Log, Sys // 404 come in as ProtocolError if (webException.Status == System.Net.WebExceptionStatus.ProtocolError) { - if (webException.Message.LastIndexOf("401", System.StringComparison.Ordinal) >= 0) + if (webException.Message.LastIndexOf("401", StringComparison.Ordinal) >= 0) { strBuilder.Append(Resources.VSMSDEPLOY_WebException401Message); } - else if (webException.Message.LastIndexOf("404", System.StringComparison.Ordinal) >= 0) + else if (webException.Message.LastIndexOf("404", StringComparison.Ordinal) >= 0) { strBuilder.Append(Resources.VSMSDEPLOY_WebException404Message); } - else if (webException.Message.LastIndexOf("502", System.StringComparison.Ordinal) >= 0) + else if (webException.Message.LastIndexOf("502", StringComparison.Ordinal) >= 0) { strBuilder.Append(Resources.VSMSDEPLOY_WebException502Message); } - else if (webException.Message.LastIndexOf("550", System.StringComparison.Ordinal) >= 0) + else if (webException.Message.LastIndexOf("550", StringComparison.Ordinal) >= 0) { strBuilder.Append(Resources.VSMSDEPLOY_WebException550Message); } - else if (webException.Message.LastIndexOf("551", System.StringComparison.Ordinal) >= 0) + else if (webException.Message.LastIndexOf("551", StringComparison.Ordinal) >= 0) { strBuilder.Append(Resources.VSMSDEPLOY_WebException551Message); } @@ -1678,7 +1678,7 @@ internal static void LogVsMsDeployException(Utilities.TaskLoggingHelper Log, Sys if (index == 0) { string srErrorMessage = Resources.VSMSDEPLOY_MsDeployExceptionFwlink1Message; - if (provider.LastIndexOf("sql", System.StringComparison.OrdinalIgnoreCase) >= 0) + if (provider.LastIndexOf("sql", StringComparison.OrdinalIgnoreCase) >= 0) { srErrorMessage = Resources.VSMSDEPLOY_MsDeployExceptionFwlink1SQLMessage; } @@ -1699,7 +1699,7 @@ internal static void LogVsMsDeployException(Utilities.TaskLoggingHelper Log, Sys srErrorMessage = Resources.VSMSDEPLOY_MsDeployExceptionFwlink1SiteMessage; } } - strBuilder.Append(string.Format(System.Globalization.CultureInfo.CurrentCulture,srErrorMessage, provider)); + strBuilder.Append(string.Format(CultureInfo.CurrentCulture,srErrorMessage, provider)); } else if (index == 1) { @@ -1715,7 +1715,7 @@ internal static void LogVsMsDeployException(Utilities.TaskLoggingHelper Log, Sys } else { - System.Diagnostics.Debug.Assert(false, "fwdlink5 and above is not implemented"); + Debug.Assert(false, "fwdlink5 and above is not implemented"); } } } @@ -1725,7 +1725,7 @@ internal static void LogVsMsDeployException(Utilities.TaskLoggingHelper Log, Sys if (e.InnerException == null) { strBuilder.Append(e.Message); - Log.LogError(string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_FailedWithException, strBuilder.ToString())); + Log.LogError(string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_FailedWithException, strBuilder.ToString())); } else { @@ -1733,13 +1733,13 @@ internal static void LogVsMsDeployException(Utilities.TaskLoggingHelper Log, Sys System.Exception currentException = e; while (currentException != null) { - strBuilder.Append(System.Environment.NewLine); + strBuilder.Append(Environment.NewLine); strBuilder.Append(currentException.Message); currentException = currentException.InnerException; } - Log.LogError(string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_FailedWithExceptionWithDetail, e.Message, strBuilder.ToString())); + Log.LogError(string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_FailedWithExceptionWithDetail, e.Message, strBuilder.ToString())); } - strBuilder.Append(System.Environment.NewLine); + strBuilder.Append(Environment.NewLine); strBuilder.Append(e.StackTrace); Log.LogMessage(Framework.MessageImportance.Low, strBuilder.ToString()); } @@ -1754,7 +1754,7 @@ internal static void LogVsMsDeployException(Utilities.TaskLoggingHelper Log, Sys { Framework.ITaskItem iTaskItem = taskItems[i]; string priority = iTaskItem.GetMetadata("Priority"); - int iPriority = string.IsNullOrEmpty(priority) ? 0 : System.Convert.ToInt32(priority, System.Globalization.CultureInfo.InvariantCulture); + int iPriority = string.IsNullOrEmpty(priority) ? 0 : Convert.ToInt32(priority, CultureInfo.InvariantCulture); sortedList.Add(new System.Collections.Generic.KeyValuePair(iPriority, i), iTaskItem); } return sortedList.Values; @@ -1780,7 +1780,7 @@ static public string StripOffTrailingSlashes(string str) { if (!string.IsNullOrEmpty(str)) { - while (str.EndsWith("\\", System.StringComparison.Ordinal) || str.EndsWith("/", System.StringComparison.Ordinal)) + while (str.EndsWith("\\", StringComparison.Ordinal) || str.EndsWith("/", StringComparison.Ordinal)) str = str.Substring(0, str.Length - 1); } @@ -1790,17 +1790,17 @@ static public string StripOffTrailingSlashes(string str) static public string EnsureTrailingSlashes(string rootPath, char slash) { string directorySeparator = new string(slash, 1); - string rootPathWithSlash = string.Concat(rootPath, rootPath.EndsWith(directorySeparator, System.StringComparison.Ordinal) ? string.Empty : directorySeparator); + string rootPathWithSlash = string.Concat(rootPath, rootPath.EndsWith(directorySeparator, StringComparison.Ordinal) ? string.Empty : directorySeparator); return rootPathWithSlash; } static public string GetFilePathResolution(string source, string sourceRootPath) { - if (IO.Path.IsPathRooted(source) || string.IsNullOrEmpty(sourceRootPath)) + if (Path.IsPathRooted(source) || string.IsNullOrEmpty(sourceRootPath)) return source; else - return IO.Path.Combine(sourceRootPath, source); + return Path.Combine(sourceRootPath, source); } @@ -1818,7 +1818,7 @@ static internal string GetIPAddressString(System.Net.IPAddress iPAddress) return iPAddress.ToString(); else if (iPAddress.AddressFamily == System.Net.Sockets.AddressFamily.InterNetworkV6) { - Text.StringBuilder stringBuilder = MsDeploy.Utility.CleanStringBuilder; + Text.StringBuilder stringBuilder = CleanStringBuilder; stringBuilder.Append("["); stringBuilder.Append(iPAddress.ToString()); stringBuilder.Append("]"); @@ -1843,7 +1843,7 @@ static internal bool MatchOneOfIPAddress(string IISBindingIPString, System.Net.I foreach (System.Net.IPAddress iPAddress in iPAddresses) { - if (string.Compare(GetIPAddressString(iPAddress), IISBindingIPString, System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(GetIPAddressString(iPAddress), IISBindingIPString, StringComparison.OrdinalIgnoreCase) == 0) return true; } } @@ -1867,7 +1867,7 @@ static internal void SetupMSWebDeployDynamicAssemblies(string strVersionsToTry, versionsList[MSDeploymentDllFallback] = MSDeploymentDllFallback; System.Version[] versionArray = versionsList.Values.Select(p => new System.Version(p)).ToArray(); - System.Array.Sort(versionArray); + Array.Sort(versionArray); for (int i = versionArray.GetLength(0) - 1; i >= 0; i--) { @@ -1882,7 +1882,7 @@ static internal void SetupMSWebDeployDynamicAssemblies(string strVersionsToTry, { foreach (System.Reflection.AssemblyName assemblyName in MSWebDeploymentAssembly.DynamicAssembly.Assembly.GetReferencedAssemblies()) { - if (string.Compare(assemblyName.Name, 0 , MSWebDelegationAssembly.AssemblyName, 0, MSWebDelegationAssembly.AssemblyName.Length, System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(assemblyName.Name, 0 , MSWebDelegationAssembly.AssemblyName, 0, MSWebDelegationAssembly.AssemblyName.Length, StringComparison.OrdinalIgnoreCase) == 0) { webDelegationAssemblyVersion = assemblyName.Version; break; @@ -1891,17 +1891,17 @@ static internal void SetupMSWebDeployDynamicAssemblies(string strVersionsToTry, } #endif MSWebDelegationAssembly.SetVersion(webDelegationAssemblyVersion); - task.Log.LogMessage(Microsoft.Build.Framework.MessageImportance.Low, string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYVERSIONLOAD, task.ToString(), MSWebDeploymentAssembly.DynamicAssembly.AssemblyFullName)); - task.Log.LogMessage(Microsoft.Build.Framework.MessageImportance.Low, string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYVERSIONLOAD, task.ToString(), MSWebDelegationAssembly.DynamicAssembly.AssemblyFullName)); + task.Log.LogMessage(Framework.MessageImportance.Low, string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYVERSIONLOAD, task.ToString(), MSWebDeploymentAssembly.DynamicAssembly.AssemblyFullName)); + task.Log.LogMessage(Framework.MessageImportance.Low, string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYVERSIONLOAD, task.ToString(), MSWebDelegationAssembly.DynamicAssembly.AssemblyFullName)); return; } catch (System.Exception e) { - task.Log.LogMessage(Microsoft.Build.Framework.MessageImportance.Low, string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.BUILDTASK_FailedToLoadThisVersionMsDeployTryingTheNext, versionArray[i], e.Message)); + task.Log.LogMessage(Framework.MessageImportance.Low, string.Format(CultureInfo.CurrentCulture, Resources.BUILDTASK_FailedToLoadThisVersionMsDeployTryingTheNext, versionArray[i], e.Message)); } } // if it not return by now, it is definite a error - throw new System.InvalidOperationException(string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYASSEMBLYLOAD_FAIL, task.ToString())); + throw new System.InvalidOperationException(string.Format(CultureInfo.CurrentCulture, Resources.VSMSDEPLOY_MSDEPLOYASSEMBLYLOAD_FAIL, task.ToString())); } diff --git a/src/WebSdk/Publish/Tasks/MsDeploy/DynamicAssembly.cs b/src/WebSdk/Publish/Tasks/MsDeploy/DynamicAssembly.cs index f9e841cc8d93..b952411d53d0 100644 --- a/src/WebSdk/Publish/Tasks/MsDeploy/DynamicAssembly.cs +++ b/src/WebSdk/Publish/Tasks/MsDeploy/DynamicAssembly.cs @@ -84,7 +84,7 @@ public object GetEnumValueIgnoreCase(string enumName, string enumValue) public bool TryGetEnumValue(string enumTypeName, string enumStrValue, out object retValue) { bool fGetValue = false; - retValue = System.Enum.ToObject(GetType(enumTypeName), 0); + retValue = Enum.ToObject(GetType(enumTypeName), 0); try { retValue = GetEnumValueIgnoreCase(enumTypeName, enumStrValue); @@ -108,7 +108,7 @@ public object CreateObject(string typeName, object[] arguments) System.Type[] argumentTypes = null; if (arguments == null || arguments.GetLength(0) == 0) { - argumentTypes = System.Type.EmptyTypes; + argumentTypes = Type.EmptyTypes; } else { @@ -155,7 +155,7 @@ internal static System.Delegate CreateEventHandlerDelegate(System.Ref var lambda = Expression.Lambda(body, parameters); // Diagnostics.Debug.Assert(false, lambda.ToString()); #if NET472 - return System.Delegate.CreateDelegate(handlerType, lambda.Compile(), "Invoke", false); + return Delegate.CreateDelegate(handlerType, lambda.Compile(), "Invoke", false); #else return null; #endif @@ -164,7 +164,7 @@ internal static System.Delegate CreateEventHandlerDelegate(System.Ref static public System.Delegate AddEventDeferHandler(dynamic obj, string eventName, System.Delegate deferEventHandler) { EventInfo eventinfo = obj.GetType().GetEvent(eventName); - System.Delegate eventHandler = DynamicAssembly.CreateEventHandlerDelegate(eventinfo, deferEventHandler); + System.Delegate eventHandler = CreateEventHandlerDelegate(eventinfo, deferEventHandler); eventinfo.AddEventHandler(obj, eventHandler); return eventHandler; } diff --git a/src/WebSdk/Publish/Tasks/MsDeploy/VsMSDeployObject.cs b/src/WebSdk/Publish/Tasks/MsDeploy/VsMSDeployObject.cs index c219c8b3ea2d..9c4595501593 100644 --- a/src/WebSdk/Publish/Tasks/MsDeploy/VsMSDeployObject.cs +++ b/src/WebSdk/Publish/Tasks/MsDeploy/VsMSDeployObject.cs @@ -96,7 +96,7 @@ internal static class MSDeployUtility baseOptions.EncryptPassword = vSMSDeployObject.EncryptPassword; if (!string.IsNullOrEmpty(vSMSDeployObject.WebServerManifest)) - baseOptions.WebServerConfiguration.WebServerManifest = System.IO.Path.GetFileName(vSMSDeployObject.WebServerManifest); + baseOptions.WebServerConfiguration.WebServerManifest = Path.GetFileName(vSMSDeployObject.WebServerManifest); if (!string.IsNullOrEmpty(vSMSDeployObject.WebServerDirectory)) baseOptions.WebServerConfiguration.WebServerDirectory = vSMSDeployObject.WebServerDirectory; @@ -156,7 +156,7 @@ internal static Generic.List ConvertStringIntoList(string linkExtensions internal static bool LinkContainedInTheCollection(string link, Generic.List linkCollection) { foreach (string l in linkCollection) - if (string.Compare(l, link, System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(l, link, StringComparison.OrdinalIgnoreCase) == 0) return true; return false; } @@ -189,7 +189,7 @@ public static void ChangeLinkExtensionEnableStatue(/*Deployment.DeploymentBaseOp foreach (string linkExtObj in linkExtensions) { - RegularExpressions.Regex match = new RegularExpressions.Regex(linkExtObj, System.Text.RegularExpressions.RegexOptions.IgnoreCase); + RegularExpressions.Regex match = new RegularExpressions.Regex(linkExtObj, RegularExpressions.RegexOptions.IgnoreCase); Generic.List matchedList = new Generic.List(); foreach (/*Deployment.DeploymentLinkExtension*/dynamic linkExtension in baseOptions.LinkExtensions) @@ -230,18 +230,18 @@ public VSMSDeployObject(string provider, string root) m_root = string.IsNullOrEmpty(root) ? string.Empty : root; // our code path should only take a well known provider - Diagnostics.Debug.Assert(MsDeploy.Utility.IsDeploymentWellKnownProvider(provider)); + Diagnostics.Debug.Assert(Utility.IsDeploymentWellKnownProvider(provider)); m_provider = provider; // maybe we should show the "secure data to display" // for now just supress it. #if NET472 - if (0 == string.Compare(m_provider, MSWebDeploymentAssembly.DynamicAssembly.GetEnumValue(MSDeploy.TypeName.DeploymentWellKnownProvider, MSDeploy.Provider.DBFullSql).ToString(), System.StringComparison.InvariantCultureIgnoreCase) - || 0 == string.Compare(m_provider, MSDeploy.Provider.DbDacFx , System.StringComparison.InvariantCultureIgnoreCase)) + if (0 == string.Compare(m_provider, MSWebDeploymentAssembly.DynamicAssembly.GetEnumValue(MSDeploy.TypeName.DeploymentWellKnownProvider, MSDeploy.Provider.DBFullSql).ToString(), StringComparison.InvariantCultureIgnoreCase) + || 0 == string.Compare(m_provider, MSDeploy.Provider.DbDacFx , StringComparison.InvariantCultureIgnoreCase)) m_fNoDisplayRoot = true; #else if (0 == string.Compare(m_provider, MSWebDeploymentAssembly.DynamicAssembly.GetEnumValue(MSDeploy.TypeName.DeploymentWellKnownProvider, MSDeploy.Provider.DBFullSql).ToString()) - || 0 == string.Compare(m_provider, MSDeploy.Provider.DbDacFx, System.StringComparison.OrdinalIgnoreCase)) + || 0 == string.Compare(m_provider, MSDeploy.Provider.DbDacFx, StringComparison.OrdinalIgnoreCase)) m_fNoDisplayRoot = true; #endif } @@ -256,22 +256,22 @@ public VSMSDeployObject(Build.Framework.ITaskItem taskItem) m_root = string.Empty; // our code path should only take a well known provider - Diagnostics.Debug.Assert(MsDeploy.Utility.IsDeploymentWellKnownProvider(m_provider)); + Diagnostics.Debug.Assert(Utility.IsDeploymentWellKnownProvider(m_provider)); // maybe we should show the "secure data to display" // for now just supress it. - if (0 == string.Compare(m_provider, MSWebDeploymentAssembly.DynamicAssembly.GetEnumValue(MSDeploy.TypeName.DeploymentWellKnownProvider, MSDeploy.Provider.DBFullSql).ToString(), System.StringComparison.OrdinalIgnoreCase)) + if (0 == string.Compare(m_provider, MSWebDeploymentAssembly.DynamicAssembly.GetEnumValue(MSDeploy.TypeName.DeploymentWellKnownProvider, MSDeploy.Provider.DBFullSql).ToString(), StringComparison.OrdinalIgnoreCase)) m_fNoDisplayRoot = true; m_NameValueDictionary.Clear(); foreach (string name in taskItem.MetadataNames) { - if (!MsDeploy.Utility.IsInternalMsdeployWellKnownItemMetadata(name)) + if (!Utility.IsInternalMsdeployWellKnownItemMetadata(name)) { string value = taskItem.GetMetadata(name); if (!string.IsNullOrEmpty(value)) { - if (MsDeploy.Utility.IsMsDeployWellKnownLocationInfo(name)) + if (Utility.IsMsDeployWellKnownLocationInfo(name)) { m_NameValueDictionary.Add(name, value); } @@ -285,7 +285,7 @@ public VSMSDeployObject(Build.Framework.ITaskItem taskItem) else { MsDeploy.Utility.IISExpressMetadata expressMetadata; - if (System.Enum.TryParse(name, out expressMetadata)) + if (Enum.TryParse(name, out expressMetadata)) { string value = taskItem.GetMetadata(name); if (!string.IsNullOrEmpty(value)) @@ -340,7 +340,7 @@ private void SetDictionaryValue(string name, string value) Generic.IList m_iListParameterWithEntry = new Generic.List(); Generic.IList m_iListSetParametersFiles = new Generic.List(); - private System.Collections.Generic.Dictionary m_NameValueDictionary = new System.Collections.Generic.Dictionary(10, System.StringComparer.OrdinalIgnoreCase); + private System.Collections.Generic.Dictionary m_NameValueDictionary = new System.Collections.Generic.Dictionary(10, StringComparer.OrdinalIgnoreCase); protected /*Deployment.DeploymentBaseOptions*/ dynamic m_deploymentBaseOptions = null; @@ -458,13 +458,13 @@ public string EncryptPassword } public bool IncludeAcls { - get { return System.Convert.ToBoolean(GetDictionaryValue("includeAcls"), System.Globalization.CultureInfo.InvariantCulture); } + get { return Convert.ToBoolean(GetDictionaryValue("includeAcls"), System.Globalization.CultureInfo.InvariantCulture); } set { SetDictionaryValue("includeAcls", value.ToString()); } } public bool PrefetchPayload { - get { return System.Convert.ToBoolean(GetDictionaryValue("prefetchPayload"), System.Globalization.CultureInfo.InvariantCulture); } + get { return Convert.ToBoolean(GetDictionaryValue("prefetchPayload"), System.Globalization.CultureInfo.InvariantCulture); } set { SetDictionaryValue("prefetchPayload", value.ToString()); } } @@ -574,22 +574,22 @@ public void SyncTo(VSMSDeployObject destObject, /*VSMSDeploySyncOption*/ dynamic /*Deployment.DeploymentProviderOptions*/ dynamic srcProviderConfig = MSWebDeploymentAssembly.DynamicAssembly.CreateObject("Microsoft.Web.Deployment.DeploymentProviderOptions", new object[]{Provider.ToString()}); srcProviderConfig.Path = Root; - MsDeploy.Utility.AddProviderOptions(srcProviderConfig, ProviderOptions, _host); + Utility.AddProviderOptions(srcProviderConfig, ProviderOptions, _host); using (/*Deployment.DeploymentObject*/ dynamic srcObj = MSWebDeploymentAssembly.DynamicAssembly.CallStaticMethod("Microsoft.Web.Deployment.DeploymentManager", "CreateObject", new object[]{srcProviderConfig, BaseOptions})) { //$BUGBUG lmchen, there is only set to source provider? // set up the parameter - MsDeploy.Utility.AddSetParametersFilesToObject(srcObj, SetParametersFiles, _host); - MsDeploy.Utility.AddSimpleSetParametersToObject(srcObj, Parameters, _host); - MsDeploy.Utility.AddSetParametersToObject(srcObj, EntryParameters, _host); + Utility.AddSetParametersFilesToObject(srcObj, SetParametersFiles, _host); + Utility.AddSimpleSetParametersToObject(srcObj, Parameters, _host); + Utility.AddSetParametersToObject(srcObj, EntryParameters, _host); /*Deployment.DeploymentProviderOptions*/ dynamic destProviderConfig = MSWebDeploymentAssembly.DynamicAssembly.CreateObject("Microsoft.Web.Deployment.DeploymentProviderOptions", new object[]{destObject.Provider.ToString()}); destProviderConfig.Path = destObject.Root; // Setup Destination Provider otpion - MsDeploy.Utility.AddProviderOptions(destProviderConfig, destObject.ProviderOptions, _host); + Utility.AddProviderOptions(destProviderConfig, destObject.ProviderOptions, _host); srcObj.SyncTo(destProviderConfig, destObject.BaseOptions, syncOptions); } diff --git a/src/WebSdk/Publish/Tasks/Tasks/Kudu/KuduDeploy.cs b/src/WebSdk/Publish/Tasks/Tasks/Kudu/KuduDeploy.cs index 9ddaa9c05c40..75817c86e478 100644 --- a/src/WebSdk/Publish/Tasks/Tasks/Kudu/KuduDeploy.cs +++ b/src/WebSdk/Publish/Tasks/Tasks/Kudu/KuduDeploy.cs @@ -90,7 +90,7 @@ public override bool Execute() if (publishStatus) { - Log.LogMessage(Microsoft.Build.Framework.MessageImportance.High, Resources.KUDUDEPLOY_PublishSucceeded); + Log.LogMessage(Framework.MessageImportance.High, Resources.KUDUDEPLOY_PublishSucceeded); } else { @@ -162,8 +162,8 @@ internal bool DeployZipFile(KuduConnectionInfo connectionInfo) internal string CreateZipFile(string sourcePath) { // Zip the files from PublishOutput path. - string zipFileFullPath = System.IO.Path.Combine(System.IO.Path.GetTempPath(), String.Format("Publish{0}.zip", new Random().Next(Int32.MaxValue))); - Log.LogMessage(Microsoft.Build.Framework.MessageImportance.High, String.Format(Resources.KUDUDEPLOY_CopyingToTempLocation, zipFileFullPath)); + string zipFileFullPath = Path.Combine(Path.GetTempPath(), String.Format("Publish{0}.zip", new Random().Next(Int32.MaxValue))); + Log.LogMessage(Framework.MessageImportance.High, String.Format(Resources.KUDUDEPLOY_CopyingToTempLocation, zipFileFullPath)); try { @@ -176,7 +176,7 @@ internal string CreateZipFile(string sourcePath) return null; } - Log.LogMessage(Microsoft.Build.Framework.MessageImportance.High, Resources.KUDUDEPLOY_CopyingToTempLocationCompleted); + Log.LogMessage(Framework.MessageImportance.High, Resources.KUDUDEPLOY_CopyingToTempLocationCompleted); return zipFileFullPath; } diff --git a/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/CreateManifestFile.cs b/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/CreateManifestFile.cs index 3a8f84ab6784..dd5539befb04 100644 --- a/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/CreateManifestFile.cs +++ b/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/CreateManifestFile.cs @@ -81,7 +81,7 @@ private static void WriteManifestsToFile(Utilities.TaskLoggingHelper loggingHelp } // Save the UTF8 and Indented - Utility.SaveDocument(document, outputFileName, System.Text.Encoding.UTF8); + Utility.SaveDocument(document, outputFileName, Encoding.UTF8); } /// diff --git a/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/CreateParameterFile.cs b/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/CreateParameterFile.cs index f5f8ec44aeaf..655964037149 100644 --- a/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/CreateParameterFile.cs +++ b/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/CreateParameterFile.cs @@ -106,7 +106,7 @@ private static void WriteDeclareParametersToFile(Utilities.TaskLoggingHelper log if (parameters != null) { System.Collections.Generic.Dictionary dictionaryLookup - = new System.Collections.Generic.Dictionary(parameters.GetLength(0), System.StringComparer.OrdinalIgnoreCase); + = new System.Collections.Generic.Dictionary(parameters.GetLength(0), StringComparer.OrdinalIgnoreCase); // we are on purpose to keep the order without optimistic change the Value/Default base on the non-null optimistic System.Collections.Generic.IList items @@ -138,11 +138,11 @@ private static void WriteDeclareParametersToFile(Utilities.TaskLoggingHelper log string[] parameterIdentities = s_parameterEntryIdentities; - if (string.Compare(elementValue, "parameterEntry", System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(elementValue, "parameterEntry", StringComparison.OrdinalIgnoreCase) == 0) { parameterIdentities = s_parameterEntryIdentities; } - else if (string.Compare(elementValue, "parameterValidation", System.StringComparison.OrdinalIgnoreCase) == 0) + else if (string.Compare(elementValue, "parameterValidation", StringComparison.OrdinalIgnoreCase) == 0) { parameterIdentities = s_parameterValidationIdentities; } @@ -178,7 +178,7 @@ private static void WriteDeclareParametersToFile(Utilities.TaskLoggingHelper log Xml.XmlElement childElement = childNode as Xml.XmlElement; if (childElement != null) { - if (string.Compare(childElement.Name, identityValues[0], System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(childElement.Name, identityValues[0], StringComparison.OrdinalIgnoreCase) == 0) { fIdentical = true; for (int i = 1; i < parameterIdentitiesCount; i++) @@ -224,7 +224,7 @@ private static void WriteDeclareParametersToFile(Utilities.TaskLoggingHelper log } // Save the UTF8 and Indented - Utility.SaveDocument(document, outputFileName, System.Text.Encoding.UTF8); + Utility.SaveDocument(document, outputFileName, Encoding.UTF8); } /// @@ -263,7 +263,7 @@ private static void WriteSetParametersToFile(Utilities.TaskLoggingHelper logging } // Save the UTF8 and Indented - Utility.SaveDocument(document, outputFileName, System.Text.Encoding.UTF8); + Utility.SaveDocument(document, outputFileName, Encoding.UTF8); } /// diff --git a/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/ImportParameterFile.cs b/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/ImportParameterFile.cs index 3b8e1459c996..a8198b3826a8 100644 --- a/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/ImportParameterFile.cs +++ b/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/ImportParameterFile.cs @@ -46,7 +46,7 @@ public bool DisableEscapeMSBuildVariable private void ReadParametersElement(Xml.XmlElement element) { Debug.Assert(element != null); - if (string.Compare(element.Name, "parameters", System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(element.Name, "parameters", StringComparison.OrdinalIgnoreCase) == 0) { foreach (Xml.XmlNode childNode in element.ChildNodes) { @@ -66,7 +66,7 @@ private void ReadParametersElement(Xml.XmlElement element) private void ReadParameterElement(Xml.XmlElement element) { Debug.Assert(element != null); - if (string.Compare(element.Name, "parameter", System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(element.Name, "parameter", StringComparison.OrdinalIgnoreCase) == 0) { Xml.XmlAttribute nameAttribute = element.Attributes.GetNamedItem("name") as Xml.XmlAttribute; if (nameAttribute != null) @@ -76,7 +76,7 @@ private void ReadParameterElement(Xml.XmlElement element) { string attributeName = attribute.Name.ToLower(System.Globalization.CultureInfo.InvariantCulture); if (string.CompareOrdinal(attributeName, "xmlns") == 0 - || attribute.Name.StartsWith("xmlns:", System.StringComparison.Ordinal) + || attribute.Name.StartsWith("xmlns:", StringComparison.Ordinal) || string.CompareOrdinal(attributeName, "name") == 0 ) { @@ -122,7 +122,7 @@ private Utilities.TaskItem ReadParameterEntryElement(Xml.XmlElement element, Uti { Debug.Assert(element != null && parentItem != null); Utilities.TaskItem taskItem = null; - if (string.Compare(element.Name, "parameterEntry", System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(element.Name, "parameterEntry", StringComparison.OrdinalIgnoreCase) == 0) { taskItem = new Microsoft.Build.Utilities.TaskItem(parentItem); taskItem.RemoveMetadata("OriginalItemSpec"); @@ -135,7 +135,7 @@ private Utilities.TaskItem ReadParameterEntryElement(Xml.XmlElement element, Uti } } } - else if (string.Compare(element.Name, "parameterValidation", System.StringComparison.OrdinalIgnoreCase) == 0) + else if (string.Compare(element.Name, "parameterValidation", StringComparison.OrdinalIgnoreCase) == 0) { taskItem = new Microsoft.Build.Utilities.TaskItem(parentItem); taskItem.RemoveMetadata("OriginalItemSpec"); diff --git a/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/MSDeploy.cs b/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/MSDeploy.cs index 59e411da5770..3e046ba280f6 100644 --- a/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/MSDeploy.cs +++ b/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/MSDeploy.cs @@ -242,8 +242,8 @@ public string ExePath string[] strVersions = registryKey.GetSubKeyNames(); if (strVersions != null) { - int [] versions = registryKey.GetSubKeyNames().Select(p => System.Convert.ToInt32(p)).ToArray(); - System.Array.Sort(versions); + int [] versions = registryKey.GetSubKeyNames().Select(p => Convert.ToInt32(p)).ToArray(); + Array.Sort(versions); for (int i = versions.Length -1; i >= 0; i--) { @@ -269,22 +269,22 @@ public string ExePath if (string.IsNullOrEmpty(m_exePath)) { string programFiles = Environment.ExpandEnvironmentVariables("%ProgramFiles(x86)%"); - string msdeployExePath = IO.Path.Combine("IIS", "Microsoft Web Deploy V3"); - m_exePath = IO.Path.Combine(programFiles, msdeployExePath); - if (!IO.File.Exists(IO.Path.Combine(m_exePath, ToolName))) + string msdeployExePath = Path.Combine("IIS", "Microsoft Web Deploy V3"); + m_exePath = Path.Combine(programFiles, msdeployExePath); + if (!File.Exists(Path.Combine(m_exePath, ToolName))) { /// On 32-bit Operating Systems, this will return C:\Program Files /// On 64-bit Operating Systems - regardless of process bitness, this will return C:\Program Files if (!Environment.Is64BitOperatingSystem || Environment.Is64BitProcess) { programFiles = Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles); - m_exePath = IO.Path.Combine(programFiles, msdeployExePath); + m_exePath = Path.Combine(programFiles, msdeployExePath); } else { // 32 bit process on a 64 bit OS can't use SpecialFolder.ProgramFiles to get the 64-bit program files folder programFiles = Environment.ExpandEnvironmentVariables("%ProgramW6432%"); - m_exePath = IO.Path.Combine(programFiles, msdeployExePath); + m_exePath = Path.Combine(programFiles, msdeployExePath); } } } @@ -477,7 +477,7 @@ public string UserAgent { if (!string.IsNullOrEmpty(value)) { - _userAgent = MsDeploy.Utility.GetFullUserAgentString(value); + _userAgent = Utility.GetFullUserAgentString(value); } } } @@ -538,7 +538,7 @@ protected override Framework.MessageImportance StandardOutputLoggingImportance { get { - return Microsoft.Build.Framework.MessageImportance.High; + return Framework.MessageImportance.High; } } @@ -593,7 +593,7 @@ public override bool Execute() type = taskItem.ItemSpec; path = taskItem.GetMetadata("Path"); } - MsDeploy.Utility.MsDeployExeEndOfExecuteMessage(bSuccess, type, path, Log); + Utility.MsDeployExeEndOfExecuteMessage(bSuccess, type, path, Log); } return bSuccess; } @@ -611,7 +611,7 @@ static public void AddReplaceRulesToOptions(Utilities.CommandLineBuilder command foreach (Framework.ITaskItem item in replaceRuleItems) { arguments.Clear(); - MsDeploy.Utility.BuildArgumentsBaseOnEnumTypeName(item, arguments, typeof(MsDeploy.ReplaceRuleMetadata), valueQuoteChar); + Utility.BuildArgumentsBaseOnEnumTypeName(item, arguments, typeof(MsDeploy.ReplaceRuleMetadata), valueQuoteChar); commandLineBuilder.AppendSwitchUnquotedIfNotNull("-replace:", arguments.Count == 0 ? null : string.Join(",", arguments.ToArray())); } } @@ -627,7 +627,7 @@ static public void AddSkipDirectiveToBaseOptions(Utilities.CommandLineBuilder co foreach (Framework.ITaskItem item in skipRuleItems) { arguments.Clear(); - MsDeploy.Utility.BuildArgumentsBaseOnEnumTypeName(item, arguments, typeof(MsDeploy.SkipRuleMetadata), valueQuoteChar); + Utility.BuildArgumentsBaseOnEnumTypeName(item, arguments, typeof(MsDeploy.SkipRuleMetadata), valueQuoteChar); commandLineBuilder.AppendSwitchUnquotedIfNotNull("-skip:", arguments.Count == 0 ? null : string.Join(",", arguments.ToArray())); } } @@ -648,13 +648,13 @@ static public void AddDeclareParameterToCommandArgument(System.Collections.Gener string name = item.ItemSpec; if (!string.IsNullOrEmpty(name)) { - string element = item.GetMetadata(MsDeploy.ExistingParameterValiationMetadata.Element.ToString()); + string element = item.GetMetadata(ExistingParameterValiationMetadata.Element.ToString()); if (string.IsNullOrEmpty(element)) element = "parameterEntry"; - if (string.Compare(element, "parameterEntry", System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(element, "parameterEntry", StringComparison.OrdinalIgnoreCase) == 0) { idenities.Add(name); - foreach (string dPIdentity in System.Enum.GetNames(typeof(MsDeploy.ExistingDeclareParameterMetadata))) + foreach (string dPIdentity in Enum.GetNames(typeof(MsDeploy.ExistingDeclareParameterMetadata))) { idenities.Add(item.GetMetadata(dPIdentity)); } @@ -662,15 +662,15 @@ static public void AddDeclareParameterToCommandArgument(System.Collections.Gener string identity = string.Join(",", idenities.ToArray()); if (!lookupDictionary.ContainsKey(identity)) { - string nameValue = MsDeploy.Utility.PutValueInQuote(name, valueQuote); + string nameValue = Utility.PutValueInQuote(name, valueQuote); arguments.Add(string.Concat("name=", nameValue)); System.Type enumType = lookupDictionary.ContainsValue(name) ? typeof(MsDeploy.ExistingDeclareParameterMetadata) : typeof(MsDeploy.DeclareParameterMetadata); // the rest, build on the Enum Name - MsDeploy.Utility.BuildArgumentsBaseOnEnumTypeName(item, arguments, enumType, valueQuote); + Utility.BuildArgumentsBaseOnEnumTypeName(item, arguments, enumType, valueQuote); lookupDictionary.Add(identity, name); } } - else if (string.Compare(element, "parameterValidation", System.StringComparison.OrdinalIgnoreCase) == 0) + else if (string.Compare(element, "parameterValidation", StringComparison.OrdinalIgnoreCase) == 0) { System.Diagnostics.Debug.Assert(false, "msdeploy.exe doesn't support parameterValidation entry in the command line for declareParameter yet."); } @@ -686,7 +686,7 @@ static public void AddDeclareParameterToCommandArgument(System.Collections.Gener /// static public void AddDeclareParametersOptions(Utilities.CommandLineBuilder commandLineBuilder, Framework.ITaskItem[] originalItems, string valueQuote, bool foptimisticParameterDefaultValue) { - System.Collections.Generic.IList items = MsDeploy.Utility.SortParametersTaskItems(originalItems, foptimisticParameterDefaultValue, MsDeploy.DeclareParameterMetadata.DefaultValue.ToString()); + System.Collections.Generic.IList items = Utility.SortParametersTaskItems(originalItems, foptimisticParameterDefaultValue, DeclareParameterMetadata.DefaultValue.ToString()); if (commandLineBuilder != null && items != null) { System.Collections.Generic.List arguments = new System.Collections.Generic.List(6); @@ -737,7 +737,7 @@ static internal void AddImportParametersFilesOptions(Utilities.CommandLineBuilde /// static public void AddSimpleSetParametersToObject(Utilities.CommandLineBuilder commandLineBuilder, Framework.ITaskItem[] originalItems, string valueQuoteChar, bool foptimisticParameterDefaultValue) { - System.Collections.Generic.IList items = MsDeploy.Utility.SortParametersTaskItems(originalItems, foptimisticParameterDefaultValue, MsDeploy.SimpleSyncParameterMetadata.Value.ToString()); + System.Collections.Generic.IList items = Utility.SortParametersTaskItems(originalItems, foptimisticParameterDefaultValue, SimpleSyncParameterMetadata.Value.ToString()); if (commandLineBuilder != null && items != null) { System.Collections.Generic.List arguments = new System.Collections.Generic.List(6); @@ -749,12 +749,12 @@ static public void AddSimpleSetParametersToObject(Utilities.CommandLineBuilder c string name = item.ItemSpec; if (!string.IsNullOrEmpty(name)) { - string valueData = MsDeploy.Utility.PutValueInQuote(name, valueQuoteChar); + string valueData = Utility.PutValueInQuote(name, valueQuoteChar); arguments.Add(string.Concat("name=", valueData)); } // the rest, build on the enum name - MsDeploy.Utility.BuildArgumentsBaseOnEnumTypeName(item, arguments, typeof(MsDeploy.SimpleSyncParameterMetadata), valueQuoteChar); + Utility.BuildArgumentsBaseOnEnumTypeName(item, arguments, typeof(MsDeploy.SimpleSyncParameterMetadata), valueQuoteChar); commandLineBuilder.AppendSwitchUnquotedIfNotNull("-setParam:", arguments.Count == 0 ? null : string.Join(",", arguments.ToArray())); } } @@ -767,12 +767,12 @@ static public void AddSimpleSetParametersToObject(Utilities.CommandLineBuilder c /// static public void AddSetParametersToObject(Utilities.CommandLineBuilder commandLineBuilder, Framework.ITaskItem[] originalItems, string valueQuote, bool foptimisticParameterDefaultValue) { - System.Collections.Generic.IList items = MsDeploy.Utility.SortParametersTaskItems(originalItems, foptimisticParameterDefaultValue, MsDeploy.ExistingSyncParameterMetadata.Value.ToString()); + System.Collections.Generic.IList items = Utility.SortParametersTaskItems(originalItems, foptimisticParameterDefaultValue, ExistingSyncParameterMetadata.Value.ToString()); if (commandLineBuilder != null && items != null) { System.Collections.Generic.List arguments = new System.Collections.Generic.List(6); System.Collections.Generic.Dictionary lookupDictionary = new System.Collections.Generic.Dictionary(items.Count); - System.Collections.Generic.Dictionary nameValueDictionary = new System.Collections.Generic.Dictionary(items.Count, System.StringComparer.OrdinalIgnoreCase); + System.Collections.Generic.Dictionary nameValueDictionary = new System.Collections.Generic.Dictionary(items.Count, StringComparer.OrdinalIgnoreCase); foreach (Framework.ITaskItem item in items) { @@ -783,15 +783,15 @@ static public void AddSetParametersToObject(Utilities.CommandLineBuilder command string name = item.ItemSpec; if (!string.IsNullOrEmpty(name)) { - string element = item.GetMetadata(MsDeploy.ExistingParameterValiationMetadata.Element.ToString()); + string element = item.GetMetadata(ExistingParameterValiationMetadata.Element.ToString()); if (string.IsNullOrEmpty(element)) element = "parameterEntry"; - if (string.Compare(element, "parameterEntry", System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(element, "parameterEntry", StringComparison.OrdinalIgnoreCase) == 0) { idenities.Add(name); - foreach (string dPIdentity in System.Enum.GetNames(typeof(MsDeploy.ExistingDeclareParameterMetadata))) + foreach (string dPIdentity in Enum.GetNames(typeof(MsDeploy.ExistingDeclareParameterMetadata))) { idenities.Add(item.GetMetadata(dPIdentity)); } @@ -808,27 +808,27 @@ static public void AddSetParametersToObject(Utilities.CommandLineBuilder command } else { - data = item.GetMetadata(MsDeploy.ExistingSyncParameterMetadata.Value.ToString()); + data = item.GetMetadata(ExistingSyncParameterMetadata.Value.ToString()); nameValueDictionary.Add(name, data); } // the rest, build on the Enum Name - MsDeploy.Utility.BuildArgumentsBaseOnEnumTypeName(item, arguments, typeof(MsDeploy.ExistingDeclareParameterMetadata), valueQuote); + Utility.BuildArgumentsBaseOnEnumTypeName(item, arguments, typeof(MsDeploy.ExistingDeclareParameterMetadata), valueQuote); if (arguments.Count > 0 && !string.IsNullOrEmpty(data)) { #if NET472 - arguments.Add(string.Concat(MsDeploy.ExistingSyncParameterMetadata.Value.ToString().ToLower(System.Globalization.CultureInfo.InvariantCulture), - "=", MsDeploy.Utility.PutValueInQuote(data, valueQuote))); + arguments.Add(string.Concat(ExistingSyncParameterMetadata.Value.ToString().ToLower(CultureInfo.InvariantCulture), + "=", Utility.PutValueInQuote(data, valueQuote))); #else - arguments.Add(string.Concat(MsDeploy.ExistingSyncParameterMetadata.Value.ToString().ToLower(), - "=", MsDeploy.Utility.PutValueInQuote(data, valueQuote))); + arguments.Add(string.Concat(ExistingSyncParameterMetadata.Value.ToString().ToLower(), + "=", Utility.PutValueInQuote(data, valueQuote))); #endif } lookupDictionary.Add(identity, name); } } - else if (string.Compare(element, "parameterValidation", System.StringComparison.OrdinalIgnoreCase) == 0) + else if (string.Compare(element, "parameterValidation", StringComparison.OrdinalIgnoreCase) == 0) { System.Diagnostics.Debug.Assert(false, "msdeploy.exe doesn't support parameterValidation entry in the command line for declareParameter yet."); } @@ -852,7 +852,7 @@ static public void AddDestinationProviderSettingToObject(Utilities.CommandLineBu Framework.ITaskItem taskItem = items[0]; string provider = taskItem.ItemSpec; string path = taskItem.GetMetadata("Path"); - string valueData = MsDeploy.Utility.PutValueInQuote(path, valueQuoteChar); + string valueData = Utility.PutValueInQuote(path, valueQuoteChar); string setData = (string.IsNullOrEmpty(path)) ? provider : string.Concat(provider, "=", valueData); arguments.Add(setData); @@ -868,12 +868,12 @@ static public void AddDestinationProviderSettingToObject(Utilities.CommandLineBu foreach (string name in taskItem.MetadataNames) { - if (!MsDeploy.Utility.IsInternalMsdeployWellKnownItemMetadata(name)) + if (!Utility.IsInternalMsdeployWellKnownItemMetadata(name)) { string value = taskItem.GetMetadata(name); if (!string.IsNullOrEmpty(value)) { - valueData = MsDeploy.Utility.PutValueInQuote(value, valueQuoteChar); + valueData = Utility.PutValueInQuote(value, valueQuoteChar); setData = string.Concat(name, "=", valueData); arguments.Add(setData); } @@ -881,7 +881,7 @@ static public void AddDestinationProviderSettingToObject(Utilities.CommandLineBu else { MsDeploy.Utility.IISExpressMetadata expressMetadata; - if (System.Enum.TryParse(name, out expressMetadata)) + if (Enum.TryParse(name, out expressMetadata)) { string value = taskItem.GetMetadata(name); if (!string.IsNullOrEmpty(value)) @@ -1039,7 +1039,7 @@ protected override string GenerateCommandLineCommands() commandLine.AppendSwitchIfNotNull("-appHostConfigDir:", WebServerAppHostConfigDirectory); commandLine.AppendSwitchIfNotNull("-webServerDir:", WebServerDirectory); // bug in msdeploy.exe currently only take the file name - commandLine.AppendSwitchIfNotNull("-webServerManifest:", System.IO.Path.GetFileName(WebServerManifest)); + commandLine.AppendSwitchIfNotNull("-webServerManifest:", Path.GetFileName(WebServerManifest)); m_lastCommandLine = commandLine.ToString(); @@ -1062,9 +1062,9 @@ protected override string ToolName /// path to aspnet_merge.exe, null if not found protected override string GenerateFullPathToTool() { - string result = IO.Path.Combine(ExePath, ToolName); + string result = Path.Combine(ExePath, ToolName); - if (string.Compare(ExePath, "%MSDeployPath%", System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(ExePath, "%MSDeployPath%", StringComparison.OrdinalIgnoreCase) == 0) { // if it comes in as %msdeploypath% don't use Path.Combine because it will add a \ which is // not necessary since reg key for MSDeployPath already contains it @@ -1082,13 +1082,13 @@ protected override bool ValidateParameters() { if (Source != null && Source.GetLength(0) > 1) { - Log.LogError(string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.MSDEPLOY_InvalidSourceCount, Source.GetLength(0)), null); + Log.LogError(string.Format(CultureInfo.CurrentCulture, Resources.MSDEPLOY_InvalidSourceCount, Source.GetLength(0)), null); return false; } if (Destination != null && Destination.GetLength(0) > 1) { - Log.LogError(string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.MSDEPLOY_InvalidDestinationCount, Destination.GetLength(0)), null); + Log.LogError(string.Format(CultureInfo.CurrentCulture, Resources.MSDEPLOY_InvalidDestinationCount, Destination.GetLength(0)), null); return false; } else @@ -1123,13 +1123,13 @@ protected override bool ValidateParameters() { foreach (string verb in validVerbs) { - if (string.Compare(Verb, verb, System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(Verb, verb, StringComparison.OrdinalIgnoreCase) == 0) { return true; } } } - Log.LogError(string.Format(System.Globalization.CultureInfo.CurrentCulture, Resources.MSDEPLOY_InvalidVerbForTheInput, Verb, Source[0].ItemSpec, (fNullDestination) ? null : Destination[0].ItemSpec), null); + Log.LogError(string.Format(CultureInfo.CurrentCulture, Resources.MSDEPLOY_InvalidVerbForTheInput, Verb, Source[0].ItemSpec, (fNullDestination) ? null : Destination[0].ItemSpec), null); return false; } } diff --git a/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/NormalizeServiceUrl.cs b/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/NormalizeServiceUrl.cs index d0169a01b55d..b6bc96cf87ea 100644 --- a/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/NormalizeServiceUrl.cs +++ b/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/NormalizeServiceUrl.cs @@ -78,18 +78,18 @@ public override bool Execute() } else { - if (string.Compare(tempUrl, "localhost", System.StringComparison.OrdinalIgnoreCase) == 0 || - string.Compare(tempUrl, "http://localhost", System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(tempUrl, "localhost", StringComparison.OrdinalIgnoreCase) == 0 || + string.Compare(tempUrl, "http://localhost", StringComparison.OrdinalIgnoreCase) == 0) { _resultUrl = string.Empty;//through in proc and don't need server name at all. } else { - if (tempUrl.StartsWith("localhost:", System.StringComparison.OrdinalIgnoreCase)) + if (tempUrl.StartsWith("localhost:", StringComparison.OrdinalIgnoreCase)) { _resultUrl = string.Concat("http://", tempUrl); } - else if (tempUrl.StartsWith("http://localhost:", System.StringComparison.OrdinalIgnoreCase)) + else if (tempUrl.StartsWith("http://localhost:", StringComparison.OrdinalIgnoreCase)) { _resultUrl = tempUrl; } @@ -170,13 +170,13 @@ private string ConstructServiceUrlForDeployThruAgentService(string serviceUrl) // It needs to start with http:// // It needs to then have the computer name // It should then be "/MSDEPLOYAGENTSERVICE" - if (serviceUrl.StartsWith("http://", System.StringComparison.OrdinalIgnoreCase)) + if (serviceUrl.StartsWith("http://", StringComparison.OrdinalIgnoreCase)) { iSpot = "http://".Length; } url.Append(serviceUrl.Substring(iSpot)); - int msdepSpot = serviceUrl.IndexOf("/MSDEPLOYAGENTSERVICE", System.StringComparison.OrdinalIgnoreCase); + int msdepSpot = serviceUrl.IndexOf("/MSDEPLOYAGENTSERVICE", StringComparison.OrdinalIgnoreCase); if (msdepSpot < 0) { url.Append("/MSDEPLOYAGENTSERVICE"); diff --git a/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/VsMsdeploy.cs b/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/VsMsdeploy.cs index 45bed329f597..a584efa08675 100644 --- a/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/VsMsdeploy.cs +++ b/src/WebSdk/Publish/Tasks/Tasks/MsDeploy/VsMsdeploy.cs @@ -18,7 +18,7 @@ namespace Microsoft.NET.Sdk.Publish.Tasks.MsDeploy internal class MSWebDeploymentAssembly : DynamicAssembly { public MSWebDeploymentAssembly(System.Version verToLoad) : - base(MSWebDeploymentAssembly.AssemblyName, verToLoad, "31bf3856ad364e35") + base(AssemblyName, verToLoad, "31bf3856ad364e35") { } @@ -46,7 +46,7 @@ static public bool DeploymentTryGetValueForEach(dynamic deploymentCollection, st { foreach (dynamic item in deploymentCollection) { - if (string.Compare(name, item.Name.ToString(), System.StringComparison.OrdinalIgnoreCase) == 0) + if (string.Compare(name, item.Name.ToString(), StringComparison.OrdinalIgnoreCase) == 0) { foundObject = item; return true; @@ -78,7 +78,7 @@ static public bool DeploymentTryGetValueContains(dynamic deploymentCollection, s internal class MSWebDelegationAssembly : DynamicAssembly { public MSWebDelegationAssembly(System.Version verToLoad) : - base(MSWebDelegationAssembly.AssemblyName, verToLoad, "31bf3856ad364e35") + base(AssemblyName, verToLoad, "31bf3856ad364e35") { } @@ -172,9 +172,9 @@ private bool CancelCallback() object option = MSWebDeploymentAssembly.DynamicAssembly.CreateObject("Microsoft.Web.Deployment.DeploymentSyncOptions"); #if NET472 System.Type deploymentCancelCallbackType = MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentCancelCallback"); - object cancelCallbackDelegate = System.Delegate.CreateDelegate(deploymentCancelCallbackType, this, "CancelCallback"); + object cancelCallbackDelegate = Delegate.CreateDelegate(deploymentCancelCallbackType, this, "CancelCallback"); - MsDeploy.Utility.SetDynamicProperty(option, "CancelCallback", cancelCallbackDelegate); + Utility.SetDynamicProperty(option, "CancelCallback", cancelCallbackDelegate); // dynamic doesn't work with delegate. it complain on explicit cast needed from object -> DelegateType :( // _option.CancelCallback = cancelCallbackDelegate; @@ -190,13 +190,13 @@ private bool CancelCallback() { if (_highImportanceEventTypes == null) { - _highImportanceEventTypes = new System.Collections.Generic.Dictionary(System.StringComparer.InvariantCultureIgnoreCase); ; + _highImportanceEventTypes = new System.Collections.Generic.Dictionary(StringComparer.InvariantCultureIgnoreCase); ; if (!string.IsNullOrEmpty(HighImportanceEventTypes)) { string[] typeNames = HighImportanceEventTypes.Split(new char[] { ';' }); // follow msbuild convention foreach (string typeName in typeNames) { - _highImportanceEventTypes.Add(typeName, Framework.MessageImportance.High); + _highImportanceEventTypes.Add(typeName, MessageImportance.High); } } } @@ -207,7 +207,7 @@ void TraceEventHandlerDynamic(object sender, dynamic e) { // throw new System.NotImplementedException(); string msg = e.Message; - System.Diagnostics.Trace.WriteLine("MSDeploy TraceEvent Handler is called with " + msg); + Diagnostics.Trace.WriteLine("MSDeploy TraceEvent Handler is called with " + msg); #if NET472 LogTrace(e, GetHighImportanceEventTypes()); #endif @@ -524,17 +524,17 @@ protected override void LogTrace(dynamic args, System.Collections.Generic.IDicti { string strMsg = args.Message; string strEventType = "Trace"; - Framework.MessageImportance messageImportance = Microsoft.Build.Framework.MessageImportance.Low; + Framework.MessageImportance messageImportance = MessageImportance.Low; System.Type argsT = args.GetType(); - if (MsDeploy.Utility.IsType(argsT, MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentFileSerializationEventArgs")) || - MsDeploy.Utility.IsType(argsT, MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentPackageSerializationEventArgs")) || - MsDeploy.Utility.IsType(argsT, MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentObjectChangedEventArgs")) || - MsDeploy.Utility.IsType(argsT, MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentSyncParameterEventArgs"))) + if (Utility.IsType(argsT, MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentFileSerializationEventArgs")) || + Utility.IsType(argsT, MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentPackageSerializationEventArgs")) || + Utility.IsType(argsT, MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentObjectChangedEventArgs")) || + Utility.IsType(argsT, MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentSyncParameterEventArgs"))) { //promote those message only for those event strEventType = "Action"; - messageImportance = Microsoft.Build.Framework.MessageImportance.High; + messageImportance = MessageImportance.High; } else if (customTypeLoging != null && customTypeLoging.ContainsKey(argsT.Name)) { @@ -544,15 +544,15 @@ protected override void LogTrace(dynamic args, System.Collections.Generic.IDicti if (!string.IsNullOrEmpty(strMsg)) { - System.Diagnostics.TraceLevel level = (System.Diagnostics.TraceLevel)System.Enum.ToObject(typeof(System.Diagnostics.TraceLevel), args.EventLevel); + System.Diagnostics.TraceLevel level = (System.Diagnostics.TraceLevel)Enum.ToObject(typeof(System.Diagnostics.TraceLevel), args.EventLevel); switch (level) { - case System.Diagnostics.TraceLevel.Off: + case Diagnostics.TraceLevel.Off: break; - case System.Diagnostics.TraceLevel.Error: + case Diagnostics.TraceLevel.Error: _host.Log.LogError(strMsg); break; - case System.Diagnostics.TraceLevel.Warning: + case Diagnostics.TraceLevel.Warning: _host.Log.LogWarning(strMsg); break; default: // Is Warning is a Normal message @@ -801,7 +801,7 @@ public string UserAgent { if (!string.IsNullOrEmpty(value)) { - _userAgent = MsDeploy.Utility.GetFullUserAgentString(value); + _userAgent = Utility.GetFullUserAgentString(value); } } } @@ -843,7 +843,7 @@ public override bool Execute() try { - MsDeploy.Utility.SetupMSWebDeployDynamicAssemblies(MSDeployVersionsToTry, this); + Utility.SetupMSWebDeployDynamicAssemblies(MSDeployVersionsToTry, this); } catch (System.Exception exception) { @@ -852,7 +852,7 @@ public override bool Execute() } string errorMessage = null; - if (!MsDeploy.Utility.CheckMSDeploymentVersion(Log, out errorMessage)) + if (!Utility.CheckMSDeploymentVersion(Log, out errorMessage)) return false; VSMSDeployObject src = null; @@ -921,14 +921,14 @@ public override bool Execute() } System.Type eType = e.GetType(); - if (MsDeploy.Utility.IsType(eType, MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentCanceledException"))) + if (Utility.IsType(eType, MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentCanceledException"))) { - Log.LogMessageFromText(Resources.VSMSDEPLOY_Canceled, Microsoft.Build.Framework.MessageImportance.High); + Log.LogMessageFromText(Resources.VSMSDEPLOY_Canceled, MessageImportance.High); } - else if (MsDeploy.Utility.IsType(eType, MSWebDelegationAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentException")) - || MsDeploy.Utility.IsType(eType, MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentFatalException"))) + else if (Utility.IsType(eType, MSWebDelegationAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentException")) + || Utility.IsType(eType, MSWebDeploymentAssembly.DynamicAssembly.GetType("Microsoft.Web.Deployment.DeploymentFatalException"))) { - MsDeploy.Utility.LogVsMsDeployException(Log, e); + Utility.LogVsMsDeployException(Log, e); } else { @@ -1006,7 +1006,7 @@ void IVSMSDeployHost.UpdateDeploymentBaseOptions(VSMSDeployObject srcVsMsDeployo if (!string.IsNullOrEmpty(DeploymentTraceLevel)) { Diagnostics.TraceLevel deploymentTraceEventLevel = - (Diagnostics.TraceLevel)System.Enum.Parse(typeof(Diagnostics.TraceLevel), DeploymentTraceLevel, true); + (Diagnostics.TraceLevel)Enum.Parse(typeof(Diagnostics.TraceLevel), DeploymentTraceLevel, true); srcVsMsDeployobject.BaseOptions.TraceLevel = deploymentTraceEventLevel; destVsMsDeployobject.BaseOptions.TraceLevel = deploymentTraceEventLevel; } @@ -1067,9 +1067,9 @@ void IVSMSDeployHost.PopulateOptions(/*Microsoft.Web.Deployment.DeploymentSyncOp { option.WhatIf = WhatIf; // Add the replace rules, we should consider doing the same thing for the skip rule - MsDeploy.Utility.AddReplaceRulesToOptions(option.Rules, ReplaceRuleItems); - MsDeploy.Utility.AddImportDeclareParametersFileOptions(option, ImportDeclareParametersItems); - MsDeploy.Utility.AddDeclareParametersToOptions(option, DeclareParameterItems, OptimisticParameterDefaultValue); + Utility.AddReplaceRulesToOptions(option.Rules, ReplaceRuleItems); + Utility.AddImportDeclareParametersFileOptions(option, ImportDeclareParametersItems); + Utility.AddDeclareParametersToOptions(option, DeclareParameterItems, OptimisticParameterDefaultValue); option.UseChecksum = UseChecksum; option.DoNotDelete = SkipExtraFilesOnServer;