ClickOnce and the Global Assembly Cache...

Posted on 2006-03-21
Last Modified: 2008-01-09
I am starting to use ClickOnce,  but I am running into a problem.  I get an error on the prerequitites stating that Microsoft.SqlServer.ConnectionInfo is not in the Global Assembly Cache (GAC) and that it needs to be there before the application can be deployed.  There seems to be no redistributable for the SMO assemblies.  Regardless, how can I install assemblies to the GAC using ClickOnce.  Rightnow, the SMO assemblies are listed by default as Prerequisite (Auto) in the Application Files section of the Publish tab in the Settings dialog.  Should this be set to include?  Though I assume that if it is set to include the assemblies will be added to the application's installation directory rather than to the GAC and that not the ideal here.
Question by:thrillingryan
    LVL 16

    Expert Comment

    Change them from Prerequisite to Include.
    This won't install them in the GAC, but will copy them to the application directory, which will work.
    LVL 16

    Expert Comment

    If you want to add them to the GAC, have your application do this on startup.

    Author Comment

    I'm wondering if there is a best practice for this.  Seems like it would be a pretty common problem. RobertRFreeman, have you written any code you can share to add such assemblies to the GAC?  What about the uninstallation procedure?  Is that a worthy consideration?  Once I install the assemblies via my application, if the user uninstalls my application it will leave the assemblies in the GAC, right?

    LVL 16

    Accepted Solution

    Yes it would, unless you took extra steps to change the ClickOnce Uninstall Package.

    The best practices answer is that if you need to add things to the GAC, either add a custom install package as a prerequisite, use a separate Install Project, or use MSI/InstallShield.

    Featured Post

    Highfive Gives IT Their Time Back

    Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

    Join & Write a Comment

    It seems a simple enough task, yet I see repeated questions asking how to do it: how to pass data between two forms. In this article, I will show you the different mechanisms available for you to do just that. This article is directed towards the .N…
    More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
    how to add IIS SMTP to handle application/Scanner relays into office 365.
    Polish reports in Access so they look terrific. Take yourself to another level. Equations, Back Color, Alternate Back Color. Write easy VBA Code. Tighten space to use less pages. Launch report from a menu, considering criteria only when it is filled…

    745 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    16 Experts available now in Live!

    Get 1:1 Help Now