You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Getting the below exception when running "dotnet format" with the following installed :
dotnet SDK 7.0.306 (windows x64)
C# v2.0.320
EditorConfig for VS Code v0.16.4
Going back to dotnet SDK 7.0.203 (windows x64), stops this from happenening (sorry, didn't try the intermediate versions).
Unhandled exception: System.NotSupportedException: Specified method is not supported.
at Microsoft.CodeAnalysis.CSharp.CodeStyle.CSharpCodeStyleOptions.ParseNamespaceDeclaration(String optionString, CodeStyleOption2`1 default)
at Microsoft.CodeAnalysis.CSharp.CodeStyle.CSharpCodeStyleOptions.<>c__DisplayClass75_2.<.cctor>b__7(String str)
at Microsoft.CodeAnalysis.Options.EditorConfigValueSerializer`1.TryParseValue(String value, T& result)
at Microsoft.CodeAnalysis.Options.EditorConfigValueSerializer`1.Microsoft.CodeAnalysis.Options.IEditorConfigValueSerializer.TryParse(String value, Object& result)
at Microsoft.CodeAnalysis.Options.DocumentOptionSet.TryGetAnalyzerConfigOption(OptionKey optionKey, Object& value)
at Microsoft.CodeAnalysis.Options.DocumentOptionSet.GetInternalOptionValue(OptionKey optionKey)
at Microsoft.CodeAnalysis.Options.OptionSet.Microsoft.CodeAnalysis.Options.IOptionsReader.TryGetOption[T](OptionKey2 optionKey, T& value)
at Microsoft.CodeAnalysis.Options.Extensions.GetOption[T](IOptionsReader options, Option2`1 option, T defaultValue)
at Microsoft.CodeAnalysis.CSharp.Formatting.CSharpSyntaxFormattingOptions..ctor(IOptionsReader options, CSharpSyntaxFormattingOptions
fallbackOptions)
at Microsoft.CodeAnalysis.CSharp.Formatting.CSharpSyntaxFormatting.GetFormattingOptions(IOptionsReader options, SyntaxFormattingOptions fallbackOptions)
at Microsoft.CodeAnalysis.Formatting.Formatter.GetFormattingOptionsAsync(Document document, OptionSet optionSet, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Formatting.Formatter.FormatAsync(Document document, IEnumerable`1 spans, OptionSet options, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.Formatters.WhitespaceFormatter.GetFormattedDocument(Document document, OptionSet optionSet, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.Formatters.WhitespaceFormatter.FormatFileAsync(Document document, SourceText sourceText, OptionSet optionSet, AnalyzerConfigOptions analyzerConfigOptions, FormatOptions formatOptions, ILogger logger, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.Formatters.DocumentFormatter.GetFormattedSourceTextAsync(Document document, OptionSet optionSet, AnalyzerConfigOptions analyzerConfigOptions, FormatOptions formatOptions, ILogger logger, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.Formatters.DocumentFormatter.<>c__DisplayClass8_1.<<FormatFiles>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Microsoft.CodeAnalysis.Tools.Formatters.DocumentFormatter.ApplyFileChangesAsync(Solution solution, ImmutableArray`1 formattedDocuments, FormatOptions formatOptions, ILogger logger, List`1 formattedFiles, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.Formatters.DocumentFormatter.FormatAsync(Solution solution, ImmutableArray`1 formattableDocuments, FormatOptions formatOptions, ILogger logger, List`1 formattedFiles, CancellationToken cancellationToken)
at Microsoft.CodeAnalysis.Tools.CodeFormatter.RunCodeFormattersAsync(Solution solution, ImmutableArray`1 formattableDocuments, FormatOptions formatOptions, ILogger logger, List`1 formattedFiles, 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.<<BuildInvocationChain>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass16_0.<<UseParseErrorReporting>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass11_0.<<UseHelp>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass21_0.<<UseVersionOption>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass18_0.<<UseTypoCorrections>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.CommandLineBuilderExtensions.<>c.<<UseSuggestDirective>b__17_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass15_0.<<UseParseDirective>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.CommandLineBuilderExtensions.<>c.<<RegisterWithDotnetSuggest>b__4_0>d.MoveNext()
--- End of stack trace from previous location ---
at System.CommandLine.CommandLineBuilderExtensions.<>c__DisplayClass7_0.<<UseExceptionHandler>b__0>d.MoveNext()
After several failed attempts to have GitHub transfer this issue, I am just going to leave this one open. See dotnet/format#1926 for more context.
JoeRobich
changed the title
Crashing under dotnet SDK 7.0.306 in vscode
The value unset is not supported by the csharp_style_namespace_declarations option
Aug 4, 2023
Originally reported at dotnet/format#1926.
Getting the below exception when running "dotnet format" with the following installed :
Going back to dotnet SDK 7.0.203 (windows x64), stops this from happenening (sorry, didn't try the intermediate versions).
.editorconfig contains the following
The text was updated successfully, but these errors were encountered: