ClickOnce Deployment Error
Can anyone help with the following error? It's happening when a user launches the application from IE.
"Unable to install or run the application. The application requires that assembly stdole Version 7.0.3300.0 be installed in the Global Assembly Cache (GAC) first."
[476 byte] By [
gain0010] at [2007-12-17]
I am getting a similar error:
"The application requires that assembly Micrsoft.mshtml Version 7.0.3300.0 be installed in the Global Assembly Cache"
I have no idea what is causing this.
Ok so I went to the properties page of the project...
went to the publish tab...
clicked the "Application Files..." button...
Then changed the files in question (Microsoft.mshtml.dll and stdole.dll) from "Prerequisite" to "Include", I then republished the project and everything worked like a charm.
I'm glad you both figured out how to solve the installation problem.
However, I wanted to take the opportunity to explain what is going on. Visual Studio 2005 tries to be smart about how to deploy references. If the reference has CopyLocal=true, then the reference will be published with the application, by default. If the reference has CopyLocal=false (which is the default when the a reference is installed in the gac, then the reference will be marked as a prerequisite. This means the assembly must be installed in the client's GAC before the ClickOnce application will install.
There are some assemblies that are install into the GAC because of the Visual Studio install, not the .NET FX install. It sounds like this is the situation you both got into.
Regards,
Elizabeth Maher
Thanks Neil, it seems the default should be to check to see if the .dll exists and if it doesn't to copy it to the GAC. Why it was implemented to default to not copying anything is beyond me. Thanks for providing an answer to what has to be a common question but Microsoft doesn't see fit to publish.
You shouldn't have to GAC copy these assemblies -
When publishing deployments, Visual Studio 2005 doesn't automatically copy assemblies out of the GAC into the deployment. I believe licensing is just one of the reasons (you may not have the right to redist a particular assembly that is in the GAC). Other issues are the possible inability of GAC installed assemblies on the dev machine to run when privatized to the app on the client (eg in which the app is possibly running in partial trust, or the machine has an incompatible GAC state) and inconsistent build environments in general due to differences in GAC state on different dev machines.
In this particular case the application took a dependency on two GAC assemblies (stdole, Microsoft.mshtml). Since CopyLocal is set to false by default for these assemblies, they were marked as prerequisites in the application manifest (meaning that ClickOnce expects that these will already be in the GAC and the app does not carry them).
It sounds like VS development time behavior might be improved in terms of automatically detecting when a GAC installed assembly is redistributable (at least for VS GAC installed assemblies), but you at least have the option of manually changing them from prerequisite to include in this case, as you have found. ClickOnce install prerequisite checking helps you here in that it at least allows you to detect and fix this problem at install time (before the app is copied to the target machine) rather than having to debug random assembly load errors at application runtime which would have resulted from an incomplete install.
Very helpful.... headaches are leaving now. Thank you. And thanks to everyone who contributed. That's good info that I needed.
well..... i'm new in this "world" .... i have the original problem,
stdole must be installed in GAC, in Application Files changed to
Include , in References Project change to Copy Local=True, but when try
install the same error appears........ anyone have more ideas ? t u
..... uuppss.... it works .... problem with publish versions ...... shame on me..... t u
"Unable to install or run the application. The application requires that assembly stdole Version 7.0.3300.0 be installed in the Global Assembly Cache (GAC) first."