In VS 2010, Silverlight, C#. I have multiple .cs files. In some of them the 'Refactor' and 'Organize Usings' (among other items) in the right-click context menu are missing.
Why are they missing? How can they be brought back?
I had the same problem after installing ReSharper. "Organize Usings > Remove and Sort" and some other shortcuts were missing in the context menu.
You can still invoke the commands (when availiable) via
Edit > Intellisense > Organize Usings > Remove and Sort
To show them in the context menu again (in case of ReSharper causing the trouble) goto
ReSharper > Options... > Environment > Keyboard & Menus > Menus & Toolbars >
Uncheck 'Hide overridden Visual Studio Menu items'
Another possibility is that the files without the Refactor option are not in your solution. I have seen this when I was unintentionally looking at files in a different repository branch.
I had this same issue today and the problem was caused by a merge error where additional data had been added to the .csproj file unintentionally.
<Compile Include="DataQueries\Custom\General\CustomImageQueries.cs" />
<Compile Include="DataQueries\Custom\General\CountryQueries.cs" />
<Compile Include="DataQueries\Custom\General\CurrencyQueries.cs" />
<Compile Include="DataQueries\Custom\General\CustomApplicationQueries.cs" />
<Compile Include="DataQueries\Custom\General\CustomFileQueries.cs" />
<Compile Include="DataQueries\Custom\General\CustomImageQueries.cs" />
The CustomImageQueries.cs entry had been added twice to the .csproj file and once the duplicate entry was removed, the IDE worked as expected.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With