473,626 Members | 3,093 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

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.MyComS erver' does not have
a strong name."

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

Kimmo Laine
Nov 16 '05 #1
6 5068
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@newsg roup> wrote in message
news:eG******** ******@TK2MSFTN GP09.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.MyComS erver' 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.r illing.net> wrote in message
news:OR******** ******@TK2MSFTN GP10.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@newsg roup> wrote in message
news:eG******** ******@TK2MSFTN GP09.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.MyComS erver' 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.microsof t.com> wrote in message
news:NE******** ******@cpmsftng xa10.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.co m

"Kimmo Laine" <reply.to@newsg roup> wrote in message
news:eG******** ******@TK2MSFTN GP09.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.MyComS erver' 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.c om> wrote in
message news:ex******** ******@TK2MSFTN GP10.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.co m

"Kimmo Laine" <reply.to@newsg roup> wrote in message
news:eG******** ******@TK2MSFTN GP09.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.MyComS erver' 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
2252
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 named. I get the following message during a build, presumedly from AL.exe: Assembly generation failed -- Referenced assembly 'Interop.MSHelpServices' does not have a strong name What is the strategy for handling this? -- Jack Menendez...
8
10017
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 done that yet. Our problem is that we very much want to create a PIA for a COM component of ours, but TlbImp.exe /primary insists that all referenced dependencies be PIAs as well. Our component has a type library reference to MSXML 4, hence the...
3
3062
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 interop generated assembly it uses doesn't have a strong name :? Can I sign the interop assembly with some cmd-prompt tool ? or, is there another way to achieve what i want ?
1
8632
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. In this class is a single public method that returns the string "Hello from C sharp". My VB6 ActiveX DLL references the C# DLL (CSharpProject.dll) using the
4
2200
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 COM object in Component Services. THanks,
20
3181
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: http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnsmtps/html/writingmngsinks.asp). I set my project properties as 'Register as COM interop' to true, I can install it my project on my developement machine without a flaw. Great.
1
2122
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 compiling this class library projects into GAC. Registrering it into GAC requires tthat the assembly should have a strong name. Now when i use attribute and compile the class library project it prompts me that the interop assembly should have a strong...
3
7697
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 generated when I reference VSS COM component in my own dll C#.net project) Thanks.
1
2282
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 fine, but problems occur when I need to reference a thirdparty's component. In my case I am talking about Interop.ShDocVw and AxInterop.ShDocVw. If
0
8259
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
8192
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can effortlessly switch the default language on Windows 10 without reinstalling. I'll walk you through it. First, let's disable language synchronization. With a Microsoft account, language settings sync across devices. To prevent any complications,...
1
8358
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
8502
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
7188
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
6119
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 presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
2621
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
1
1805
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
2
1504
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.