Fixing "Could not load file or assembly Microsoft.mshtml" Error
Environment
Product | Progress® Telerik® Reporting |
Description
I encounter the Could not load file or assembly Microsoft.mshtml
error when working with Telerik Report Designer. This happens consistently while updating or designing reports, particularly when adding a subreport and using an HTMLTextBox for a different SQL query. The error forces the system to shut down, requiring a restart.
Solution
To resolve the "Could not load file or assembly Microsoft.mshtml" error, follow these steps:
Step 1: Copy the Assembly to the Designer Folder
- Locate the
microsoft.mshtml.dll
assembly file on your system. -
Copy the file to the Telerik Report Designer folder.
Open the report file (for example,
SampleReport.trdp
) and select the HTMLTextBox to check if the error is resolved.
Step 2: Add Assembly Reference to the Configuration Files
- Open the
Telerik.ReportDesigner.exe.config
orTelerik.ReportDesigner.x86.exe.config
file. -
Add the following assembly reference. Ensure the
<Telerik.Reporting>
section is properly registered:<configuration> <configSections> <section name="Telerik.Reporting" type="Telerik.Reporting.Configuration.ReportingConfigurationSection, Telerik.Reporting" allowLocation="true" allowDefinition="Everywhere"/> </configSections> // ... <Telerik.Reporting> <AssemblyReferences> <add name="Microsoft.mshtml" version="7.0.3300.0" /> </AssemblyReferences> </Telerik.Reporting> // ...
Save the changes and relaunch Telerik Report Designer.
Step 3: Install Microsoft.mshtml in the Global Assembly Cache (GAC)
-
Open the Developer Command Prompt for Visual Studio.
Run the command
gacutil /l microsoft.mshtml
to check if the assembly exists in the GAC. It should displayNumber of items = 0
if missing.- Navigate to the directory containing the
microsoft.mshtml.dll
file. - Execute the following command to install the assembly:
gacutil /i microsoft.mshtml.dll
. - Verify installation with
gacutil /l microsoft.mshtml
.
See Also
*Global Assembly Cache (GAC) *Install an assembly into the global assembly cache