The short blog shows you the workaround to the error “The refactoring operation cannot be completed because it requires changes to generate code”.
In one scenario, you will get this error is that you want to rename the namespace of VSTO (Visual Studio Tools for Office) project.
The error dialog looks like the one below.
The workaround I did was following.
– Go to Edit in Visual Studio
– Choose Find and Replace.
– Choose Replace in File.
– Rename all the occurrences of the namespace in the entire folder.