From f7a7f6ec47c2688b8f2ee5fcfac99d29782c46de Mon Sep 17 00:00:00 2001 From: Taylor Southwick Date: Tue, 27 Jul 2021 16:08:05 -0700 Subject: [PATCH 1/4] Allow selection of VS installation --- CHANGELOG.md | 2 + .../ExtensionManagementCommand.cs | 2 + .../Commands/Upgrade/ConsoleUpgrade.cs | 3 +- .../Commands/UpgradeAssistantCommand.cs | 3 + .../IUpgradeAssistantOptions.cs | 2 + .../UpgradeAssistantHostExtensions.cs | 1 + .../LocalizedStrings.Designer.cs | 72 ++++++++++ .../LocalizedStrings.resx | 123 ++++++++++++++++++ .../MSBuildProject.cs | 16 ++- ...oft.DotNet.UpgradeAssistant.MSBuild.csproj | 13 ++ .../VisualStudioFinder.cs | 30 +++-- .../WorkspaceOptions.cs | 2 + tests/tool/Integration.Tests/UpgradeRunner.cs | 2 + 13 files changed, 261 insertions(+), 10 deletions(-) create mode 100644 src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.Designer.cs create mode 100644 src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.resx diff --git a/CHANGELOG.md b/CHANGELOG.md index 9e81ecdcb..9ce6efdb7 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -7,7 +7,9 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). ### Changed - Updated try-convert tool version from `0.7.226301` to `0.9.232202` + ### Added +- Added command line argument to select VS version (`--vs-path`) in cases where multiple are installed - Added analyzers for identifying common namespaces, types, and members that require manual fixup and will produce diagnostics with links to relevant docs. The list of APIs identified by the analyzer can be expanded by adding to DefaultApiAlerts.json or by adding a .apitargets file to a project's additional files. [#685](https://github.com/dotnet/upgrade-assistant/pull/685) - Link to survey [#735](https://github.com/dotnet/upgrade-assistant/pull/735) diff --git a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/ExtensionManagement/ExtensionManagementCommand.cs b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/ExtensionManagement/ExtensionManagementCommand.cs index be5f0e114..69f2bcdff 100644 --- a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/ExtensionManagement/ExtensionManagementCommand.cs +++ b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/ExtensionManagement/ExtensionManagementCommand.cs @@ -242,6 +242,8 @@ private class ExtensionOptions : IUpgradeAssistantOptions public IReadOnlyCollection Extension => Array.Empty(); public IEnumerable AdditionalOptions => Enumerable.Empty(); + + public DirectoryInfo? VsPath { get; set; } } } } diff --git a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/Upgrade/ConsoleUpgrade.cs b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/Upgrade/ConsoleUpgrade.cs index 851c370eb..e5ef6066a 100644 --- a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/Upgrade/ConsoleUpgrade.cs +++ b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/Upgrade/ConsoleUpgrade.cs @@ -105,8 +105,9 @@ private async Task RunStepAsync(IUpgradeContext context, UpgradeStep step, Cance else { _logger.LogWarning("Upgrade process was canceled. Quitting...."); - return; } + + token.ThrowIfCancellationRequested(); } private async ValueTask ExecuteAndTimeCommand(IUpgradeContext context, UpgradeStep step, UpgradeCommand command, CancellationToken token) diff --git a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/UpgradeAssistantCommand.cs b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/UpgradeAssistantCommand.cs index c7cdf1d57..1334ba440 100644 --- a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/UpgradeAssistantCommand.cs +++ b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/UpgradeAssistantCommand.cs @@ -21,6 +21,7 @@ public UpgradeAssistantCommand(string name) AddOption(new Option>(new[] { "--entry-point", "-e" }, "Provides the entry-point project to start the upgrade process. This may include globbing patterns such as '*' for match.")); AddOption(new Option(new[] { "--target-tfm-support" }, "Select if you would like the Long Term Support (LTS), Current, or Preview TFM. See https://dotnet.microsoft.com/platform/support/policy/dotnet-core for details for what these mean.")); AddOption(new Option(new[] { "--ignore-unsupported-features" }, "Acknowledges that upgrade-assistant will not be able to completely upgrade a project. This indicates that the solution must be redesigned (e.g. consider Blazor to replace Web Forms).")); + AddOption(new Option(new[] { "--vs-path" }, "Path to a VS install directory to be used for %VSINSTALLDIR%. If not provided, the latest installed version will be used.")); } protected class CommandOptions : IUpgradeAssistantOptions @@ -44,6 +45,8 @@ protected class CommandOptions : IUpgradeAssistantOptions public UpgradeTarget TargetTfmSupport { get; set; } = UpgradeTarget.Current; public IEnumerable AdditionalOptions => Option.ParseOptions(); + + public DirectoryInfo? VsPath { get; set; } } } } diff --git a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/IUpgradeAssistantOptions.cs b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/IUpgradeAssistantOptions.cs index 2740aeb59..035b7cf8c 100644 --- a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/IUpgradeAssistantOptions.cs +++ b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/IUpgradeAssistantOptions.cs @@ -20,5 +20,7 @@ public interface IUpgradeAssistantOptions IReadOnlyCollection Extension { get; } IEnumerable AdditionalOptions { get; } + + DirectoryInfo? VsPath { get; set; } } } diff --git a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/UpgradeAssistantHostExtensions.cs b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/UpgradeAssistantHostExtensions.cs index 226cde551..b19aebb2e 100644 --- a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/UpgradeAssistantHostExtensions.cs +++ b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/UpgradeAssistantHostExtensions.cs @@ -85,6 +85,7 @@ public static IHostBuilder UseUpgradeAssistant(this IHostBuilder host, IUp services.AddMsBuild(optionss => { optionss.InputPath = upgradeOptions.Project.FullName; + optionss.VsPath = upgradeOptions.VsPath?.FullName; }); services.AddNuGet(optionss => diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.Designer.cs b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.Designer.cs new file mode 100644 index 000000000..3ce933dc9 --- /dev/null +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.Designer.cs @@ -0,0 +1,72 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// Runtime Version:4.0.30319.42000 +// +// Changes to this file may cause incorrect behavior and will be lost if +// the code is regenerated. +// +//------------------------------------------------------------------------------ + +namespace Microsoft.DotNet.UpgradeAssistant.MSBuild { + using System; + + + /// + /// A strongly-typed resource class, for looking up localized strings, etc. + /// + // This class was auto-generated by the StronglyTypedResourceBuilder + // class via a tool like ResGen or Visual Studio. + // To add or remove a member, edit your .ResX file then rerun ResGen + // with the /str option, or rebuild your VS project. + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("System.Resources.Tools.StronglyTypedResourceBuilder", "16.0.0.0")] + [global::System.Diagnostics.DebuggerNonUserCodeAttribute()] + [global::System.Runtime.CompilerServices.CompilerGeneratedAttribute()] + internal class LocalizedStrings { + + private static global::System.Resources.ResourceManager resourceMan; + + private static global::System.Globalization.CultureInfo resourceCulture; + + [global::System.Diagnostics.CodeAnalysis.SuppressMessageAttribute("Microsoft.Performance", "CA1811:AvoidUncalledPrivateCode")] + internal LocalizedStrings() { + } + + /// + /// Returns the cached ResourceManager instance used by this class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Resources.ResourceManager ResourceManager { + get { + if (object.ReferenceEquals(resourceMan, null)) { + global::System.Resources.ResourceManager temp = new global::System.Resources.ResourceManager("Microsoft.DotNet.UpgradeAssistant.MSBuild.LocalizedStrings", typeof(LocalizedStrings).Assembly); + resourceMan = temp; + } + return resourceMan; + } + } + + /// + /// Overrides the current thread's CurrentUICulture property for all + /// resource lookups using this strongly typed resource class. + /// + [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] + internal static global::System.Globalization.CultureInfo Culture { + get { + return resourceCulture; + } + set { + resourceCulture = value; + } + } + + /// + /// Looks up a localized string similar to Could not load project. Please ensure the selected VS instance has the correct workloads installed for your projects. If Upgrade Assistant selected the incorrect VS version, please pass the argument --vs-path with the appropriate path.. + /// + internal static string InvalidProjectError { + get { + return ResourceManager.GetString("InvalidProjectError", resourceCulture); + } + } + } +} diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.resx b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.resx new file mode 100644 index 000000000..7d1773481 --- /dev/null +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.resx @@ -0,0 +1,123 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + text/microsoft-resx + + + 2.0 + + + System.Resources.ResXResourceReader, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 + + + Could not load project. Please ensure the selected VS instance has the correct workloads installed for your projects. If Upgrade Assistant selected the incorrect VS version, please pass the argument --vs-path with the appropriate path. + + \ No newline at end of file diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/MSBuildProject.cs b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/MSBuildProject.cs index 139a3e686..9639a5bff 100644 --- a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/MSBuildProject.cs +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/MSBuildProject.cs @@ -7,6 +7,7 @@ using System.Linq; using System.Threading; using System.Threading.Tasks; +using Microsoft.Build.Exceptions; using Microsoft.CodeAnalysis; using Microsoft.Extensions.Logging; @@ -67,7 +68,20 @@ private static Language ParseLanguageByProjectFileExtension(string extension) _ => Language.Unknown }; - public MBuild.Project Project => Context.ProjectCollection.LoadProject(FileInfo.FullName); + public MBuild.Project Project + { + get + { + try + { + return Context.ProjectCollection.LoadProject(FileInfo.FullName); + } + catch (InvalidProjectFileException ex) + { + throw new UpgradeException(LocalizedStrings.InvalidProjectError, ex); + } + } + } public ProjectOutputType OutputType => ProjectRoot.Properties.FirstOrDefault(p => p.Name.Equals(MSBuildConstants.OutputTypePropertyName, StringComparison.OrdinalIgnoreCase))?.Value switch diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/Microsoft.DotNet.UpgradeAssistant.MSBuild.csproj b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/Microsoft.DotNet.UpgradeAssistant.MSBuild.csproj index 02ad7242c..2faadab70 100644 --- a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/Microsoft.DotNet.UpgradeAssistant.MSBuild.csproj +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/Microsoft.DotNet.UpgradeAssistant.MSBuild.csproj @@ -41,4 +41,17 @@ + + + True + True + LocalizedStrings.resx + + + + + ResXFileCodeGenerator + LocalizedStrings.Designer.cs + + \ No newline at end of file diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs index bc30f4e0f..cc0d2994b 100644 --- a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs @@ -5,6 +5,7 @@ using System.IO; using System.Runtime.InteropServices; using Microsoft.Extensions.Logging; +using Microsoft.Extensions.Options; using Microsoft.VisualStudio.Setup.Configuration; namespace Microsoft.DotNet.UpgradeAssistant.MSBuild @@ -21,15 +22,23 @@ internal class VisualStudioFinder : IVisualStudioFinder { private const int REGDB_E_CLASSNOTREG = unchecked((int)0x80040154); + private readonly IOptions _options; private readonly ILogger _logger; - public VisualStudioFinder(ILogger logger) + public VisualStudioFinder(IOptions options, ILogger logger) { - _logger = logger; + _options = options ?? throw new ArgumentNullException(nameof(options)); + _logger = logger ?? throw new ArgumentNullException(nameof(logger)); } public string? GetLatestVisualStudioPath() { + if (_options.Value.VsPath is string expectedPath) + { + _logger.LogInformation("Using supplied path for VS: {Path}", expectedPath); + return expectedPath; + } + var latest = GetLatestPath(); if (latest is null) @@ -43,19 +52,19 @@ public VisualStudioFinder(ILogger logger) if (Directory.Exists(installation)) { - _logger.LogDebug("Found Visual Studio {VsVersion} at {VsPath}", version, installation); + _logger.LogInformation("Using Visual Studio v{VsVersion} at {VsPath}", version, installation); return installation; } else { - _logger.LogInformation("Found Visual Studio {VsVersion}, but directory '{VsPath}' does not exist.", version, installation); + _logger.LogWarning("Found Visual Studio {VsVersion}, but directory '{VsPath}' does not exist.", version, installation); return null; } } - private static ISetupInstance2? GetLatestPath() + private ISetupInstance2? GetLatestPath() { var result = default(ISetupInstance2); var resultVersion = new Version(0, 0); @@ -100,10 +109,15 @@ public VisualStudioFinder(ILogger logger) } } - if (instanceHasMSBuild && instance is not null && version > resultVersion) + if (instanceHasMSBuild && instance is not null) { - result = instance; - resultVersion = version; + _logger.LogInformation("Found Visual Studio v{Version} [{Path}]", version, instance.GetInstallationPath()); + + if (version > resultVersion) + { + result = instance; + resultVersion = version; + } } } } diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/WorkspaceOptions.cs b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/WorkspaceOptions.cs index e1c2fe409..8a9474d82 100644 --- a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/WorkspaceOptions.cs +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/WorkspaceOptions.cs @@ -9,5 +9,7 @@ public class WorkspaceOptions { [Required] public string InputPath { get; set; } = null!; + + public string? VsPath { get; set; } } } diff --git a/tests/tool/Integration.Tests/UpgradeRunner.cs b/tests/tool/Integration.Tests/UpgradeRunner.cs index e371422eb..d99b33030 100644 --- a/tests/tool/Integration.Tests/UpgradeRunner.cs +++ b/tests/tool/Integration.Tests/UpgradeRunner.cs @@ -84,6 +84,8 @@ private record TestOptions(FileInfo Project) : IUpgradeAssistantOptions public IReadOnlyCollection Extension => Array.Empty(); public IEnumerable AdditionalOptions => Enumerable.Empty(); + + public DirectoryInfo? VsPath { get; set; } } } } From d43752374c81e530009222f2cc2a2332ae078fe9 Mon Sep 17 00:00:00 2001 From: Taylor Southwick Date: Tue, 27 Jul 2021 16:10:01 -0700 Subject: [PATCH 2/4] Update changelog --- CHANGELOG.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/CHANGELOG.md b/CHANGELOG.md index 9ce6efdb7..880cd4b00 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -9,7 +9,7 @@ The format is based on [Keep a Changelog](http://keepachangelog.com/en/1.0.0/). - Updated try-convert tool version from `0.7.226301` to `0.9.232202` ### Added -- Added command line argument to select VS version (`--vs-path`) in cases where multiple are installed +- Added command line argument to select VS version (`--vs-path`) in cases where multiple are installed [#753](https://github.com/dotnet/upgrade-assistant/pull/753) - Added analyzers for identifying common namespaces, types, and members that require manual fixup and will produce diagnostics with links to relevant docs. The list of APIs identified by the analyzer can be expanded by adding to DefaultApiAlerts.json or by adding a .apitargets file to a project's additional files. [#685](https://github.com/dotnet/upgrade-assistant/pull/685) - Link to survey [#735](https://github.com/dotnet/upgrade-assistant/pull/735) From 002efdcd827863d150cc476aaec0748851e60e53 Mon Sep 17 00:00:00 2001 From: Taylor Southwick Date: Tue, 27 Jul 2021 16:11:24 -0700 Subject: [PATCH 3/4] Make messaging consistent --- .../LocalizedStrings.Designer.cs | 2 +- .../LocalizedStrings.resx | 2 +- .../VisualStudioFinder.cs | 4 ++-- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.Designer.cs b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.Designer.cs index 3ce933dc9..50fe44e6e 100644 --- a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.Designer.cs +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.Designer.cs @@ -61,7 +61,7 @@ internal LocalizedStrings() { } /// - /// Looks up a localized string similar to Could not load project. Please ensure the selected VS instance has the correct workloads installed for your projects. If Upgrade Assistant selected the incorrect VS version, please pass the argument --vs-path with the appropriate path.. + /// Looks up a localized string similar to Could not load project. Please ensure the selected VS instance has the correct workloads installed for your projects. If Upgrade Assistant selected the incorrect VS version, please pass the argument --vs-path with the appropriate path. You can see the Visual Studio instances searched by running with the --verbose flag.. /// internal static string InvalidProjectError { get { diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.resx b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.resx index 7d1773481..8fbffce2c 100644 --- a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.resx +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/LocalizedStrings.resx @@ -118,6 +118,6 @@ System.Resources.ResXResourceWriter, System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 - Could not load project. Please ensure the selected VS instance has the correct workloads installed for your projects. If Upgrade Assistant selected the incorrect VS version, please pass the argument --vs-path with the appropriate path. + Could not load project. Please ensure the selected VS instance has the correct workloads installed for your projects. If Upgrade Assistant selected the incorrect VS version, please pass the argument --vs-path with the appropriate path. You can see the Visual Studio instances searched by running with the --verbose flag. \ No newline at end of file diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs index cc0d2994b..c69e08f02 100644 --- a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs @@ -35,7 +35,7 @@ public VisualStudioFinder(IOptions options, ILogger options, ILogger Date: Tue, 27 Jul 2021 16:20:14 -0700 Subject: [PATCH 4/4] Updates --- .../Commands/ExtensionManagement/ExtensionManagementCommand.cs | 2 +- .../Commands/UpgradeAssistantCommand.cs | 2 +- .../IUpgradeAssistantOptions.cs | 2 +- .../UpgradeAssistantHostExtensions.cs | 2 +- .../VisualStudioFinder.cs | 2 +- .../WorkspaceOptions.cs | 2 +- tests/tool/Integration.Tests/UpgradeRunner.cs | 2 +- 7 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/ExtensionManagement/ExtensionManagementCommand.cs b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/ExtensionManagement/ExtensionManagementCommand.cs index 69f2bcdff..ce1e2f052 100644 --- a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/ExtensionManagement/ExtensionManagementCommand.cs +++ b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/ExtensionManagement/ExtensionManagementCommand.cs @@ -243,7 +243,7 @@ private class ExtensionOptions : IUpgradeAssistantOptions public IEnumerable AdditionalOptions => Enumerable.Empty(); - public DirectoryInfo? VsPath { get; set; } + public DirectoryInfo? VSPath { get; set; } } } } diff --git a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/UpgradeAssistantCommand.cs b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/UpgradeAssistantCommand.cs index 1334ba440..cfaa52af8 100644 --- a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/UpgradeAssistantCommand.cs +++ b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/Commands/UpgradeAssistantCommand.cs @@ -46,7 +46,7 @@ protected class CommandOptions : IUpgradeAssistantOptions public IEnumerable AdditionalOptions => Option.ParseOptions(); - public DirectoryInfo? VsPath { get; set; } + public DirectoryInfo? VSPath { get; set; } } } } diff --git a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/IUpgradeAssistantOptions.cs b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/IUpgradeAssistantOptions.cs index 035b7cf8c..17a42c045 100644 --- a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/IUpgradeAssistantOptions.cs +++ b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/IUpgradeAssistantOptions.cs @@ -21,6 +21,6 @@ public interface IUpgradeAssistantOptions IEnumerable AdditionalOptions { get; } - DirectoryInfo? VsPath { get; set; } + DirectoryInfo? VSPath { get; set; } } } diff --git a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/UpgradeAssistantHostExtensions.cs b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/UpgradeAssistantHostExtensions.cs index b19aebb2e..5f51afa17 100644 --- a/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/UpgradeAssistantHostExtensions.cs +++ b/src/cli/Microsoft.DotNet.UpgradeAssistant.Cli/UpgradeAssistantHostExtensions.cs @@ -85,7 +85,7 @@ public static IHostBuilder UseUpgradeAssistant(this IHostBuilder host, IUp services.AddMsBuild(optionss => { optionss.InputPath = upgradeOptions.Project.FullName; - optionss.VsPath = upgradeOptions.VsPath?.FullName; + optionss.VisualStudioPath = upgradeOptions.VSPath?.FullName; }); services.AddNuGet(optionss => diff --git a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs index c69e08f02..20eb19577 100644 --- a/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs +++ b/src/components/Microsoft.DotNet.UpgradeAssistant.MSBuild/VisualStudioFinder.cs @@ -33,7 +33,7 @@ public VisualStudioFinder(IOptions options, ILogger AdditionalOptions => Enumerable.Empty(); - public DirectoryInfo? VsPath { get; set; } + public DirectoryInfo? VSPath { get; set; } } } }