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

CodeAnalysis.ChangeNamespace ArgumentException #58372

Closed
tamlin-mike opened this issue Dec 16, 2021 · 0 comments · Fixed by #58704
Closed

CodeAnalysis.ChangeNamespace ArgumentException #58372

tamlin-mike opened this issue Dec 16, 2021 · 0 comments · Fixed by #58704
Assignees
Labels
4 - In Review A fix for the issue is submitted for review. Area-IDE Bug
Milestone

Comments

@tamlin-mike
Copy link

Version Used: VS 16.11.5

On a class not within a namespace, in a project with a dash ('-') in its name, invoking Alt+Returns and by keyboard scrolling past the "Move to namespace" suggestion
displaying the (indeed C#-illegal) project name (or if it's directory name - both were the same) resulted in the following.

System.ArgumentException : targetNamespace
   at async Microsoft.CodeAnalysis.ChangeNamespace.AbstractChangeNamespaceService`3.ChangeNamespaceAsync[TNamespaceDeclarationSyntax,TCompilationUnitSyntax,TMemberDeclarationSyntax](<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.ComputeOperationsAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.CodeActions.CodeAction.GetPreviewOperationsAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedAction.GetPreviewResultAsync(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Editor.Implementation.Suggestions.SuggestedActionWithNestedFlavors.<>c__DisplayClass11_0.<GetPreviewAsync>b__0(<Unknown Parameters>)
   at async Microsoft.CodeAnalysis.Extensions.IExtensionManagerExtensions.PerformFunctionAsync[T](<Unknown Parameters>)
   at Microsoft.VisualStudio.Telemetry.WindowsErrorReporting.WatsonReport.GetClrWatsonExceptionInfo(Exception exceptionObject)
@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Dec 16, 2021
@jinujoseph jinujoseph added Bug help wanted The issue is "up for grabs" - add a comment if you are interested in working on it and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jan 5, 2022
@jinujoseph jinujoseph added this to the Backlog milestone Jan 5, 2022
@jinujoseph jinujoseph added 4 - In Review A fix for the issue is submitted for review. and removed help wanted The issue is "up for grabs" - add a comment if you are interested in working on it labels Jan 7, 2022
@jinujoseph jinujoseph modified the milestones: Backlog, 17.2.P1 Jan 7, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
4 - In Review A fix for the issue is submitted for review. Area-IDE Bug
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants