Solved

Compiling with strong key name...

Posted on 2004-08-19
8
1,152 Views
Last Modified: 2008-01-09
I am compiling a type library that is registered. However, whenever I try to add the Word Object reference to it, it stops compiling giving me this error:

Unable to emit assembly: Referenced assembly 'Interop.Word' does not have a strong name

Well...I know what is going on but I have no idea how to fix it. I used sn.exe to generate the strong name and resagm to register the type libs.

Thanks in advance.
0
Comment
Question by:drakkarnoir
[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
  • 4
  • 3
8 Comments
 
LVL 14

Expert Comment

by:ptakja
ID: 11844663
The problem is that you strong named your assembly, but the Word assembly you referenced isn't strong named.  Are you trying to put your assy into the GAC?  The GAC has very strict rules about what can go in there.  If you can live without the assy being in the GAC, you should be fine.  Just dump the strong name key.
0
 
LVL 4

Expert Comment

by:Daniellus83
ID: 11845004
Oweww. that a common problem... the solution is very very simple:

Download this tool and your ready to rock 'n roll ;-)

http://www.interscapeusa.com/Products/DeadBolt/  (info)

download page: (click left icon): https://secure.interscapeusa.com/Register/Downloads.aspx?Authenticated=True

After install: In the Tools Menu there will be "Deadbolt.Net" added. To strong name your solution/project: LEFT-CLICK on your Assembly.vb and choose "Digitally Sign"


I used it for registering a toolbar in IE (.dll assembly into MMC) and worked GREAT!


Succes Daniël
0
 

Author Comment

by:drakkarnoir
ID: 11845262
ptakja, I am actually using this to do COM functions with other programs. I am going to be writting the Microsoft Word scripting in VB.net and then have other people access my functions...like obj->searchandReplace("hello","ok") would replace hello with ok...etc.

Trying Daniel's solution.
0
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

 

Author Comment

by:drakkarnoir
ID: 11846434
Daniel, this is what I got after your method:

Microsoft (R) .NET Global Assembly Cache Utility.  Version 1.1.4322.573
Copyright (C) Microsoft Corporation 1998-2002. All rights reserved.

Failure adding assembly to the cache: Attempt to install an assembly without a strong name
0
 

Author Comment

by:drakkarnoir
ID: 11846472
I noticed what it created...

<Assembly: AssemblyKeyFile("C:\mykey2.snk")>

Which is fine, except that is also what I had before with another key name. The problem is, that my reference to the MS Word library is not signed. Hence the error:

Unable to emit assembly: Referenced assembly 'Interop.Word' does not have a strong name
0
 
LVL 4

Expert Comment

by:Daniellus83
ID: 11846544
drakkarnoir;

> to get another AssemblyKeyFile... you have to select (in VS.Net2003)  Tools > Deadbolt.Net > Create my Digitally Signing Key....

This MIGHT help you solving the problem... (try it)   BUT ...

..I think this assembly 'Interop.Word' is itself NOT digitally signed... So if you do not have the source you cannot do anything about it. Its although very strange... It should be NO problem, since this is a official MS .dll (am I right?)

Try creating another key file first...

Else you need to try to find (online; Google..?) another version of the assembly...

Let me know how you progress...
0
 
LVL 4

Accepted Solution

by:
Daniellus83 earned 500 total points
ID: 11846630
I just had this idea:

aren't you using an old assembly? Do you use Microsoft.Office.Interop.Word.dll ? Is it from Office XP? If not that could be the reason you can't get it registered into MMC...

This is a Office XP PIA list:

    http://support.microsoft.com/default.aspx?scid=kb;en-us;328912


This is a full download file with all the Office XP PIAs ("...use to develop Office XP solutions with Visual Studio .NET..."):

    http://www.microsoft.com/downloads/details.aspx?familyid=c41bd61e-3060-4f71-a6b4-01feba508e52&displaylang=en


Hope this ends you nightmare ;-)    (...At least you are a nice free Dignitally signing tool richer...)


Daniël
0
 

Author Comment

by:drakkarnoir
ID: 11847394
Well I am doing this on Office 2003. Anyways, here is what ended up working finally:

http://support.microsoft.com/default.aspx?scid=kb;en-us;313666
0

Featured Post

Industry Leaders: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

Well, all of us have seen the multiple EXCEL.EXE's in task manager that won't die even if you call the .close, .dispose methods. Try this method to kill any excels in memory. You can copy the kill function to create a check function and replace the …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…
This is my first video review of Microsoft Bookings, I will be doing a part two with a bit more information, but wanted to get this out to you folks.

695 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