473,499 Members | 1,562 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

BadImageFormatException with Microsoft.mshtml

Hello,

I have written an application in .NET (C#) which uses some stuff from the
Microsoft.mshtml. Unfortunately some customers reported that they are
missing this DLL. Therefore we now redistribute a copy of the
Microsoft.mshtml-DLL with our installation routine (just copy it into the
application directory). Now the application works on most machines, but on a
couple of machines I get a "BadImageFormatException" (details below).

What could be the reason for this exception? How can I fix it and ensure
that my application can load the DLL? Could it be a version conflict or
policy problem?

Thanks in advance!
Erich

------

System.BadImageFormatException: The format of the file 'Microsoft.mshtml' is
invalid. File name: "Microsoft.mshtml" at [...]

=== Pre-bind state information ===
LOG: DisplayName = Microsoft.mshtml, Version=7.0.3300.0, Culture=neutral,
PublicKeyToken=b03f5f7f11d50a3a (Fully-specified)
LOG: Appbase = C:\MyApp\
LOG: Initial PrivatePath = NULL
Callong assembly: MyApp, Version=1.0.1942.28310, Culture=neutral,
PublicKeyToken=null.
===

LOG: Publisher policy file is not found.
LOG: Host configuration file not found.
LOG: Using machine configuration file from
C:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\confi g\machine.config.
LOG: Post-policy reference: Microsoft.mshtml, Version=7.0.3300.0,
Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a
LOG: Attempting download of new URL file:///C:/MyApp/Microsoft.mshtml.DLL.
Jul 21 '05 #1
2 5219
Hi Erich,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you have copy the Microsoft.mshtml
with you app. However, a BadImageFormatException was thrown sometimes. If
there is any misunderstanding, please feel free to let me know.

As far as I know, the MSHTML.DLL file is distributed with many products.
For example, .NET framework 1.1, Internet Explorer 6.0 and so on. So I
assume that the the problem might occur because of the Primary Interop
Assembly Microsoft.mshtml is not installed properly.

Since copying the Microsoft.mshtml with your app doesn't work, I suggest
you try to install the PIA into the GAC using gacutil.exe. By default, the
app will look into GAC for strong named assembly first.

If that still fails, you can try to use the Assembly Binding Log Viewer to
check for the binding failures. Here is the usage of Assembly Binding Log
Viewer.

http://msdn.microsoft.com/library/de...us/cptools/htm
l/cpgrffusionlogviewerfuslogvwexe.asp

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #2
Hi Erich,

First of all, I would like to confirm my understanding of your issue. From
your description, I understand that when you have copy the Microsoft.mshtml
with you app. However, a BadImageFormatException was thrown sometimes. If
there is any misunderstanding, please feel free to let me know.

As far as I know, the MSHTML.DLL file is distributed with many products.
For example, .NET framework 1.1, Internet Explorer 6.0 and so on. So I
assume that the the problem might occur because of the Primary Interop
Assembly Microsoft.mshtml is not installed properly.

Since copying the Microsoft.mshtml with your app doesn't work, I suggest
you try to install the PIA into the GAC using gacutil.exe. By default, the
app will look into GAC for strong named assembly first.

If that still fails, you can try to use the Assembly Binding Log Viewer to
check for the binding failures. Here is the usage of Assembly Binding Log
Viewer.

http://msdn.microsoft.com/library/de...us/cptools/htm
l/cpgrffusionlogviewerfuslogvwexe.asp

HTH.

Kevin Yu
=======
"This posting is provided "AS IS" with no warranties, and confers no
rights."

Jul 21 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
413
by: Erich Hofacker | last post by:
Hello, I have written an application in .NET (C#) which uses some stuff from the Microsoft.mshtml. Unfortunately some customers reported that they are missing this DLL. Therefore we now...
3
11313
by: Zürcher See | last post by:
I've wrote an application that use internet explorer to download some html page, to get the document I use the Microsoft.mshtml library. mshtml.IHTMLDocument3...
1
7744
by: Dean Hallman | last post by:
I need to ensure client machine has Microsoft.mshtml installed in the GAC. And if not, deploy it. My app is a Browser Helper Object and depends on mshtml. Initially, I thought I could take care...
3
11930
by: Installutil System.BadImageFormatExcepti | last post by:
I've tried to make a Windows Service using the 2005 C# and when I go to use Installutil it returns with an System.BadImageFormatException error while intializing the installation. I've even gone as...
1
11133
by: bernhard schelling | last post by:
Hi, I'm using Visual C# Express and I'd like to build a project available from http://download.microsoft.com/download/f/2/7/f279e71e-efb0-4155-873d-5554a0608523/WSRP.exe Somehow the Refernce...
4
4463
by: Roger Aikin | last post by:
I've converted a VB6 project to VB.Net 2005. (Actually using vstudio pro 2005). I'm on a machine that also has VB6 and Vstudio.net 2003 on it. The project uses Word, Excel, MapPoint and SqlClient...
0
1611
by: Filippo Bettinaglio | last post by:
Hi all, In the past 3 days I have done some research about Microsoft.mshtml component within .NET 2 framework. I need some clarification/comfermation about the Microsoft.mshtml componet and...
2
5444
by: JM | last post by:
Hi, I have created a windows application which uses Microsoft.mshtml.dll for displaying browser window in the application for showing html. When I am creating a setup program, I have to...
4
2871
by: =?Utf-8?B?aWduaGVucnk=?= | last post by:
I have mixed-mode multi-file assembly of several netmodules and a dll. All are generated using c# compiler, vc++ compiler and vc++ linker from command prompt. I can browse the content of the...
3
5241
by: John A Grandy | last post by:
VS2005 ( all updates ) on XP ( all updates ) I have a solution with many projects and a substantial reference tree. I have a Windows Application project that will build but not run. It fails...
0
7130
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7007
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7386
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5468
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4918
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
3098
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
0
295
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.