473,769 Members | 2,170 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

.NET refuses to update due to dual directories?

Why whenever I create a project in c#, when I compile it, it has got the
resulting executable TWICE in TWO different directories - obj\debug and
bin\debug. WHY?
Sometimes when I'm trying to debug it, when I press F5 the one that's
running is obviously not the same one to the one that i've just made changes
to, as it doesn't seem to update my changes. Why does it do this stupid
behaviour?
Nov 16 '05 #1
2 1232
yes, there are two different directories.

When you are running an EXE, it runs from the bin directory. If you want to
make a reference to an assembly (DLL) from another application, you should
reference the copy in the obj directory.

This is because the bin directory contains the EXE and a copy of every dll
you referenced. If you are making a DLL, then copies of the referenced DLLs
are copied in there as well. If you reference a dll from a bin directory,
and other dlls that you reference are also in that bin directory, your app
will use them instead of picking them up from their own directory. As these
are copies of the dlls, you could end up getting the wrong one.

This means you could make a change to a DLL, recompile just the dll you
changed, then switch over to the EXE to debug your change, and you EXE won't
pick up the change, because you referenced another object in the BIN
directory, and it had made a copy of the old dll, and that's what your app
is referencing.

These directories are on purpose. They are important. Don't confuse them.

On the other hand, if you are making a stand-alone exe, with no assemblies
that you wrote, and you are debugging it, I do not believe that it is
possible for the debugger to be placing a breakpoint in the wrong one...
which is how I interpret your complaint.

Not sure what you mean by referring to VS as "stupid."

I hope this helps,
--- Nick

"Beeeeeves" <beeeeeeeeev@ve s> wrote in message
news:Om******** ******@TK2MSFTN GP12.phx.gbl...
Why whenever I create a project in c#, when I compile it, it has got the
resulting executable TWICE in TWO different directories - obj\debug and
bin\debug. WHY?
Sometimes when I'm trying to debug it, when I press F5 the one that's
running is obviously not the same one to the one that i've just made changes to, as it doesn't seem to update my changes. Why does it do this stupid
behaviour?

Nov 16 '05 #2
> When you are running an EXE, it runs from the bin directory. If you want
to
make a reference to an assembly (DLL) from another application, you should
reference the copy in the obj directory.
OK, thanks - I didn't know this rule!

This is because the bin directory contains the EXE and a copy of every dll
you referenced. If you are making a DLL, then copies of the referenced DLLs are copied in there as well. If you reference a dll from a bin directory,
and other dlls that you reference are also in that bin directory, your app
will use them instead of picking them up from their own directory. As these are copies of the dlls, you could end up getting the wrong one.
So, presumably if you have a DLL project and a main EXE project, then the
DLL project should have its output location set to the 'obj' directory of
the main exe?

This means you could make a change to a DLL, recompile just the dll you
changed, then switch over to the EXE to debug your change, and you EXE won't pick up the change, because you referenced another object in the BIN
directory, and it had made a copy of the old dll, and that's what your app
is referencing.

These directories are on purpose. They are important. Don't confuse them.
On the other hand, if you are making a stand-alone exe, with no assemblies
that you wrote, and you are debugging it, I do not believe that it is
possible for the debugger to be placing a breakpoint in the wrong one...
which is how I interpret your complaint.
I'm pretty sure it is still doing this... I have now got no DLLs and one
main EXE.


Not sure what you mean by referring to VS as "stupid."
I'll do it to those rules and see if it helps. Thanks


I hope this helps,
--- Nick

"Beeeeeves" <beeeeeeeeev@ve s> wrote in message
news:Om******** ******@TK2MSFTN GP12.phx.gbl...
Why whenever I create a project in c#, when I compile it, it has got the
resulting executable TWICE in TWO different directories - obj\debug and
bin\debug. WHY?
Sometimes when I'm trying to debug it, when I press F5 the one that's
running is obviously not the same one to the one that i've just made

changes
to, as it doesn't seem to update my changes. Why does it do this stupid
behaviour?


Nov 16 '05 #3

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

