Still celebrating National IT Professionals Day with 3 months of free Premium Membership. Use Code ITDAY17

x
?
Solved

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

Posted on 2015-01-28
11
Medium Priority
?
882 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
[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
  • 5
  • 4
  • 2
11 Comments
 
LVL 34

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
Tutorials alone can't teach real engineering

So we built better training tools.

-Hands-on Labs
-Instructor Mentoring
-Scenario-Based Tests
-Dedicated Cloud Servers

All at your fingertips. What are you waiting for?

 
LVL 34

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 2000 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

Basic Security of Your VPC

So, you’ve got this shiny new VPC and a fancy new application configured on your EC2 servers ready to go. This application is only accessible from your computer, which is great for security, but you need your users to be able to access it! So, what’s the easiest way to do this?

Question has a verified solution.

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

More often than not, we developers are confronted with a need: a need to make some kind of magic happen via code. Whether it is for a client, for the boss, or for our own personal projects, the need must be satisfied. Most of the time, the Framework…
This article is for Object-Oriented Programming (OOP) beginners. An Interface contains declarations of events, indexers, methods and/or properties. Any class which implements the Interface should provide the concrete implementation for each Inter…
Do you want to know how to make a graph with Microsoft Access? First, create a query with the data for the chart. Then make a blank form and add a chart control. This video also shows how to change what data is displayed on the graph as well as form…
In this video, Percona Solutions Engineer Barrett Chambers discusses some of the basic syntax differences between MySQL and MongoDB. To learn more check out our webinar on MongoDB administration for MySQL DBA: https://www.percona.com/resources/we…

688 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