引用Microsoft.mshtml.dll的C#.net应用程序崩溃 [英] C# .net application which is referencing Microsoft.mshtml.dll is crashing

查看:447
本文介绍了引用Microsoft.mshtml.dll的C#.net应用程序崩溃的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我正在研究涉及HTML文档解析的C#.net应用程序(Windows7).我需要将网页内容捕获为image(bmp).为此,我使用了IViewObject的draw函数.

为了获取/解析HTML文档,我添加了Microsoft.mshtml参考.我的系统上一切正常.

但是,当我在目标计算机(Windows7)上运行我的应用程序时,它崩溃了,说
''无法加载文件或程序集''Microsoft.mshtml,Version = 7.0.3300.0,Culture = neutral,PublicKeyToken = b03f5f7f11d50a3a"

我在添加的参考中检查了属性选项卡.它指向我系统上的C:| Program Files \ Microsoft.NET \ Primary Interops Assembly \ Microsoft.mshtml.dll.

但是,我在目标计算机上找不到Microsoft.NET文件夹.我知道默认情况下Windows 7带有.NET Framework 3.5.1.那为什么我的应用程序崩溃了?

是什么导致我的系统下Microsoft.NET文件夹(在C:\ Program Files下)的来源?为什么在目标计算机上缺少它?请帮助我理解这一点.

有解决此问题的指针吗?

另外,我认为将Microsoft.mshtml.dll复制到目标计算机上的应用程序目录将解决此问题.但是,我不知道Microsoft.mshtml.dll是否可重新分发(从应用程序的部署角度考虑).

请让我知道此dll是否可重新分发.我们在哪里可以获得有关它的信息.

感谢您为解决此问题提供的任何帮助.

预先感谢.

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.

推荐答案

问候HalliHaida,

在您的应用程序目录中复制Microsoft.mshtml.dll看起来很安全.

从一个快速的google看来,它已经安装了用于开发的各种.NET Framework SDK版本,但是当您安装纯的.NET Frameworks(仅包含使应用程序正常运行所需的文件)时,却没有安装该版本.

您的开发机器已经安装了它,因为.NET SDK已随Visual Studio一起安装.您的目标计算机只有缺少mshtml.dll的.NET Framework.

希望我会有所帮助
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


这篇关于引用Microsoft.mshtml.dll的C#.net应用程序崩溃的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