marți, 13 decembrie 2011

The refactoring could not be performed due to build errors

There is a quirk in Visual Studio 2005 which prevents refactoring when a warning CS1699 is issued. More specifically, ine of the projects in my solution was issuing warning CS1699 :
Use command line option '/keyfile' or appropriate project settings instead of 'AssemblyKeyFile'
and it was not until I solved this error by commenting the AssemblyKeyFile line in the AssemblyInfo.cs file that the refactoring ( encapsulating a field ) started to work once again. You can see more details about this warning here:
The error is confusing since it says that one of the projects in the solution does not currently build, which is false since this is solely a warning.