Thursday, May 13, 2010

Visual Studio 2010, Crystal Reports, GAC... ARGHH!

I wrestled with this issue along with my workmate for quite a few hours, so hopefully this helps someone out there.

With the recent release of Visual Studio 2010, we took the opportunity to install it at work and migrate our solution across from Visual Studio 2008. We decided to leave Visual Studio 2008 installed as you can have side by side installations of 2008 and 2010. After installation was complete, we managed to get our solution and its projects converted successfully. We thought everything was going well, and it was up till this point...

We then went to build the solution and this was when Visual Studio 2010 started complaining that it could not find the Crystal Report assemblies that our projects reference. There was that big fat ugly exclamation mark in a yellow triangle icon next to each of the Crystal assemblies in the reference list. Visual Studio could not find any of the Crystal Report XI Release 2 assemblies in the GAC, even though they were there.

Perplexed, we searched the internet for a solution but could not find anything documenting our problem. Eventually, we realised that there was an entry in Add/Remove Programs called "Crystal Reports Basic for Visual Studio 2008". This must have been installed with Visual Studio 2008. Upon uninstalling this and reopening our solution in Visual Studio 2010, the Crystal assemblies were all detected in the GAC by the projects.