Solved

Interop.Word error

Posted on 2004-09-16
16
395 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
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Article by: Ivo
C# And Nullable Types Since 2.0 C# has Nullable(T) Generic Structure. The idea behind is to allow value type objects to have null values just like reference types have. This concerns scenarios where not all data sources have values (like a databa…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
Along with being a a promotional video for my three-day Annielytics Dashboard Seminor, this Micro Tutorial is an intro to Google Analytics API data.

920 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

14 Experts available now in Live!

Get 1:1 Help Now