Current filter:
                                You should refresh the page.
                                  • Since installing 18.2.4 the Use Expression Bodies code cleanup has been formating passthrough properties to be read only properties.

                                    For a property that allows toggling of sorting of a view I have the following property:

                                            public bool AllowSorting
                                            {
                                                get => m_View.OptionsCustomization.AllowSort;
                                                set => m_View.OptionsCustomization.AllowSort = value;
                                            }

                                    When cleanup is run, it is getting changed to:

                                            public bool AllowSorting => m_View.OptionsCustomization.AllowSort;

                                    this makes the property read only and creates compiler errors:

                                    The only solution I have found is tio disable the cleanup.

                                • Alex Z (DevExpress) 12.12.2018

                                  Ben,

                                  I have reproduced this issue. Please give us some time to correct it.

                                  It occurs if you have the "Use expression bodies" cleanup rule enabled.
                                  So, as a workaround, disable this rule.
                                  This way you can keep the code cleanup feature enabled.

                                  Follow these steps to get to the Code Cleanup options page:

                                  1. From the Visual Studio menu, select "CodeRush\Options..." .
                                  2. In the tree view on the left, navigate to this folder:
                                              Editor\C#
                                  3. Select the "Code Cleanup" options page.
                                  4. Find the "Use expression bodies" rule and disable it.

                                1 Solution

                                Creation Date Importance Sort by

                                Fixed: