How to properly update DLL ref?

B

Brett Romero

I have two projects - one is an EXE and the other a DLL. The EXE
references the DLL. I make a change in the DLL and see the version
number change. .20969 for example. In the EXE, I rebuild and see the
DLL reference has the same version. However, when I run the EXE, I
don't see it using new features of the DLL. For example, I may have
added additional information to a string in the DLL. In the EXE, this
new string isn't coming through. Is there something I need to do for
the EXE to be sure it uses the latest and greatest?

Also, I have two VS.NET IDEs open - one for the EXE project and another
for the DLL. When I try to build the DLL, sometimes I get an error
related to not being able to copy to the output folder because it is in
use by another program. I make sure the EXE is not running. Same
error when building the DLL. I close the EXE project. Same error. I
close the EXE VS.NET IDE. Now the error has gone away. Other times, I
can have the EXE running and still be able to build the DLL. One last
thing, I'm copying local on the DLL in the EXE project.

Any ideas?

Thanks,
Brett
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Brett,

Add both DLL and EXE projects to the same solution. In the EXE reference the
DLL project. Reference it as a Project not the DLL itself.
 
N

Nicholas Paldino [.NET/C# MVP]

Brett,

If you replace the local dll, then it should just use that. Granted,
you won't be able to use new features, but if the general interface is the
same, then whatever results you return from it should be seen.

You aren't storing the dll's somewhere else, are you?
 
B

Brett Romero

These are two different things though. This DLL will be used by other
apps and not specific to this one project. How will adding the DLL
into this project change anything besides debugging?

Also, how do I reference another project rather than a DLL?

Thanks,
Brett
 
S

Stoitcho Goutsev \(100\) [C# MVP]

Brett,

You can add a project to more than one solution. You may have some problems
if you use Vusial Source Safe though. I don't know if VSS has real problem
with this but it pops up a warning.

To add reference to a project rather than to assembly first both projects
needs to be in the same solution then you do the same steps that you do when
adding reference to a dll, but in the "Add Reference" dialog box you click
on the Projects tab.
There you should have listed all the projects in the solution that can be
added as references.


However it should work even if you reference the dll. VS checks that date of
modification of the referenced assemblies and if the bin folder contains
older dlls it will replace them with the newer versions. Make sure though
that you close all running isntances of the application before you compile
otherwise VS won't be able to copy the dlls and you'll run the application
with the old ones.

The version that VS shows for the referenced dll is from the copy in the
dll's original folder not from the application's bin folder.
 
B

Brett Romero

For one project, I'd like to reference the DLL. Whether I use copy
local = true/false, it doesn't update news builds of that DLL. Is
there a way to do this?

Thanks,
Brett
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Similar Threads

How do debugg a .net dll 2
Naming the log4net.config file? 1
application domain 6
Creating an interop dll 1
Missing interop.*.dll 4
DLL Outputg path problem 3
assembly and reuse 7
Mixing 1.1 and 2.0? 1

Top