I was recently working with a Visual Studio project utilizing the CrystalDecisions components as references. I ran into a curious situation where when I added a reference to the 10.5 version of the dll it added fine but when I tried to add the 11.5 version of the same dll, I received a Visual Studio error like this:
The primary reference “CrystalDecisions.CrystalReports.Engine, Version=10.5.3700.0, Culture=neutral, PublicKeyToken=692fbea5521e1304, processorArchitecture=MSIL” could not be resolved because it has a higher version “11.5.3300.0” than exists in the current target framework. The version found in the current target framework is “10.5.3700.0”.
I was able to switch my project to use the .Net 4.0 framework but then when building my solution they were no longer compatible to be used in the SalesLogix web client (.Net 3.5 only).
Now I initially thought that the 11.5 dlls were .NET 4.0 based but then realized the SalesLogix reporting components were using the same dlls and without problems in a .Net 3.5 environment.
After doing a little digging I found the problem to be with my computer’s GAC. Here are the steps I had to take to get it all working:
- In my C:WindowsMicrosoft.NETFrameworkv2.0.50727 folder there is a Redist folder. Inside this folder is a file called something like CrystalReportsList.xml, or CrystalReportsList2008.xml. Copy this file.
- Go to the C:WindowsMicrosoft.NETFrameworkv3.5 folder. If there is not a sub-folder called RedistList here, create one.
- Paste a copy of the xml file in this RedistList folder.
- Now edit the XML file. Replace the version numbers in there with the 11.5 version numbers of the 11.5 components in your local global assembly cache. In my case the version I replaced showed 10.5.3700 and I replaced it with my 11.5 version (inclusive of SP4) of 11.5.3300.
- Save your changes. Now when you go to add a reference to the 11.5 level dlls from your GAC you will not get the error!