Solved

Compiling with strong key name...

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

Secure Your Active Directory - April 20, 2017

Active Directory plays a critical role in your company’s IT infrastructure and keeping it secure in today’s hacker-infested world is a must.
Microsoft published 300+ pages of guidance, but who has the time, money, and resources to implement? Register now to find an easier way.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
VB.NET 2008 - Windows Protected Your PC 7 53
Access Schema 6 45
Add Combobox column to datagridview using vb.net 2 27
vb.net datagrid point 4 23
This tutorial demonstrates one way to create an application that runs without any Forms but still has a GUI presence via an Icon in the System Tray. The magic lies in Inheriting from the ApplicationContext Class and passing that to Application.Ru…
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 …
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…

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