[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1289
  • Last Modified:

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.
0
thrillingryan
Asked:
thrillingryan
  • 3
1 Solution
 
RobertRFreemanCommented:
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.
0
 
RobertRFreemanCommented:
If you want to add them to the GAC, have your application do this on startup.
0
 
thrillingryanAuthor Commented:
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
0
 
RobertRFreemanCommented:
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.
0

Featured Post

Configuration Guide and Best Practices

Read the guide to learn how to orchestrate Data ONTAP, create application-consistent backups and enable fast recovery from NetApp storage snapshots. Version 9.5 also contains performance and scalability enhancements to meet the needs of the largest enterprise environments.

  • 3
Tackle projects and never again get stuck behind a technical roadblock.
Join Now