473,411 Members | 2,210 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,411 software developers and data experts.

Interop component with strong name

Hi,

we are using COM server through interop, and would like to sign our assembly
with strong name. But when building, we get the following error: "Assembly
generation failed -- Referenced assembly 'Interop.MyComServer' does not have
a strong name."

How can is sign my COM server with strong name?
thx

Kimmo Laine
Nov 16 '05 #1
6 5052
1) Use the sn.exe program that is included with the SDK to generate a
public/private key file.
2) Reference the key file in the AssemblyInfo file with the AssemblyKeyFile
attribute.

That should do it.

"Kimmo Laine" <reply.to@newsgroup> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
Hi,

we are using COM server through interop, and would like to sign our assembly with strong name. But when building, we get the following error: "Assembly
generation failed -- Referenced assembly 'Interop.MyComServer' does not have a strong name."

How can is sign my COM server with strong name?
thx

Kimmo Laine

Nov 16 '05 #2

Hi Kimmo
May be I didn't get you right but I think you have and old com that you are
calling form a .net assembly which the VS should do for you?? . any way ,
you have an assembly that you want to sign with a strong name . what you
should do is
Generate a key file using the utility sn.exe with the argument -k and a
name of a file .snk like sn k- myfile.snk
Then open you assemblyinfo file and add the location of the key to the tag
[assembly: AssemblyKeyFile("the uri of you file")] then recompile.

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #3
Hi Peter,

i did it, but the compiler can´t use it because the referenced COM server is
not signed with strong name. Is there a way to sign the server (not .NET
code) with strong name.

Kimmo Laine

"Peter Rilling" <pe***@nospam.rilling.net> wrote in message
news:OR**************@TK2MSFTNGP10.phx.gbl...
1) Use the sn.exe program that is included with the SDK to generate a
public/private key file.
2) Reference the key file in the AssemblyInfo file with the AssemblyKeyFile attribute.

That should do it.

"Kimmo Laine" <reply.to@newsgroup> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
Hi,

we are using COM server through interop, and would like to sign our

assembly
with strong name. But when building, we get the following error: "Assembly generation failed -- Referenced assembly 'Interop.MyComServer' does not

have
a strong name."

How can is sign my COM server with strong name?
thx

Kimmo Laine


Nov 16 '05 #4
Hi Mohamed,

you get me right! I did generate the key file, but compiler cannot use it
because the old COM server is not signed. Is there a way to sign this old
server somehow or to tell the compiler to ignore it.

Kimmo Laine

"Mohamoss" <mo************@egdsc.microsoft.com> wrote in message
news:NE**************@cpmsftngxa10.phx.gbl...

Hi Kimmo
May be I didn't get you right but I think you have and old com that you are calling form a .net assembly which the VS should do for you?? . any way ,
you have an assembly that you want to sign with a strong name . what you
should do is
Generate a key file using the utility sn.exe with the argument -k and a
name of a file .snk like sn k- myfile.snk
Then open you assemblyinfo file and add the location of the key to the tag
[assembly: AssemblyKeyFile("the uri of you file")] then recompile.

Mohamed Mahfouz
MEA Developer Support Center
ITworx on behalf of Microsoft EMEA GTSC

Nov 16 '05 #5
Kimmo,

As indicated in other posts, you need to create a strong name using the
SN.EXE utility. However, you can not sign the COM assembly. The compiler
error is being raised because the interop assembly itself is not signed.
Instead of setting a reference to the COM component in your project through
VS.NET, you will have to run TLBIMP.EXE on the DLL that you want to use in
your program. When you run it, you can sign it using the /keyfile switch
(pointing to the output of SN.EXE). Once you have done that, set a
reference to that in your project in VS, and then compile. It should
compile fine.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Kimmo Laine" <reply.to@newsgroup> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
Hi,

we are using COM server through interop, and would like to sign our assembly with strong name. But when building, we get the following error: "Assembly
generation failed -- Referenced assembly 'Interop.MyComServer' does not have a strong name."

How can is sign my COM server with strong name?
thx

Kimmo Laine

Nov 16 '05 #6
If that is the problem, then Kimmo could also set the "Wrapper Assembly Key
File" property in the property dialog for the project to sign those interop
assemblies, right?

"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard.caspershouse.com> wrote in
message news:ex**************@TK2MSFTNGP10.phx.gbl...
Kimmo,

As indicated in other posts, you need to create a strong name using the SN.EXE utility. However, you can not sign the COM assembly. The compiler
error is being raised because the interop assembly itself is not signed.
Instead of setting a reference to the COM component in your project through VS.NET, you will have to run TLBIMP.EXE on the DLL that you want to use in
your program. When you run it, you can sign it using the /keyfile switch
(pointing to the output of SN.EXE). Once you have done that, set a
reference to that in your project in VS, and then compile. It should
compile fine.

Hope this helps.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard.caspershouse.com

"Kimmo Laine" <reply.to@newsgroup> wrote in message
news:eG**************@TK2MSFTNGP09.phx.gbl...
Hi,

we are using COM server through interop, and would like to sign our

assembly
with strong name. But when building, we get the following error: "Assembly generation failed -- Referenced assembly 'Interop.MyComServer' does not

have
a strong name."

How can is sign my COM server with strong name?
thx

Kimmo Laine


Nov 16 '05 #7

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

1
by: Jack Menendez | last post by:
I have a forms based plugin architecture using C# that includes help files using MSHelpServices. However, my strongly named assemblies cannot be created because Interop.MSHelpServices is not strongly...
8
by: Chango V. | last post by:
Hello, We seem to need a PIA for MSXML 4. According to the documentation, only the original publisher of a COM type library is supposed to create a .NET PIA. As far as I know, Microsoft hasn't...
3
by: Angelos Karantzalis | last post by:
I've built an Assembly to wrap around a COM component. However, I need to add it to the GAC. Upon trying to do that, I'm trying to give the assembly a strong name, which fails because the com...
1
by: Craig | last post by:
I am having problems getting an ActiveX DLL written in VB6 to call a method in a C# class library component. My C# DLL is called CSharpProject.dll and contains a public class called CSharpClass....
4
by: Razzie | last post by:
Hey all, I developed an application as a com object. I set the 'register for com interop' in the project properties to true. How do I deploy this on another machine? I can't add the DLL as a...
20
by: Razzie | last post by:
Hey all, I'm really going through a small hell right now - I've completely lost it :) I made a project, using two interop libraries from exchange (created them as in this msdn article:...
1
by: Hatim Ali | last post by:
Hello, I have a class library project which has a class supporting COM+ transactions. This class library project refers a COM interop assembly. Now i need to register the assembly after...
3
by: Andrew | last post by:
Hello, friends, I wonder how can I sign Interop.SourceSafeTypeLib.dll a strong name and reference it from my own dll? (I am using C#.net). (Interop.SourceSafeTypeLib.dll is automaticall...
1
by: Shiro | last post by:
Hi I have read the various postings relating to Interop strong name signing and cannot find an example similar to mine. I have stringly named my AxInterops/Interops and they all work just...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.