Skip to content
New issue

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

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

Already on GitHub? Sign in to your account

Upgrade assistant exits success on failure #1624

Open
1 task
jaraco opened this issue Jan 13, 2025 · 0 comments
Open
1 task

Upgrade assistant exits success on failure #1624

jaraco opened this issue Jan 13, 2025 · 0 comments

Comments

@jaraco
Copy link

jaraco commented Jan 13, 2025

  • Include the log file upgrade-assistant.clef that is produced in the working directory
    • no such file is produced

Describe the bug

Running the upgrade-assistant exits with success on failure. I've been running the upgrade assistant non-interactively as an internal, non-interactive operation of another tool. That tool is monitoring the exit code to determine success or failure of the execution, but as I've been able to reproduce outside of that tool, the upgrade-assistant (ver 0.5.829.41291) is exiting with a 0 status code even when there's an unhandled exception.

To Reproduce

I have not attempted to replicate the issue except in this particular project. Moreover, it's possible that the repro requires some pre-upgrade steps to the source that are invoked by the tool prior to executing the upgrade assistant. I can help devise a full repro if needed, but I suspect the output log will be sufficient.

Exceptions (if any)

Here's the full invocation of the upgrade-assistant:

PS C:\repos\CommonLibrary> Set-Env -Unset "DOTNET_ROOT","NUGET_PLUGIN_PATHS" -Set "DOTNET_UPGRADE_ASSISTANT_TELEMETRY_OPTOUT=1","DOTNET_UPGRADEASSISTANT_SKIP_FIRST_TIME_EXPERIENCE=1" { upgrade-assistant upgrade src/AdvisorAuthentication/Client/AdvisorAuthenticationClient.csproj --noninteractive --operation feature.sdkstyle }
Microsoft.Build.Exceptions.InvalidProjectFileException: The expression "[MSBuild]::StableStringHash(AdvisorAuthenticationClient.csproj)" cannot be evaluated. Could not load type
'Microsoft.NET.StringTools.FowlerNollVo1aHash' from assembly 'Microsoft.NET.StringTools, Version=1.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'.
C:\CoreXT.cache\.A\DotNetSDK.0tQT_ZPLkjRLffFtnbHJmA\sdk\8.0.404\Microsoft.Common.CurrentVersion.targets
   at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject(String errorSubCategoryResourceName, IElementLocation elementLocation, String resourceName, Object[] args)
   at Microsoft.Build.Shared.ProjectErrorUtilities.ThrowInvalidProject[T1,T2](IElementLocation elementLocation, String resourceName, T1 arg0, T2 arg1)
   at Microsoft.Build.Evaluation.Expander`2.Function`1.Execute(Object objectInstance, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation elementLocation)
   at Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertyBody(String propertyBody, Object propertyValue, IPropertyProvider`1 properties, ExpanderOptions options,
IElementLocation elementLocation, PropertiesUseTracker propertiesUseTracker, IFileSystem fileSystem)
   at Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertiesLeaveTypedAndEscaped(String expression, IPropertyProvider`1 properties, ExpanderOptions options,
IElementLocation elementLocation, PropertiesUseTracker propertiesUseTracker, IFileSystem fileSystem)
   at Microsoft.Build.Evaluation.Expander`2.PropertyExpander`1.ExpandPropertiesLeaveEscaped(String expression, IPropertyProvider`1 properties, ExpanderOptions options, IElementLocation
elementLocation, PropertiesUseTracker propertiesUseTracker, IFileSystem fileSystem)
   at Microsoft.Build.Evaluation.Expander`2.ExpandIntoStringLeaveEscaped(String expression, ExpanderOptions options, IElementLocation elementLocation)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluatePropertyElement(ProjectPropertyElement propertyElement)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluatePropertyGroupElement(ProjectPropertyGroupElement propertyGroupElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.EvaluateImportElement(String directoryOfImportingFile, ProjectImportElement importElement)
   at Microsoft.Build.Evaluation.Evaluator`4.PerformDepthFirstPass(ProjectRootElement currentProjectOrImport)
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate()
   at Microsoft.Build.Evaluation.Evaluator`4.Evaluate(IEvaluatorData`4 data, Project project, ProjectRootElement root, ProjectLoadSettings loadSettings, Int32 maxNodeCount,
PropertyDictionary`1 environmentProperties, ILoggingService loggingService, IItemFactory`2 itemFactory, IToolsetProvider toolsetProvider, IDirectoryCacheFactory directoryCacheFactory,
ProjectRootElementCacheBase projectRootElementCache, BuildEventContext buildEventContext, ISdkResolverService sdkResolverService, Int32 submissionId, EvaluationContext evaluationContext,
Boolean interactive)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.Reevaluate(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, ProjectLoadSettings loadSettings, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(ILoggingService loggingServiceForEvaluation, EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.ReevaluateIfNecessary(EvaluationContext evaluationContext)
   at Microsoft.Build.Evaluation.Project.ProjectImpl.Initialize(IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectLoadSettings loadSettings,
EvaluationContext evaluationContext, Boolean interactive)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection,
ProjectLoadSettings loadSettings, EvaluationContext evaluationContext, IDirectoryCacheFactory directoryCacheFactory, Boolean interactive)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, String subToolsetVersion, ProjectCollection projectCollection,
ProjectLoadSettings loadSettings)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, ProjectCollection projectCollection, ProjectLoadSettings loadSettings)
   at Microsoft.Build.Evaluation.Project..ctor(String projectFile, IDictionary`2 globalProperties, String toolsVersion, ProjectCollection projectCollection)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, IDictionary`2 globalProperties, String toolsVersion)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName, String toolsVersion)
   at Microsoft.Build.Evaluation.ProjectCollection.LoadProject(String fileName)
   at Microsoft.UpgradeAssistant.Services.DefaultMsbuildProjectAccess..ctor(String projectPath, ILogger logger, CancellationToken cancellationToken) in
D:\a\_work\1\s\src\msbuild\Services\Msbuild\DefaultMsbuildProjectAccess.cs:line 28
   at Microsoft.UpgradeAssistant.Cli.Slices.Services.Msbuild.MsbuildService.GetProjectAccessAsync(String projectPath, Boolean isReadOnly, CancellationToken cancellationToken) in
D:\a\_work\1\s\src\cli\Slices\Services\Msbuild\MsbuildService.cs:line 34
   at Microsoft.UpgradeAssistant.Cli.Slices.Services.Project.ProjectService.CreateProjectAsync(ISolution solution, String projectPath, CancellationToken cancellationToken) in
D:\a\_work\1\s\src\cli\Slices\Services\Project\ProjectService.cs:line 594
   at Microsoft.UpgradeAssistant.Cli.Slices.Services.Project.ProjectService.GetProjectAsync(ISolution solution, String projectPath, CancellationToken cancellationToken) in
D:\a\_work\1\s\src\cli\Slices\Services\Project\ProjectService.cs:line 577
   at Microsoft.UpgradeAssistant.Cli.Slices.Services.Project.ProjectService.GetProjectByPathAsync(ISolution solution, String projectPath, CancellationToken cancellationToken) in
D:\a\_work\1\s\src\cli\Slices\Services\Project\ProjectService.cs:line 255
   at Microsoft.UpgradeAssistant.Cli.Flow.Steps.Project.SourceProjectFlowStep.SelectSourceProjectAsync(IFlowContext context, String projectPath, CancellationToken cancellationToken) in
D:\a\_work\1\s\src\cli\Flow\Steps\Project\SourceProjectFlowStep.cs:line 134
   at Microsoft.UpgradeAssistant.Cli.Flow.Steps.Project.SourceProjectFlowStep.ValidateUserInputAsync(IFlowContext context, CancellationToken cancellationToken) in
D:\a\_work\1\s\src\cli\Flow\Steps\Project\SourceProjectFlowStep.cs:line 73
   at Spectre.Console.Flow.FlowRunner.RunAsync(CancellationToken cancellationToken) in D:\a\_work\1\s\src\spectre.flow\Flow\FlowRunner.cs:line 83
PS C:\repos\CommonLibrary> echo $LASTEXITCODE
0

Further technical details

  • Windows 11 24H2 64-bit
  • PS C:\> dotnet --list-sdks
    8.0.404 [C:\Program Files\dotnet\sdk]
    9.0.100 [C:\Program Files\dotnet\sdk]
    
  • PS C:\> upgrade-assistant --version
    0.5.829.41291
    
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant