Solved

In VB.Net, is it possible to rename a dll and reference it with new name?

Posted on 2013-05-13
6
781 Views
Last Modified: 2013-05-14
Hi Experts.   In VB.Net, is it possible to rename a dll, reference it in your program with the new name and then use it in the normal way?   I have tried it and it seems to work OK.   I'm just wondering if there is some reason why it might fail at some point.  Thanks for your help.
0
Comment
Question by:PNRT
  • 2
  • 2
  • 2
6 Comments
 
LVL 9

Expert Comment

by:skipper68
ID: 39162878
Although possible, if you didn't build the dll, I would recommend against re-naming it.  It may work today, but next year when a microsoft update breaks and you can't figure out why, it may cause you headaches to find out that renaming is no longer supported.  Just a thought.

Of course, if you have the code, just rebuild it and redeploy the dll file.
0
 
LVL 9

Expert Comment

by:skipper68
ID: 39162881
If it is a .NET dll, open the source code project in Visual Studio.  In the Menu Bar, click on Project -> [Project name] Properties.  Click the 'Application' tab on the left-hand side, and change the Assembly name and Root Namespace as you please.

the Assembly name is the file name for the DLL, and Root Namespace is the namespace path of the code in the DLL (e.g., what you would have to type if using an Imports (VB) or using (C#) statement).  Note that if you change the Root Namespace, you will have to change your current code that accesses this DLL.

After changing those, simply save the project and rebuild it, then add the new DLL as a reference in your other project(s).
0
 
LVL 2

Author Comment

by:PNRT
ID: 39163751
Hi, thanks for your replies. With your second answer, I cant actually open the dll in VS so I'm assuming that's what I should do if I have the source code?   I don't so I suppose the only way would be to try and decompile it?
0
Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering as a way of saying thank you for being a part of the community.

 
LVL 83

Expert Comment

by:CodeCruiser
ID: 39164233
Are you renaming the dll FILE and then referencing that file? In that case, I don't see any problem.
0
 
LVL 2

Author Comment

by:PNRT
ID: 39164250
Hi, yes I am renaming a original dll file and then referencing that dll by the new name in my program.   I was just wondering if that would cause a problem
0
 
LVL 83

Accepted Solution

by:
CodeCruiser earned 500 total points
ID: 39164342
It should not cause any issues generally speaking.
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

A while ago, I was working on a Windows Forms application and I needed a special label control with reflection (glass) effect to show some titles in a stylish way. I've always enjoyed working with graphics, but it's never too clever to re-invent …
It was really hard time for me to get the understanding of Delegates in C#. I went through many websites and articles but I found them very clumsy. After going through those sites, I noted down the points in a easy way so here I am sharing that unde…
This video shows how to use Hyena, from SystemTools Software, to bulk import 100 user accounts from an external text file. View in 1080p for best video quality.
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

830 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question