473,326 Members | 2,813 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,326 software developers and data experts.

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 9369
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.com

"Jo" <jo@microsoft.comwrote in message
news:ej*************@TK2MSFTNGP06.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.com

"Peter Bromberg [C# MVP]" <pb*******@yahoo.yabbadabbadoo.comwrote in
message news:B2**********************************@microsof t.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.comwrote in
message news:ek**************@TK2MSFTNGP06.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.comwrote in
message news:ek**************@TK2MSFTNGP06.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.dkwrote in message
news:46***********************@news.sunsite.dk...
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
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...
6
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...
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...
2
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
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....
3
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...
1
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. ...
6
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...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 6 Mar 2024 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM). In this month's session, we are pleased to welcome back...
0
by: jfyes | last post by:
As a hardware engineer, after seeing that CEIWEI recently released a new tool for Modbus RTU Over TCP/UDP filtering and monitoring, I actively went to its official website to take a look. It turned...
1
by: PapaRatzi | last post by:
Hello, I am teaching myself MS Access forms design and Visual Basic. I've created a table to capture a list of Top 30 singles and forms to capture new entries. The final step is a form (unbound)...
1
by: CloudSolutions | last post by:
Introduction: For many beginners and individual users, requiring a credit card and email registration may pose a barrier when starting to use cloud servers. However, some cloud server providers now...
1
by: Defcon1945 | last post by:
I'm trying to learn Python using Pycharm but import shutil doesn't work
1
by: Shællîpôpï 09 | last post by:
If u are using a keypad phone, how do u turn on JavaScript, to access features like WhatsApp, Facebook, Instagram....
0
by: af34tf | last post by:
Hi Guys, I have a domain whose name is BytesLimited.com, and I want to sell it. Does anyone know about platforms that allow me to list my domain in auction for free. Thank you
0
by: Faith0G | last post by:
I am starting a new it consulting business and it's been a while since I setup a new website. Is wordpress still the best web based software for hosting a 5 page website? The webpages will be...
0
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 3 Apr 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 former...

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.