Solved

Compiling with strong key name...

Posted on 2004-08-19
8
1,144 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
  • 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
Microsoft Certification Exam 74-409

Veeam® is happy to provide the Microsoft community with a study guide prepared by MVP and MCT, Orin Thomas. This guide will take you through each of the exam objectives, helping you to prepare for and pass the examination.

 

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

VMware Disaster Recovery and Data Protection

In this expert guide, you’ll learn about the components of a Modern Data Center. You will use cases for the value-added capabilities of Veeam®, including combining backup and replication for VMware disaster recovery and using replication for data center migration.

Question has a verified solution.

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

Article by: Kraeven
Introduction Remote Share is a simple remote sharing tool, enabling you to see, add and remove remote or local shares. The application is written in VB.NET targeting the .NET framework 2.0. The source code and the compiled programs have been in…
I think the Typed DataTable and Typed DataSet are very good options when working with data, but I don't like auto-generated code. First, I create an Abstract Class for my DataTables Common Code.  This class Inherits from DataTable. Also, it can …
In a recent question (https://www.experts-exchange.com/questions/28997919/Pagination-in-Adobe-Acrobat.html) here at Experts Exchange, a member asked how to add page numbers to a PDF file using Adobe Acrobat XI Pro. This short video Micro Tutorial sh…
A short tutorial showing how to set up an email signature in Outlook on the Web (previously known as OWA). For free email signatures designs, visit https://www.mail-signatures.com/articles/signature-templates/?sts=6651 If you want to manage em…

777 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