Solved

Interop.Word error

Posted on 2004-09-16
16
412 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:Tom Knowlton
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
16 Comments
 
LVL 5

Author Comment

by:Tom 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:Tom 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
Online Training Solution

Drastically shorten your training time with WalkMe's advanced online training solution that Guides your trainees to action. Forget about retraining and skyrocket knowledge retention rates.

 
LVL 5

Author Comment

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

Author Comment

by:Tom 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:Tom 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
 
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:Tom 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:Tom 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:Tom 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:Tom Knowlton
ID: 12107187
The Learned One:

The version of Word is 2000.
0

Featured Post

Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

Question has a verified solution.

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

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Performance in games development is paramount: every microsecond counts to be able to do everything in less than 33ms (aiming at 16ms). C# foreach statement is one of the worst performance killers, and here I explain why.
This video Micro Tutorial shows how to password-protect PDF files with free software. Many software products can do this, such as Adobe Acrobat (but not Adobe Reader), Nuance PaperPort, and Nuance Power PDF, but they are not free products. This vide…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…

726 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