C# – How to remove a Fakes assembly from a Visual Studio 2012 project

cmicrosoft-fakesunit testingvisual studio 2012

I've added a Fakes assembly to a Visual Studio 2012 C# unit test project, via the "Add Fakes Assembly" reference context menu option. What's the procedure to completely remove the Fakes assembly, i.e. to undo my adding it to the project?

Best Answer

As of Visual Studio 2012 RTM, to completely remove a Fakes assembly from a unit test project, you need to:

  • Remove the .Fakes file from the Fakes folder in your project
  • Remove the .* files from the (hidden) FakesAssemblies folder in your project
  • Remove .Fakes assembly reference from the project