Solved

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

Posted on 2013-05-13
6
816 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
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 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
Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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

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 …
Introduction As chip makers focus on adding processor cores over increasing clock speed, developers need to utilize the features of modern CPUs.  One of the ways we can do this is by implementing parallel algorithms in our software.   One recent…

738 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