473,396 Members | 1,865 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,396 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 1239
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: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...

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.