I think I just wasted somewhere around 10 hours over the last several days trying to track down an issue I've been having. It started out as what should have been a painless project upgrade from VS 2003 to 2005. This particular project happens to use Crystal Reports XI.
"Well, that's your first problem!"
Yes, I know. Crystal. A fool to be pitied, am I. Alas, it's a customer requirement... on with the story.
Everything compiles and runs great. However, now none of the reports are working. I'm getting all kinds of weird exceptions. I fight with references and what-not for a couple of hours. Turns out, for .NET 2.0 you need to download
Crystal Reports XI Release 2. No problem. It's only a 1GB download. That should only take, what, three days?
Fast forward download and 2 hour upgrade install. Everything compiles and runs great. However, now none of the reports
that have parameters are working. I'm getting a weird exception whining that ParameterDiscreteValue can't be cast to ParameterValue, even though ParameterDiscreteValue inherits from ParameterValue. Only makes sense, right?
I run through and fix all my references again, and then start narrowing down and eliminating all the possible culprits. I double-check my code against all samples and Google results I can find. No dice. So, I give up and open a support case with Crystal. Insert typical support response: "Have you tried running the samples?"
At this point I'm so desparate that I actually
do run a sample project that sets parameters dynamically. It works. So, I set out to plug one of my own reports into the sample project. It works. WHAT?!
After stepping through every line of code for the millionth time (give or take 3 builds), I finally go back and check my references again. Hmm... that's odd. All my Crystal references are OK except the Crystal Engine is pointing to the 10.0 version that ships with VS 2005. Update the reference and recompile. Run a report. Exception. Check my references again. Hmm... that's odd. The old reference is back again.
OK... the fix?? After setting the reference, I have to set the "Specific Version" property to "True." If I don't, VS 2005 is kind enough to automagically change my reference back to the previous version.
This is actually not the first time this issue has happened to me. At this point I'm
so frustrated I could spit.
Hey, wait. These spots on my laptop might be dried
spittle. I'm not sure.