Click here to Skip to main content
15,911,531 members
Please Sign up or sign in to vote.
4.00/5 (1 vote)
See more:
How to include new vb codes into a existing dll. The source code of dll was not available with us
Posted
Comments
Sergey Alexandrovich Kryukov 28-May-14 1:32am    
Why?
By the way, "namespace or class" sounds gibberish. Class is some code, but namespace is not. This is just a part of the top-level type name.
—SA
BBG112 28-May-14 1:37am    
I need to differ dll access through different namespace. I need this because while i share dll with multiple application. Resources were locked inside the dll.
Sergey Alexandrovich Kryukov 28-May-14 1:47am    
Again, namespaces are irrelevant and cannot effect any functionality. However, I answered your question in full, please see.
—SA

1 solution

There is no a way to do it without modifying the DLL file. Such things are System.Reflection.Emit and CodeDOM allow to create code during runtime and add it to your current process in the same runtime, but this code should be the whole new assembly or a so called dynamic method, not the type.

Now, the question probably assumes that the DLL in question is some valid .NET assembly. More exactly, it could be one of the assembly modules, most likely, just the only main module of some assembly. If so, you can easily (if it does not include some protection) reverse engineer it, add new code in source code and build it again. The excellent open-source tool for that is ILSpy:
http://en.wikipedia.org/wiki/.NET_Reflector[^] (see other products in this article),
http://www.ilspy.net/[^].

However, make sure this action is legitimate. All legal consequences of possible illegal use of the assembly which comes without source code is your sole responsibility. In most domains of legislation such things are legal under certain conditions, but you should be careful about that.

—SA
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900