Roslyn: Generate Equals and GetHashCode doesn't work for partial classes

Created on 19 Mar 2020  Â·  5Comments  Â·  Source: dotnet/roslyn

_This issue has been moved from a ticket on Developer Community._


I use a lot of partial classes to organize my code.

I often use the ‘Generate Equals and GetHashCode’ feature, both very often it doesn’t work.
So I have to go through all my class files trying to find the one that will actually execute.

Usually the first or last one is the one that actually works.


Original Comments

Fiona Niu[MSFT] on 3/17/2020, 06:55 PM:

(private comment, text removed)

Visual Studio Feedback System on 3/17/2020, 07:14 PM:

We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.


Original Solutions

(no solutions)

4 - In Review Area-IDE Bug

Most helpful comment

Got it. What a nasty one :)

All 5 comments

Left this on the Developer-Community site:


Hi Daan,

I was unable to repro this issue. Could you supply a larger repro over at

https://github.com/dotnet/roslyn/issues/42574 that explains what you mean? Ideally it would contain an example of the code you're starting with and how you're trying to invoke the "generate equals and gethashcode" feature.

Hi Cyrus

I made a video showing the problem, as well as including the test project itself

https://www.youtube.com/watch?v=ZqSZ6dEwX9Q&feature=youtu.be

PartialAlwaysGoingWrong.zip

Awesome. Thanks!

Good news. It repros for me. Now to find out why :)

Got it. What a nasty one :)

Was this page helpful?
0 / 5 - 0 ratings