Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How do I remove a Fakes assembly from a Visual Studio 2012 project?

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?

like image 394
aknuds1 Avatar asked Sep 03 '12 07:09

aknuds1


2 Answers

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
like image 129
Oleg Sych Avatar answered Oct 07 '22 03:10

Oleg Sych


Just remove the references to the fake project assembly, after that it will underline the using statements that used the removed references with red, so that will help you completely remove any leftover reference. This of course is a manual approach, if you require a different approach use a 3rd party tool like resharper for example.

like image 37
Freeman Avatar answered Oct 07 '22 03:10

Freeman