Tuesday, June 28, 2016

Visual Studio "Clean" operation does not clean up renamed assemblies

I recently ran into a problem whereby I was re-organizing, renaming and re-structuring my projects in my solution and I started receiving runtime errors in my application even though my solution compiled just fine!

Looking at the error message, it appeared that the names of the assemblies were outdated and were still somehow being referenced in my project!

Naturally, I checked all of my project references and everything was in order.  I also ran a "Clean" operation in Visual Studio to clean out all of my old assemblies from their respective bin directories.

However, I continued to receive these runtime error messages!

Since this issue still persisted, I decided to do a bit more investigation directly into the bin directories of all of my projects.

Sure enough, my old assemblies before the rename process still existed in their respective bin directories!

After having to manually go through each and every one of my bin directories in my project and manually deleting them (I may write a PowerShell script in the future to accomplish this), I recompiled my solution and everything ran perfectly!

Therefore, a word to the wise, don't completely rely on the "Clean" operation in Visual Studio to do all the cleanup tasks for you!!

No comments:

Post a Comment