Solved

Interop.Word error

Posted on 2004-09-16
16
393 Views
Last Modified: 2012-06-27
The following exception is being raised in my program.  How can I fix this?

System.IO.FileLoadException: The located assembly's manifest definition with name 'Interop.Word' does not match the assembly reference.
File name: "Interop.Word"
   at BuyersFund.FaxRequestWindowsService.ServiceProcessRequests.Bln_PrintAllFiles(String StrFileName, String network_printer)
   at BuyersFund.FaxRequestWindowsService.ServiceProcessRequests.PrintDocToNetworkPrinter(String TempFullDocPath, String PrinterName)

Fusion log follows:
=== Pre-bind state information ===
LOG: DisplayName = Interop.Word, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = c:\puball\
LOG: Initial PrivatePath = NULL
Calling assembly : FaxRequestWindowsService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: Interop.Word, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL file:///c:/puball/Interop.Word.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN
0
Comment
Question by:knowlton
16 Comments
 
LVL 5

Author Comment

by:knowlton
ID: 12080122
There is a lot about this error message I do not understand.

Perhaps if I pick it apart one line at a time:



System.IO.FileLoadException:
The located assembly's manifest definition with name 'Interop.Word' does not match the assembly reference.
File name: "Interop.Word"
   at BuyersFund.FaxRequestWindowsService.ServiceProcessRequests.Bln_PrintAllFiles(String StrFileName, String network_printer)
   at BuyersFund.FaxRequestWindowsService.ServiceProcessRequests.PrintDocToNetworkPrinter(String TempFullDocPath, String PrinterName)


In the above error message, it says "the located assembly's manifest definition with name 'Interop.Word' does not match the assembly reference.

HOW is the assembly being located and it's manifest defnition being read?

WHAT is determining that that this manifest definition does not match the assembly reference?

WHAT is the assembly reference???????


I am so sooooo lost.....someone give me a clue.
0
 
LVL 5

Author Comment

by:knowlton
ID: 12080163
Fusion log follows:
=== Pre-bind state information ===
LOG: DisplayName = Interop.Word, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null
 (Fully-specified)
LOG: Appbase = c:\puball\
LOG: Initial PrivatePath = NULL
Calling assembly : FaxRequestWindowsService, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null.
===

LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).
LOG: Post-policy reference: Interop.Word, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null
LOG: Attempting download of new URL file:///c:/puball/Interop.Word.DLL.
WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN



What is a fusion log?  Why is it called fusion?


LOG: Appbase = c:\puball\


I know what the puball folder is.      It is a folder that I made, into which I dump all of my solution's .EXE and .DLL files.


>>>>>>>>>LOG: Policy not being applied to reference at this time (private, custom, partial, or location-based assembly bind).


What POLICY is being referenced here?  Can I look at the POLICY?  Where is it?   What does it look like?  Should I change the POLICY, and how do I do it?



>>>>>>>>>LOG: Post-policy reference: Interop.Word, Version=8.1.0.0, Culture=neutral, PublicKeyToken=null


What is the significance of a Post-policy reference?  Does that mean there is a PRE Policy reference as well?



>>>>>>>>>>>>>LOG: Attempting download of new URL file:///c:/puball/Interop.Word.DLL.


Why is a download of this file being attempted and the file is coming FROM where and going TO WHAT FOLDER?


>>>>>>>>>>WRN: Comparing the assembly name resulted in the mismatch: PUBLIC KEY TOKEN


Okay, fine......why does this matter and how can I tell there is a mismatch?????
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12080294
Was the Interop.Word generated when you added a COM reference to the Word type library?

Bob
0
 
LVL 5

Author Comment

by:knowlton
ID: 12080304
Yes it was....how did you know that?
0
 
LVL 5

Author Comment

by:knowlton
ID: 12080330
Here is a screen shot of the WORD dll I am picking that is causing all the trouble:

http://www.robotzgame.com/junk/Word_under_COM.gif
0
 
LVL 5

Author Comment

by:knowlton
ID: 12080750
Hello?
0
 
LVL 11

Accepted Solution

by:
Agarici earned 500 total points
ID: 12082020
the exception is thrown because the assembly found in appbase does not match the reference in your app - it has a strong name, while the reference does not specify a strong name for that reference.
try to remove the reference, add it again and rebuild the project.

hth.
A.
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12083602
I am psychic I guess.  Actually, that is the way that most people do it, and I just guessed :)

What version of Word are you using here?  I am guessing Word 2000.  If it is Word XP, though, there are Primary Interoperability Assemblies for XP that are better than auto-generated COM wrapper classes.

Bob
0
Find Ransomware Secrets With All-Source Analysis

Ransomware has become a major concern for organizations; its prevalence has grown due to past successes achieved by threat actors. While each ransomware variant is different, we’ve seen some common tactics and trends used among the authors of the malware.

 
LVL 10

Expert Comment

by:eternal_21
ID: 12085771
What is a Fusion log?
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12085787
Debugging Assembly Loading Failures
http://blogs.msdn.com/suzcook/archive/2003/05/29/57120.aspx

Bob
0
 
LVL 96

Expert Comment

by:Bob Learned
ID: 12085921
0
 
LVL 5

Expert Comment

by:tomasX2
ID: 12087177
Is this happening on you dev machine or a machine that you have installed a msi of your app?
0
 
LVL 5

Author Comment

by:knowlton
ID: 12104555
Expert tomasX2:

<quote>
 Is this happening on you dev machine or a machine that you have installed a msi of your app?
</quote>

This is happening on our production server.
0
 
LVL 5

Author Comment

by:knowlton
ID: 12104574
Expert Agarici:

<quote>
the exception is thrown because the assembly found in appbase does not match the reference in your app - it has a strong name, while the reference does not specify a strong name for that reference.
try to remove the reference, add it again and rebuild the project.
</quote>

I'll try this now....
0
 
LVL 5

Author Comment

by:knowlton
ID: 12107181
Expert Agarici:

I did tried deleting and re-establishing the reference and still the same problem.
0
 
LVL 5

Author Comment

by:knowlton
ID: 12107187
The Learned One:

The version of Word is 2000.
0

Featured Post

How to improve team productivity

Quip adds documents, spreadsheets, and tasklists to your Slack experience
- Elevate ideas to Quip docs
- Share Quip docs in Slack
- Get notified of changes to your docs
- Available on iOS/Android/Desktop/Web
- Online/Offline

Join & Write a Comment

Calculating holidays and working days is a function that is often needed yet it is not one found within the Framework. This article presents one approach to building a working-day calculator for use in .NET.
Real-time is more about the business, not the technology. In day-to-day life, to make real-time decisions like buying or investing, business needs the latest information(e.g. Gold Rate/Stock Rate). Unlike traditional days, you need not wait for a fe…
Sending a Secure fax is easy with eFax Corporate (http://www.enterprise.efax.com). First, Just open a new email message.  In the To field, type your recipient's fax number @efaxsend.com. You can even send a secure international fax — just include t…
Access reports are powerful and flexible. Learn how to create a query and then a grouped report using the wizard. Modify the report design after the wizard is done to make it look better. There will be another video to explain how to put the final p…

759 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

24 Experts available now in Live!

Get 1:1 Help Now