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

UseExpressionBodyCodeFixProvider encountered error and has been disabled - VS 2022 17.3.0 Preview 3.0 #62739

Closed
vsfeedback opened this issue Jul 18, 2022 · 2 comments · Fixed by #62740
Assignees
Labels
4 - In Review A fix for the issue is submitted for review. Area-IDE Bug Tenet-Localization Some piece of UI isn’t localized, often due to hard-coding of strings or other visible elements.
Milestone

Comments

@vsfeedback
Copy link

vsfeedback commented Jul 18, 2022

This issue has been moved from a ticket on Developer Community.


[severity:It bothers me. A fix would be nice] [regression] [worked-in:17.3.0 Preview 2.0]
Stack trace below:

System.TypeInitializationException : Inicjator typów zgłosił wyjątek dla typu 'Microsoft.CodeAnalysis.CSharp.UseExpressionBody.UseExpressionBodyCodeRefactoringProvider'. ---> System.ArgumentException : An element with the same key but a different value already exists. Key: 'Użyj treści bloku dla operatorów'
   at System.Collections.Immutable.ImmutableDictionary`2.HashBucket.Add(TKey key,TValue value,IEqualityComparer`1 keyOnlyComparer,IEqualityComparer`1 valueComparer,KeyCollisionBehavior behavior,OperationResult& result)
   at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 items,MutationInput origin,KeyCollisionBehavior collisionBehavior)
   at System.Collections.Immutable.ImmutableDictionary`2.AddRange(IEnumerable`1 pairs,Boolean avoidToHashMap)
   at Roslyn.Utilities.BidirectionalMap`2..ctor(IEnumerable`1 pairs)
   at Microsoft.CodeAnalysis.CSharp.UseExpressionBody.UseExpressionBodyCodeRefactoringProvider..cctor()
   --- Koniec śladu stosu wyjątków wewnętrznych ---
   at async Microsoft.CodeAnalysis.CSharp.UseExpressionBody.UseExpressionBodyCodeRefactoringProvider.ComputeRefactoringsAsync()
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at async Microsoft.CodeAnalysis.CodeRefactorings.CodeRefactoringService.GetRefactoringFromProviderAsync()

Original Comments

Feedback Bot on 7/15/2022, 03:09 AM:

(private comment, text removed)


Original Solutions

(no solutions)

@dotnet-issue-labeler dotnet-issue-labeler bot added Area-IDE untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 18, 2022
@sharwell
Copy link
Member

This is occurring because one of the languages uses the same translation for two different strings:

<trans-unit id="Use_block_body_for_conversion_operators">
<source>Use block body for conversion operators</source>
<target state="translated">Użyj treści bloku dla operatorów</target>
<note />
</trans-unit>

<trans-unit id="Use_block_body_for_operators">
<source>Use block body for operators</source>
<target state="translated">Użyj treści bloku dla operatorów</target>
<note />
</trans-unit>

@CyrusNajmabadi
Copy link
Member

i can fix this.

@CyrusNajmabadi CyrusNajmabadi self-assigned this Jul 18, 2022
@sharwell sharwell added Bug 4 - In Review A fix for the issue is submitted for review. Tenet-Localization Some piece of UI isn’t localized, often due to hard-coding of strings or other visible elements. and removed untriaged Issues and PRs which have not yet been triaged by a lead labels Jul 18, 2022
@sharwell sharwell added this to the 17.4 milestone Jul 18, 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 Tenet-Localization Some piece of UI isn’t localized, often due to hard-coding of strings or other visible elements.
Projects
None yet
Development

Successfully merging a pull request may close this issue.

3 participants