473,548 Members | 2,691 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Remove the strong name attribute from an assembly

Jo
Hi all,

I have a strong name assembly (a dll written in C#) which has Register for
COM interop set to true.

I want to remove the strong name attribute from the assembly, how to do
that?

TIA,

Jo
Apr 27 '07 #1
6 9393
Jo,

You can't. You need to recompile/regenerate the assembly without a
strong name.

Why would you want to remove the strong name anyways?
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Jo" <jo@microsoft.c omwrote in message
news:ej******** *****@TK2MSFTNG P06.phx.gbl...
Hi all,

I have a strong name assembly (a dll written in C#) which has Register for
COM interop set to true.

I want to remove the strong name attribute from the assembly, how to do
that?

TIA,

Jo

Apr 27 '07 #2
If you have the source code, all you need to do is remove the AssemblyKeyFile
attribute from the assemblyinfo.cs file (that's where it is usually, but not
always, placed) - and recompile.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Jo" wrote:
Hi all,

I have a strong name assembly (a dll written in C#) which has Register for
COM interop set to true.

I want to remove the strong name attribute from the assembly, how to do
that?

TIA,

Jo
Apr 27 '07 #3
As of .NET 2.0, you can also apply a strong name in a project through
the project properties. It was deemed a security issue to bake into the
metadata the location of the key file (even though that location is relative
to the machine it was built on, it was not a good idea).

So if you have the original project, you have to make sure that on the
"signing" tab, you don't have the option "Sign the assembly" checked.
--
- Nicholas Paldino [.NET/C# MVP]
- mv*@spam.guard. caspershouse.co m

"Peter Bromberg [C# MVP]" <pb*******@yaho o.yabbadabbadoo .comwrote in
message news:B2******** *************** ***********@mic rosoft.com...
If you have the source code, all you need to do is remove the
AssemblyKeyFile
attribute from the assemblyinfo.cs file (that's where it is usually, but
not
always, placed) - and recompile.
Peter
--
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
Short urls & more: http://ittyurl.net


"Jo" wrote:
>Hi all,

I have a strong name assembly (a dll written in C#) which has Register
for
COM interop set to true.

I want to remove the strong name attribute from the assembly, how to do
that?

TIA,

Jo

Apr 27 '07 #4
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c omwrote in
message news:ek******** ******@TK2MSFTN GP06.phx.gbl...
You can't.
Are you sure? I think that someone who knows well how to use ILDASM and
ILASM would be able to very quickly disassemble the assembly and then
compile back the IL source to produce the same assembly but without a strong
name.
As to WHY would they wish to do such a thing, I don't have an answer.

Apr 27 '07 #5
Alberto Poblacion wrote:
"Nicholas Paldino [.NET/C# MVP]" <mv*@spam.guard .caspershouse.c omwrote in
message news:ek******** ******@TK2MSFTN GP06.phx.gbl...
> You can't.

Are you sure? I think that someone who knows well how to use ILDASM and
ILASM would be able to very quickly disassemble the assembly and then
compile back the IL source to produce the same assembly but without a
strong
name.
Isn't than exactly what Nicholas wrote in the next statement that you
choose to cut out ?

# You can't. You need to recompile/regenerate the assembly without a
#strong name.

Arne

Apr 28 '07 #6
"Arne Vajhøj" <ar**@vajhoej.d kwrote in message
news:46******** *************** @news.sunsite.d k...
Isn't than exactly what Nicholas wrote in the next statement that you
choose to cut out ?

# You can't. You need to recompile/regenerate the assembly without a
#strong name.
Sorry. I interpreted that as "remove the AssemblyKeyFile attribute from
the source code and then recompile." My intention was to point out that you
could remove the strong name from the assembly without having access to the
source code.

Apr 28 '07 #7

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

Similar topics

3
2965
by: lanky_tx | last post by:
Hi All, We have an automated build and test environment using NAnt and Nunit. Some of our assemblies are being strong named by modifying the AssemblyInfo.cs and having csc compile it. Some of these strong named assemblies are being dynamically loaded into the runtime. We store the metadata information about the strong named assemblies in...
6
5064
by: Kimmo Laine | last post by:
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?
20
3164
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...
1
2114
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...
2
3586
by: steve bull | last post by:
When I run FXCop(1.32) against my project I keep getting the error "Assemblies should have strong names" and cannot get rid of the message. I edited the assembly info :
3
4787
by: Annie | last post by:
After assigning a key to a DLL to make it a strong name assembly, it cannot be compiled to the same location again. The VS.NET always shows "Could not copy temporary files to the output directory. The file 'xxx.dll' cannot be copied to the run directory. The process cannot access the file because it is being used by another process. and the...
3
1997
by: John | last post by:
Hi I have a class project which generates a dll which I would like to install in the gac. When I build the project, I get the following error; Unable to build assembly XXX into the Global Assembly Cache; the assembly is not strongly named. What do I need to do to get the assembly strongly named?
1
2833
by: Tom | last post by:
My unsigned DLL works in my project that references it as long as I set Copy Local = true. Now I have signed the DLL with the sn.exe generated keys but have not yet moved the DLL into the GAC. Can I use a strong named DLL outside the GAC with Copy Local = false by providing a reference to the public key? If yes to above, please tell me...
6
5649
by: raylopez99 | last post by:
Anybody use Strong Name Signing? I think this is used by default for Resource files, which is one reason perhaps I can't get my resource files to work (somehow the public key is messed up, perhaps since I've installed so many versions of Visual Studio) RL http://msdn.microsoft.com/en-us/library/h4fa028b.aspx Deployment in Visual Studio
0
7518
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...
0
7444
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...
1
7467
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...
1
5367
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...
0
5085
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 then checking html paragraph one by one. At the time of converting from word file to html my equations which are in the word document file was convert...
0
3497
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The last exercise I practiced was to create a LAN-to-LAN VPN between two Pfsense firewalls, by using IPSEC protocols. I succeeded, with both firewalls in...
0
3478
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
1
1932
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
1054
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

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.