dotnet / dotnet/format

Unhandled exception: System.Exception: Restore operation failed.

Open
#1,899 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
No language data
Stars
1.9k
Forks
173
Avg merge
10d 13h
Merged PRs (30d)
1

Description

The below exception occurred in our ci when running dotnet format:

`dotnet format --verify-no-changes`

> Unhandled exception: System.Exception: Restore operation failed.
> at Microsoft.CodeAnalysis.Tools.CodeFormatter.OpenMSBuildWorkspaceAsync(String solutionOrProjectPath, WorkspaceType workspaceType, Boolean noRestore, Boolean requiresSemantics, String binaryLogPath, Boolean logWorkspaceWarnings, ILogger logger, CancellationToken cancellationToken)
> at Microsoft.CodeAnalysis.Tools.CodeFormatter.FormatWorkspaceAsync(FormatOptions formatOptions, ILogger logger, CancellationToken cancellationToken, String binaryLogPath)
> at Microsoft.CodeAnalysis.Tools.FormatCommandCommon.FormatAsync(FormatOptions formatOptions, ILogger`1 logger, CancellationToken cancellationToken)
> at Microsoft.CodeAnalysis.Tools.Commands.RootFormatCommand.FormatCommandDefaultHandler.InvokeAsync(InvocationContext context)
> at System.CommandLine.Invocation.InvocationPipeline.<>c__DisplayClass4_0.<b__0>d.MoveNext()
> --- End of stack trace from previous location ---
> at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<b__0>d.MoveNext()
> --- End of stack trace from previous location ---
> at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<b__0>d.MoveNext()
> --- End of stack trace from previous location ---
> at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass21_0.<b__0>d.MoveNext()
> --- End of stack trace from previous location ---
> at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<b__0>d.MoveNext()
> --- End of stack trace from previous location ---
> at System.CommandLine.CommandLineBuilderExtensions.<>c.<b__17_0>d.MoveNext()
> --- End of stack trace from previous location ---
> at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<b__0>d.MoveNext()
> --- End of stack trace from previous location ---
> at System.CommandLine.CommandLineBuilderExtensions.<>c.<b__4_0>d.MoveNext()
> --- End of stack trace from previous location ---
> at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass7_0.<b__0>d.MoveNext()

This exception doesn't really tell us anything. It uses System.Exception rather than a more specific type. And the message "Restore operation failed" doesn't tell us why it failed/what specifically went wrong when doing the restore operation.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.