Solved

How to Rebuild a DLL file when changes done to .CS file

Posted on 2015-01-28
11
480 Views
Last Modified: 2015-02-09
Hi Experts,

Q-1.
I have a .dll file. When I make some changes to the .CS file, the dll do not reflect the changes.  How to rebuild the dll?

Q-2.
My class file name is ImportRPF.  But the dll created is DAL.dll.  How the name dll file name is different?

Please try to help me.  Thank you in advance.
0
Comment
Question by:RadhaKrishnaKiJaya
  • 5
  • 4
  • 2
11 Comments
 
LVL 33

Expert Comment

by:Mike Eghtebas
ID: 40576796
Most likely, your dll is saved as "ImportRDF.dll" somewhere correctly. I located some writing on the web and still trying to get to bottom of it myself. Meanwhile, you can take a look at it yourself to see if it helps:

"if you can set two solutions one for your dll referenced and another for your project that reference them after 1/create a dependencies folder where you will set all binaries that are dll you need 2/set path to this dependencies folder on all your projects that will create dll you want to reference 3/set build order on your solution to first build your dll and after build your project that reference your dll

when you deploy it, make sure that you create dependencie folder

for your information, your application first see on GAC folder (windows\assembly), after see on your current path, and after use PATH environment variable"

http://stackoverflow.com/questions/11807889/where-are-dll-libraries-stored-in-vs-net
0
 
LVL 40
ID: 40576909
Q-1

You rebuild the dll through the Build menu.

Just make sure that the one you use for your test is the one generated by the new compilation. To know where the build is generated, open the projects properties (last entry in the Project menu), go to Build tab and look at the Output path at the bottom of the form.


Q-2

The file name for the class has nothing to do with the name of the dll, because a dll can have many classes.

What defines of the dll, by default, is the project name. But you can change that, in the project's properties once again, by defining a different Assembly name in the Application tab.
0
 

Author Comment

by:RadhaKrishnaKiJaya
ID: 40578054
Hi Jacques Bourgeois,
Thank you for your help!  

I already tried Build and Rebuild Solution options.  When I make changes to my class file, my changes are not reflected.  Whe I I checked the DLL file, I see no change in the time stamp.

In the project --> Properties, I don't see any option to change the DLL name.  Anyways, I don't want to change the name, but just wanted to know.

The most surprising thing is, why my changes are not reflected.  Even Intellisense not able to see the new methods I created in the class file.

Thank you again.
0
Master Your Team's Linux and Cloud Stack!

The average business loses $13.5M per year to ineffective training (per 1,000 employees). Keep ahead of the competition and combine in-person quality with online cost and flexibility by training with Linux Academy.

 
LVL 33

Expert Comment

by:Mike Eghtebas
ID: 40578082
With you class selected, perhaps you need to change Do not copy yo Copy alwaysCopyAlways
0
 
LVL 40
ID: 40578114
What type of project are you working in?

Most dlls are created in a Class Library project, so I assumed that this is what you were talking about. In such a project, you will find the features I have talked about in the Application tab and the Build tab. This might be different if you are in another type of project.

If you do not have this information in the Build tab of the project's properties, simply launch a search for your dll in Windows Explorer. It will list you all the copies it find on your system, with their creation date if you are in Details view.
0
 

Author Comment

by:RadhaKrishnaKiJaya
ID: 40578125
Hi eghtebas,
Thank you!

This is web project I am working on.  What I understand, the Built Action is applicable for Web Applications.

Please see my above reply to Jacques Bourgeois and throw some light if you can.

Thank you!
0
 
LVL 40
ID: 40578162
If you are working alone and develop the dll in parallel with the web site, you can add it to your solution and reference the project instead of the dll itself. This enables you to step into the dll from your application and debug both together when you run your web application, and you always have the latest copy of the to work with.

To do that, first add your dll project to the web application solution through File...Add...Existing Project. You will see your dll project along the web project in the Solution Explorer.

You now have to change the reference. Remove the old reference, and then launch the Reference Manager. You need to reference your dll project, not the dll itself, which can be done in the Solution tab Manager.
0
 

Author Comment

by:RadhaKrishnaKiJaya
ID: 40599433
Thank you Jacques ,
At this point I am very frustrated.  Now discovered another error.  I am not able to goto definition. For example, when I right click on the method name, GetEmployeeInfo and try to goto the definition, it redirects me to a temporary folder C:\User\username\AppData\Local\Temp\5952$DAL.dll$v4.0.30319$NoDynamic\XXX.DAL.EmployeeDetails.cs[metadata], where I can see only the definition.  It does not redirect me to my original folder, which should be DAL.EmployeeDetails.  See the line below.  I just see only this line and definition of other methods.  But no other codes.

public static XmlDocument GetEmployeeInfo(int employeeId);

Please let me know if you have any idea about this issue.

Thank you again!
0
 
LVL 40

Accepted Solution

by:
Jacques Bourgeois (James Burger) earned 500 total points
ID: 40599490
Does this happens with other parts of your code or even in other projects?

When you end up with strange behaviors in a project/solution that do not appear in others, the first thing to try Build...Clean Solution and then recompile the solution. If the code for GetEmployeeInfo is not part of the solution, then do the same in the solution that compiles it.

If this does not solve the problem, then look if you have Warnings in the Error List window. Warnings do not prevent you from compiling, but usually points to factors that can have side effects.

If the problem is not solved at that point, you might try Find All References instead of GoTo Definition. The definition should be somewhere in there.

If this still gives you problems, then, try repairing Visual Studio from the Control Panel Programs applet.

If not, then the ultimate uninstall and reinstall of Visual Studio.
0
 

Author Comment

by:RadhaKrishnaKiJaya
ID: 40600081
Thank you Jacques,
Let me try your steps and I will update you.  Thank you again.
0
 

Author Closing Comment

by:RadhaKrishnaKiJaya
ID: 40600094
Jacques,
I was trying to open the .sln file in the wrong folder, resulting all the problems.  By mistake, the same solution file was in 2 different folders.  Now it is working fine.  

Thank you very much for your help.
0

Featured Post

Master Your Team's Linux and Cloud Stack

Come see why top tech companies like Mailchimp and Media Temple use Linux Academy to build their employee training programs.

Question has a verified solution.

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

Just a quick little trick I learned recently.  Now that I'm using jQuery with abandon in my asp.net applications, I have grown tired of the following syntax:      (CODE) I suppose it just offends my sense of decency to put inline VBScript on a…
Introduction This article shows how to use the open source plupload control to upload multiple images. The images are resized on the client side before uploading and the upload is done in chunks. Background I had to provide a way for user…
Windows 10 is mostly good. However the one thing that annoys me is how many clicks you have to do to dial a VPN connection. You have to go to settings from the start menu, (2 clicks), Network and Internet (1 click), Click VPN (another click) then fi…
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.

816 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

Need Help in Real-Time?

Connect with top rated Experts

12 Experts available now in Live!

Get 1:1 Help Now