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.
Who is Participating?

[Product update] Infrastructure Analysis Tool is now available with Business Accounts.Learn More

I wear a lot of hats...

"The solutions and answers provided on Experts Exchange have been extremely helpful to me over the last few years. I wear a lot of hats - Developer, Database Administrator, Help Desk, etc., so I know a lot of things but not a lot about one thing. Experts Exchange gives me answers from people who do know a lot about one thing, in a easy to use platform." -Todd S.

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.
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?

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.

Experts Exchange Solution brought to you by

Your issues matter to us.

Facing a tech roadblock? Get the help and guidance you need from experienced professionals who care. Ask your question anytime, anywhere, with no hassle.

Start your 7-day free trial
It's more than this solution.Get answers and train to solve all your tech problems - anytime, anywhere.Try it for free Edge Out The Competitionfor your dream job with proven skills and certifications.Get started today Stand Outas the employee with proven skills.Start learning today for free Move Your Career Forwardwith certification training in the latest technologies.Start your trial today
.NET Programming

From novice to tech pro — start learning today.