Saturday, October 6, 2012

Beware of Rebuild operations in Visual Studio with SitefinityWebApp

I was recently modifying a Sitefinity Web Application project, and as I so often do, I performed a "Rebuild" operation in Visual Studio.

Of course, as soon as I did this, I began getting assembly loading errors.  I could not figure out the root cause of the problem since my Sitefinity Web Application projects seemed to be running just fine!

Well, after some further research, I discovered that many of the assemblies/DLLs in the bin directory of the Sitefinity Web Application project are not referenced!

Therefore, performing a "Rebuild" effectively cleans out the bin directory of any unreferenced assemblies.  By natural consequence then, I would received assembly loading and assembly reference errors for any assemblies that no longer exist in the bin directory.

The solution??--just perform a "Build" and avoid the more common and conventional "Rebuild" operation in Visual Studio.  You could, of course, create Visual Studio references for all of the necessary assemblies and make "Copy Local" is true, but that might be more trouble than it is worth.


No comments:

Post a Comment