Click here to Skip to main content
15,904,655 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hi,

I am working on a C# .net application (Windows7) which involves HTML document parsing. I need to capture the web page content as an image(bmp). For this I am using the IViewObject's draw function.

For getting/parsing the HTML document, I have added the Microsoft.mshtml reference. Everything is working fine on my system.

However when I run my application on target machine (Windows7) it is crashing, saying
'Could not load file or assembly 'Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"

I checked the properties tab in the reference I added. It points to C:|Program Files\ Microsoft.NET\Primary Interops Assemblies\Microsoft.mshtml.dll on my system.

However, I don't find Microsoft.NET folder on the target machine. What I know is by default Windows 7 comes with .NET framework 3.5.1. Then why my application is crashing?

What is causing the source of Microsoft.NET folder (under C:\Program Files) under my system? And why is it missing on the target machine? Please help me in understanding this.

Any pointers for resolving this issue?

Also, I am thinking that copying the Microsoft.mshtml.dll to my application directory on the target machine will resolve the issue. However, I don't know if Microsoft.mshtml.dll is a redistributible one or not (concerned from deployment of the application point of view).

Please let me know if this dll is redistributible. Where can we get information about it.

Any help in resolving this issue is appreciated.

Thanks in advance.
Posted
Comments
Yvan Rodrigues 16-Jun-11 21:33pm    
Did your check that the assembly versions match?

1 solution

Greetings HalliHaida,

It looks like it's safe to copy Microsoft.mshtml.dll within your application directory.

From a quick google it looks like it gets installed with various .NET Framework SDK versions used for development, but not when you install plain .NET Frameworks which contain only the necessary files required to get the apps working.

Your development machine already has it installed, because .NET SDK's get installed with Visual Studio. Your target machine only has the .NET Framework which is missing the mshtml.dll.

Hope I was helpfull
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900