Link to home
Create AccountLog in
Avatar of thrillingryan
thrillingryan

asked on

ClickOnce and the Global Assembly Cache...

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.
Avatar of RobertRFreeman
RobertRFreeman
Flag of United States of America image

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.
If you want to add them to the GAC, have your application do this on startup.
Avatar of thrillingryan
thrillingryan

ASKER

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?

  -Ryan
ASKER CERTIFIED SOLUTION
Avatar of RobertRFreeman
RobertRFreeman
Flag of United States of America image

Link to home
membership
Create a free account to see this answer
Signing up is free and takes 30 seconds. No credit card required.
See answer