472,968 Members | 1,679 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 472,968 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 1225
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 thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

0
by: Darren Thomas | last post by:
Hi all, In a C# solution I'm using a C++ makefile project to register my C# assemblies in the GAC and COM+. The C++ project is set to "utility" and I'm using the pre-build step to call the...
6
by: Tom Dacon | last post by:
If you're not putting assemblies in the GAC, but are referencing shared code with copylocal=true into the projects that use them, is there any value to signing the assemblies? In the environment...
8
by: nbaiju | last post by:
Hi, I am building a asp.net application which has satellite assemblies. When building the satellite assemblies dll's from Visual Studio 2003 GUI the application works fine . i.e. the resource...
1
by: Afaq | last post by:
Hi, After adding large number of empty resource files (which will be updated later), we are not able to compile the project. the following is the output of the build process. It fails while...
8
by: Subra Mallampalli | last post by:
Hi, I am trying to use <runtime> section within the web.config file. However, the contents of the <runtime> section seem to be ignored. What am i missing here? Is <runtime> section not used by...
4
by: James | last post by:
I have a VB windows forms application that accesses a Microsoft Access database that has been secured using user-level security. The application is being deployed using No-Touch deployment. The...
2
by: Kevin Frey | last post by:
Is it possible to get c# perform a using statement where the namespace for the using is not specified literally but instead comes from a variable, a token, a predefined value etc. We have...
7
by: Allan Ebdrup | last post by:
How do I get hold of the type when I have a string that represents the type. For example I have the string "OFiR.Recruitment.Department" And I want to get the type called...
3
by: Marco Shaw | last post by:
I've got some C# code to create a custom PowerShell cmdlet with these statements: .... using System.Collections; using System.Collections.Generic; using System.Collections.ObjectModel; .... ...
6
by: =?Utf-8?B?SHVnaA==?= | last post by:
Hi there We are trying to build a C sharp solution in Visual Studio 2005 Professional. We have a number of other assemblies, that do not form part of the solution. Assemblies that do form...
0
by: lllomh | last post by:
Define the method first this.state = { buttonBackgroundColor: 'green', isBlinking: false, // A new status is added to identify whether the button is blinking or not } autoStart=()=>{
2
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 4 Oct 2023 starting at 18:00 UK time (6PM UTC+1) and finishing at about 19:15 (7.15PM) The start time is equivalent to 19:00 (7PM) in Central...
2
by: giovanniandrean | last post by:
The energy model is structured as follows and uses excel sheets to give input data: 1-Utility.py contains all the functions needed to calculate the variables and other minor things (mentions...
4
NeoPa
by: NeoPa | last post by:
Hello everyone. I find myself stuck trying to find the VBA way to get Access to create a PDF of the currently-selected (and open) object (Form or Report). I know it can be done by selecting :...
3
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be using a very simple database which has Form (clsForm) & Report (clsReport) classes that simply handle making the calling Form invisible until the Form, or all...
1
by: Teri B | last post by:
Hi, I have created a sub-form Roles. In my course form the user selects the roles assigned to the course. 0ne-to-many. One course many roles. Then I created a report based on the Course form and...
0
isladogs
by: isladogs | last post by:
The next Access Europe meeting will be on Wednesday 1 Nov 2023 starting at 18:00 UK time (6PM UTC) and finishing at about 19:15 (7.15PM) Please note that the UK and Europe revert to winter time on...
0
NeoPa
by: NeoPa | last post by:
Introduction For this article I'll be focusing on the Report (clsReport) class. This simply handles making the calling Form invisible until all of the Reports opened by it have been closed, when it...
3
by: GKJR | last post by:
Does anyone have a recommendation to build a standalone application to replace an Access database? I have my bookkeeping software I developed in Access that I would like to make available to other...

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.