9

I have a .NET project that uses Crystal Reports. The application is distributed using ClickOnce. Things work great if the user has Crystal installed on their computer. However, not all of the end users have Crystal Reports installed on their computers. These users are receiving the following error...

"Unable to install or run the application. The application requires that assembly CrystalDecisions.ReportAppServer.XmlSerialize Version 10.5.3700.0 be installed in the Global Assembly Cache (GAC) first."

Is there a way to force ClickOnce installs to ensure that a prerequisite is installed?

1
  • Have you included Crystal Reports as part of the prerequisites in your ClickOnce publish settings? Jun 9, 2009 at 19:42

2 Answers 2

11

No. There is a lot of confusion over ClickOnce and prerequisites.

ClickOnce does nothing with prereqs. Nothing. ClickOnce copies files from a server to a client's machine and keeps those files in sync when the server files are updated - that's it. It can't put things in the GAC, register dlls, install msi files, etc.

Where the confusion comes in is when you deploy with Visual Studio. VS does several things for you when you publish that really have nothing to do with ClickOnce. For one, it creates a nice html page for you with some links to your deployment. Also, it lets you pick from several prereqs and will create a bootstrapper exe for you. I'm assuming you did this for the Crystal Reports install. The bootstrapper is just a simple way to manage multiple prereqs. Rather than telling your user to install X, then Y, then Z before installing your app, the bootstrapper makes those three installs "seamless" so they appear as if they are one big install. It can also skip prereq installs if the user already has it.

If you pay attention on your html page that VS generates, you can see two links. One to your .application file (the ClickOnce deployment) and one to the bootstrapper exe. You are pretty much at the mercy of the user and must rely on them to read the page and run the bootstrapper if they need to. The one exception to that is the .Net Framework since the html page can check for that through the UserAgent string.

If they don't run the bootstrapper they'll get errors much like the one you're asking about.

One possible solution is to write code to check if it's installed. It could check the registry or the "Program Files" folder; whatever you need to do to make sure it's installed. Then exit gracefully and inform the user if they don't have it. That will work as long as you do the check before you try to load and use the Crystal assemblies.

Good luck! Please respond if you come up with a better solution.

2
  • 1
    Whatknott, I read a few of your other posts and feel I have better understanding. Thanks for confirming and explaining this topic. Jun 10, 2009 at 1:21
  • Your welcome. I remember going through all the same questions and frustrations with ClickOnce. I hope I saved you a little pain :) Jun 10, 2009 at 1:29
-1

In the Prerequistes , Select Crystsal Report for .Net Framework (NOT Crystal Report for Visual Studio ) and publish .

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.