We have an application that works with MS Office and uses Microsoft.mshtml.dll. We use ClickOnce to deploy the application. The application deploys without issues on most machines, but sometimes we get errors saying "System Update Required, Microsoft.mshtl.dll should be in the GAC".

We tried installing the PIA for Office without luck. Since Microsoft.mshtml.dll is a system dependent file we cannot include it in the package and re-distribute it. What would be the best way to deploy the application?


You can set up prerequisites in a clickonce app, which would check for specific assemblies in the GAC before allowing users to install. You would still need to manually install an app that includes the required office dll outside of ClickOnce, but you would at least avoid throwing errors.

Guy Starbuck
+1  A: 

Do you know which version of MS Office you are targeting? These PIAs are very specific to the version of Office. I remember when we were building a smart client application, we used to have Build VM machines, each one targeting a specific version of Outlook.

Another hurdle was not being able to specify these PIAs as pre-requisites or bundle them with the app. These PIAs needs to be installed on the client using Office CD (at least for 2003 version).


We are targeting Office 2003 and Office 2007, but using the Office 11 (2003) dlls as Office 2007 is backward compatible.

The problem occurs only for Microsoft.mshtml.dll file. This file is setup as a prerequisite in the ClickOnce app.

On this particular install we tried installing both the Office 2003 and Office 2007 PIA's to no avail.


Me too, i have the same error with mshtml, when i deploy my software it seems that mshtml feautures that worked on the development machine simply doesn't work on the user's machine. 1 Thought though, i think you CAN redistribute the mshtml with your software...but i think if there is an alternative that will be better.


I had this problem too.

The solution to this is to go to the References folder in the solution explorer, then right click Microsoft.mshtml, then Properties.

In the Propoerties page mark "Copy Local" as True. This should work.