Solved

Compiling with strong key name...

Posted on 2004-08-19
8
1,142 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
 

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
What Should I Do With This Threat Intelligence?

Are you wondering if you actually need threat intelligence? The answer is yes. We explain the basics for creating useful threat intelligence.

 

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

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.

Join & Write a Comment

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…
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.
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

746 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

13 Experts available now in Live!

Get 1:1 Help Now