Remove the strong name attribute from an assembly

J

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
 
G

Guest

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
 
N

Nicholas Paldino [.NET/C# MVP]

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?
 
N

Nicholas Paldino [.NET/C# MVP]

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.
 
A

Alberto Poblacion

Nicholas Paldino said:
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.
 
?

=?windows-1252?Q?Arne_Vajh=F8j?=

Alberto said:
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
 
A

Alberto Poblacion

Arne Vajhøj said:
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.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top