471,325 Members | 1,741 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,325 software developers and data experts.

using assemblies

Hello!

Assume I have two projects. In the first one I build the assembly test.exe
and in the second one I build the class library myLibrary.dll
This test.exe is using the class library called myLibrary.dll so I have a
reference to this class library.

Normally when I build this test.exe the class library myLibrary.dll. is
copied to the local directory where the assembly test.exe is located.

But now to my question if I delete the myLibrary.dll in the folder where
test.exe is located and then just run the test.exe without
rebuilding the test.exe the class library is copied to the folder where the
test.exe is located.

So is this normal that a run of a program cause a copy of a dll.
For me this was a surprise because I thought that I had to rebuild to have
my class library
copied to the folder where the test.exe is located.

//Tony
Aug 29 '08 #1
5 1169
Tony Johansson formulated the question :
Hello!

Assume I have two projects. In the first one I build the assembly test.exe
and in the second one I build the class library myLibrary.dll
This test.exe is using the class library called myLibrary.dll so I have a
reference to this class library.

Normally when I build this test.exe the class library myLibrary.dll. is
copied to the local directory where the assembly test.exe is located.

But now to my question if I delete the myLibrary.dll in the folder where
test.exe is located and then just run the test.exe without
rebuilding the test.exe the class library is copied to the folder where the
test.exe is located.

So is this normal that a run of a program cause a copy of a dll.
For me this was a surprise because I thought that I had to rebuild to have
my class library
copied to the folder where the test.exe is located.

//Tony
How do you run that "test.exe"?
- doubleclick on the filename: that shouldn't copy the dll
- (Ctrl+)F5 from within Visual Studio: that still does a build

Hans Kesting
Aug 29 '08 #2
On Aug 29, 8:50*am, "Tony Johansson" <johansson.anders...@telia.com>
wrote:
Hello!

Assume I have two projects. In the first one I build the assembly test.exe
and in the second one I build the class library myLibrary.dll
This test.exe is using the class library called myLibrary.dll so I have a
reference to this class library.

Normally when I build this test.exe the class library myLibrary.dll. is
copied to the local directory where the assembly test.exe is located.

But now to my question if I delete the myLibrary.dll in the folder where
test.exe is located and then just run the test.exe without
rebuilding the test.exe the class library is copied to the folder where the
test.exe is located.

So is this normal that a run of a program cause a copy of a dll.
For me this was a surprise because I thought that I had to rebuild to have
my class library
copied to the folder where the test.exe is located.

//Tony
From the IDE, when you press F5 the IDE does the process (or the steps
that are neeeded) to compile & run the app, one of these steps is copy
the references that are included, are not part of the framework (or
more exactly that are marked as copy local) as well as any other file
marked as content.
Aug 29 '08 #3
On Aug 29, 7:50 am, "Tony Johansson" <johansson.anders...@telia.com>
wrote:
Assume I have two projects. In the first one I build the assembly test.exe
and in the second one I build the class library myLibrary.dll
This test.exe is using the class library called myLibrary.dll so I have a
reference to this class library.
The others have answered your question, but I wanted to point out one
thing. If you have control of both project, then you should not be
referencing the .dll in your .exe project. Instead, you should use a
project reference. In other words, reference the project, not
the .dll.

Chris
Aug 29 '08 #4
Hello!

What advantages does that give ?

//Tony
"Chris Dunaway" <du******@gmail.comskrev i meddelandet
news:de**********************************@m73g2000 hsh.googlegroups.com...
On Aug 29, 7:50 am, "Tony Johansson" <johansson.anders...@telia.com>
wrote:
Assume I have two projects. In the first one I build the assembly
test.exe
and in the second one I build the class library myLibrary.dll
This test.exe is using the class library called myLibrary.dll so I have
a
reference to this class library.

The others have answered your question, but I wanted to point out one
thing. If you have control of both project, then you should not be
referencing the .dll in your .exe project. Instead, you should use a
project reference. In other words, reference the project, not
the .dll.

Chris

Aug 29 '08 #5
On Aug 29, 9:39 am, "Tony Johansson" <johansson.anders...@telia.com>
wrote:
Hello!

What advantages does that give ?

//Tony

"Chris Dunaway" <dunaw...@gmail.comskrev i meddelandetnews:de******************************** **@m73g2000hsh.googlegroups.com...
On Aug 29, 7:50 am, "Tony Johansson" <johansson.anders...@telia.com>
wrote:
Assume I have two projects. In the first one I build the assembly
test.exe
and in the second one I build the class library myLibrary.dll
This test.exe is using the class library called myLibrary.dll so I have
a
reference to this class library.
The others have answered your question, but I wanted to point out one
thing. If you have control of both project, then you should not be
referencing the .dll in your .exe project. Instead, you should use a
project reference. In other words, reference the project, not
the .dll.
Chris
Read this article:

http://msdn.microsoft.com/en-us/library/ms998239.aspx

The content has been around awhile, but I believe it is still valid.

Chris
Aug 29 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

8 posts views Thread by Subra Mallampalli | last post: by
2 posts views Thread by Kevin Frey | last post: by
3 posts views Thread by Marco Shaw | last post: by
6 posts views Thread by =?Utf-8?B?SHVnaA==?= | last post: by
reply views Thread by rosydwin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.