9
5833
by: Tomer Ben-David | last post by:
Hi I have a big j2ee appliction that was so forth run on a single cpu machine. I have tested it on a dual cpu machine, its running much slower (about X3 times slower). I know that synchronize code fragments (indirect ones as well, such as the fact that StringBuffer is synchronized) can make code run slower
3
9630
by: Arthur | last post by:
Hey Everyone, Is this an Oracle bug? Here is my cursor statement: CURSOR tax_portal_cursor IS SELECT * FROM web_payment@remotedb WHERE caps_code IN ( SELECT * FROM TABLE(CAST(l_caps_codes AS myTableType)) ) AND processed_datetime IS NULL
3
10447
by: Mark A Framness | last post by:
Greetings, I am working on a project and we need to write a conversion script to initialize a new field on a table. The number of records on this table is on the order of millions so routine selection and update takes a long time. I am tasked with writing a pl/sql proc that utilizes array processing to update the column.
12
46656
by: Andrew Baker | last post by:
What is the best way to lock an individual row in the following scenerio: --TODO - LOCK THIS ROW -- Return the next id SELECT next_id INTO next_id_out FROM owner.my_id_table WHERE app_id = app_id_in;
2
23694
by: ajay | last post by:
How to write a single update sql statement to update different set of attributes of a table. In other words what will be the value of indicator variables to ignore updates of some attributes in a update statement. e.g. EXEC SQL UPDATE vA:iA vB:iB vC:iC in TABLE 1 where vD = ...
5
2990
by: John Dalberg | last post by:
I am planning to build a server to be used as a SQL Server and web server. Right now I can only use a single box for both. I have read some threads were dual processors are having problems with some parallel queries and the suggestions of having sql server use a single CPU. My budget is limited so I am debating whether to get 2.6G dual xeon 533FSB or dual P4 800FSB (DRR@ ram) or stick with a speedy single cpu. If I get a dual cpu...
10
2735
by: Craig Keightley | last post by:
I have the following array: function showCPUs(){ //name brandID dualCore dualProcessor var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=; var cpuItem=;
1
3601
by: Riley DeWiley | last post by:
I have an UPDATE query that is always setting 0 records. When I cut and paste the SQL into Access and use it, it fails in the same way unless I coerce the date fields to be '=now()', in which case it works. I never get errors, and if I don't try to update the date fields, I always update the expected number of rows (1). When I do date conversion using the same conversion function, then call CRowset::Add() to add a record to the same table,...
3
1600
by: sam | last post by:
Hi.. I'm looking to install dual versions of python 2.3, 2.4 on the same box. I'm trying to figure out if there's something I'm missing, some kind of gotchas that I haven't seen. I'm also trying to figure out how to allow my script to determine which version to use??? Thanks
0
9579
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, people are often confused as to whether an ONU can Work As a Router. In this blog post, we’ll explore What is ONU, What Is Router, ONU & Router’s main usage, and What is the difference between ONU and Router. Let’s take a closer look ! Part I. Meaning of...
0
10035
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven tapestry of website design and digital marketing. It's not merely about having a website; it's about crafting an immersive digital experience that captivates audiences and drives business growth. The Art of Business Website Design Your website is...
1
9981
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 Update option using the Control Panel or Settings app; it automatically checks for updates and installs any it finds, whether you like it or not. For most users, this new feature is actually very convenient. If you want to control the update process,...
0
9850
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 protocol has its own unique characteristics and advantages, but as a user who is planning to build a smart home system, I am a bit confused by the choice of these technologies. I'm particularly interested in Zigbee because I've heard it does some...
0
8862
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, and deployment—without human intervention. Imagine an AI that can take a project description, break it down, write the code, debug it, and then launch it, all on its own.... Now, this would greatly impact the work of software developers. The idea...
1
7396
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new presenter, Adolph Dupré who will be discussing some powerful techniques for using class modules. He will explain when you may want to use classes instead of User Defined Types (UDT). For example, to manage the data in unbound forms. Adolph will...
1
3948
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated we have to send another system
2
3551
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
3
2810
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence can significantly impact your brand's success. BSMN Consultancy, a leader in Website Development in Toronto offers valuable insights into creating effective websites that not only look great but also perform exceptionally well. In this comprehensive...

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.