473,696 Members | 1,827 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 9404
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
2982
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 a config file. Metadata in the config file looks like this:
6
5073
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
3188
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
2125
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...
2
3593
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
4814
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 DLL file is locked and cannot be deleted or overwritten This is probably the effect of assigning the...
3
2002
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
2841
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 how to reference the public key within
6
5676
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
8666
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
9145
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers, it seems that the internal comparison operator "<=>" tries to promote arguments from unsigned to signed. This is as boiled down as I can make it. Here is my compilation command: g++-12 -std=c++20 -Wnarrowing bit_field.cpp Here is the code in...
0
9010
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 tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
8880
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
7703
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
6515
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...
0
5857
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 into image. Globals.ThisAddIn.Application.ActiveDocument.Select();...
2
2319
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
1992
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.