Solved

Compiling with strong key name...

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

 

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

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

Suggested Solutions

Title # Comments Views Activity
Need help parsing JSON in my VB.Net application 4 44
WPF - Tooltips for ComboBox items 5 36
Closing all open child forms. 4 38
Get list of word ducuments in a folder 10 35
1.0 - Introduction Converting Visual Basic 6.0 (VB6) to Visual Basic 2008+ (VB.NET). If ever there was a subject full of murkiness and bad decisions, it is this one!   The first problem seems to be that people considering this task of converting…
It’s quite interesting for me as I worked with Excel using vb.net for some time. Here are some topics which I know want to share with others whom this might help. First of all if you are working with Excel then you need to Download the Following …
With the power of JIRA, there's an unlimited number of ways you can customize it, use it and benefit from it. With that in mind, there's bound to be things that I wasn't able to cover in this course. With this summary we'll look at some places to go…
Many functions in Excel can make decisions. The most simple of these is the IF function: it returns a value depending on whether a condition you describe is true or false. Once you get the hang of using the IF function, you will find it easier to us…

910 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

25 Experts available now in Live!

Get 1:1 Help Now