473,386 Members | 1,830 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,386 software developers and data experts.

Why Do Rererences Get Switched?

I have a VS2003 WinForms app with a main project called "Desktop". It
references a DLL I've also created called "DataTransfer".

When setting up the references of Desktop I specifically chose the
DataTransfer.dll file WITHIN DataTransfer\bin\Debug

When I run the project, everything works fine and I can step through the
code of DataTransfer (which runs in a different thread by the way).

But then later on and definitely after a Rebuild the reference gets changed
to point to the DataTransfer.dll in Desktop\bin\Debug. The app still runs
but I can no longer step through the code in DataTransfer.

Why is this happening and how I can prevent it?

--
Robert W.
Vancouver, BC
www.mwtech.com

Jun 7 '06 #1
10 1082
When you compile an assembly, unless you give it a strong name and register
it into the GAC, it will be a "Private" assembly. When you make a reference
to a private assembly, you get a copy of that assembly brought into your
project and that is what your project works off of, not the original. This
is done so that multiple versions of an assembly can be used by different
applications easily.
"Robert W." <Ro*****@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
I have a VS2003 WinForms app with a main project called "Desktop". It
references a DLL I've also created called "DataTransfer".

When setting up the references of Desktop I specifically chose the
DataTransfer.dll file WITHIN DataTransfer\bin\Debug

When I run the project, everything works fine and I can step through the
code of DataTransfer (which runs in a different thread by the way).

But then later on and definitely after a Rebuild the reference gets
changed
to point to the DataTransfer.dll in Desktop\bin\Debug. The app still runs
but I can no longer step through the code in DataTransfer.

Why is this happening and how I can prevent it?

--
Robert W.
Vancouver, BC
www.mwtech.com

Jun 8 '06 #2
Scott,

Thanks for your response. I also just noticed that in the Project
Properties there's a section entitled References Path. One can actually
change the order.

How things got out of order, I do not know, but I just forced the source
folder to the top of the list and now everything works perfectly again!

--
Robert W.
Vancouver, BC
www.mwtech.com

"Scott M." wrote:
When you compile an assembly, unless you give it a strong name and register
it into the GAC, it will be a "Private" assembly. When you make a reference
to a private assembly, you get a copy of that assembly brought into your
project and that is what your project works off of, not the original. This
is done so that multiple versions of an assembly can be used by different
applications easily.
"Robert W." <Ro*****@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
I have a VS2003 WinForms app with a main project called "Desktop". It
references a DLL I've also created called "DataTransfer".

When setting up the references of Desktop I specifically chose the
DataTransfer.dll file WITHIN DataTransfer\bin\Debug

When I run the project, everything works fine and I can step through the
code of DataTransfer (which runs in a different thread by the way).

But then later on and definitely after a Rebuild the reference gets
changed
to point to the DataTransfer.dll in Desktop\bin\Debug. The app still runs
but I can no longer step through the code in DataTransfer.

Why is this happening and how I can prevent it?

--
Robert W.
Vancouver, BC
www.mwtech.com


Jun 8 '06 #3
Why not just the DLL to your solution and reference it through the "Projects"
tab instead of browsing for it? That will also elimenate your problem. When
you Rebuild your solution, you'll always use the latest copy of the DLL.

"Robert W." wrote:
Scott,

Thanks for your response. I also just noticed that in the Project
Properties there's a section entitled References Path. One can actually
change the order.

How things got out of order, I do not know, but I just forced the source
folder to the top of the list and now everything works perfectly again!

--
Robert W.
Vancouver, BC
www.mwtech.com

"Scott M." wrote:
When you compile an assembly, unless you give it a strong name and register
it into the GAC, it will be a "Private" assembly. When you make a reference
to a private assembly, you get a copy of that assembly brought into your
project and that is what your project works off of, not the original. This
is done so that multiple versions of an assembly can be used by different
applications easily.
"Robert W." <Ro*****@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
I have a VS2003 WinForms app with a main project called "Desktop". It
references a DLL I've also created called "DataTransfer".

When setting up the references of Desktop I specifically chose the
DataTransfer.dll file WITHIN DataTransfer\bin\Debug

When I run the project, everything works fine and I can step through the
code of DataTransfer (which runs in a different thread by the way).

But then later on and definitely after a Rebuild the reference gets
changed
to point to the DataTransfer.dll in Desktop\bin\Debug. The app still runs
but I can no longer step through the code in DataTransfer.

Why is this happening and how I can prevent it?

--
Robert W.
Vancouver, BC
www.mwtech.com


Jun 8 '06 #4
Hi There,

I've re-read your first sentence 3 times but don't understand the wording.
Could you rephrase in another way?

--
Robert W.
Vancouver, BC
www.mwtech.com

"rmacias" wrote:
Why not just the DLL to your solution and reference it through the "Projects"
tab instead of browsing for it? That will also elimenate your problem. When
you Rebuild your solution, you'll always use the latest copy of the DLL.

"Robert W." wrote:
Scott,

Thanks for your response. I also just noticed that in the Project
Properties there's a section entitled References Path. One can actually
change the order.

How things got out of order, I do not know, but I just forced the source
folder to the top of the list and now everything works perfectly again!

--
Robert W.
Vancouver, BC
www.mwtech.com

"Scott M." wrote:
When you compile an assembly, unless you give it a strong name and register
it into the GAC, it will be a "Private" assembly. When you make a reference
to a private assembly, you get a copy of that assembly brought into your
project and that is what your project works off of, not the original. This
is done so that multiple versions of an assembly can be used by different
applications easily.
"Robert W." <Ro*****@discussions.microsoft.com> wrote in message
news:84**********************************@microsof t.com...
>I have a VS2003 WinForms app with a main project called "Desktop". It
> references a DLL I've also created called "DataTransfer".
>
> When setting up the references of Desktop I specifically chose the
> DataTransfer.dll file WITHIN DataTransfer\bin\Debug
>
> When I run the project, everything works fine and I can step through the
> code of DataTransfer (which runs in a different thread by the way).
>
> But then later on and definitely after a Rebuild the reference gets
> changed
> to point to the DataTransfer.dll in Desktop\bin\Debug. The app still runs
> but I can no longer step through the code in DataTransfer.
>
> Why is this happening and how I can prevent it?
>
> --
> Robert W.
> Vancouver, BC
> www.mwtech.com
>

Jun 8 '06 #5
I had to re-read it too :) Sorry it's late.

You have your solution that contains your "Desktop" project. Right click
your solution and point to "Add" and then click on "Existing Project".
Browse for your project file for you Data Transfer DLL project file (*.cproj).

Your solution will now have two projects. Now right click your "Desktop"
project and click on "Add Reference". Select the "Projects" tab and it will
list the avaliable projects in your solution. Select the "DataTransfer"
project.

Now everytime you re-compile your solution, Data Transfer will recompile and
it will be copied to your Desktop projects bin directory every time.

When you deploy your application, you can put DataTranser.dll in either the
same directory as Desktop.exe or in the GAC.

"Robert W." wrote:
Hi There,

I've re-read your first sentence 3 times but don't understand the wording.
Could you rephrase in another way?

--
Robert W.
Vancouver, BC
www.mwtech.com

"rmacias" wrote:
Why not just the DLL to your solution and reference it through the "Projects"
tab instead of browsing for it? That will also elimenate your problem. When
you Rebuild your solution, you'll always use the latest copy of the DLL.

"Robert W." wrote:
Scott,

Thanks for your response. I also just noticed that in the Project
Properties there's a section entitled References Path. One can actually
change the order.

How things got out of order, I do not know, but I just forced the source
folder to the top of the list and now everything works perfectly again!

--
Robert W.
Vancouver, BC
www.mwtech.com

"Scott M." wrote:

> When you compile an assembly, unless you give it a strong name and register
> it into the GAC, it will be a "Private" assembly. When you make a reference
> to a private assembly, you get a copy of that assembly brought into your
> project and that is what your project works off of, not the original. This
> is done so that multiple versions of an assembly can be used by different
> applications easily.
>
>
> "Robert W." <Ro*****@discussions.microsoft.com> wrote in message
> news:84**********************************@microsof t.com...
> >I have a VS2003 WinForms app with a main project called "Desktop". It
> > references a DLL I've also created called "DataTransfer".
> >
> > When setting up the references of Desktop I specifically chose the
> > DataTransfer.dll file WITHIN DataTransfer\bin\Debug
> >
> > When I run the project, everything works fine and I can step through the
> > code of DataTransfer (which runs in a different thread by the way).
> >
> > But then later on and definitely after a Rebuild the reference gets
> > changed
> > to point to the DataTransfer.dll in Desktop\bin\Debug. The app still runs
> > but I can no longer step through the code in DataTransfer.
> >
> > Why is this happening and how I can prevent it?
> >
> > --
> > Robert W.
> > Vancouver, BC
> > www.mwtech.com
> >
>
>
>

Jun 8 '06 #6
Thank you for that tip. I had never tried that approach before.

Something strange happened when I did it though. I got over a 1,000 warning
about various system items being defined in multiple places.

Here's an example:

C:\Documents and Settings\Robert Werner\My Documents\Visual Studio
Projects\PocketPollster\Desktop\frmMain.cs(646,37) : warning CS1595:
'System.Drawing.Font' is defined in multiple places; using definition from
'c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Syst em.Drawing.dll'
What would cause this to happen?

Just so you know, Desktop references both DataTransfer and DataObjects.
DataTransfer itself references DataObjects.

I don't know if that's the source of the problem though. It seems like
somehow there's some ambiguity about which System object to reference. But I
am only using the .Net Framework 1.1, having never tried 2.0

Any ideas?

--
Robert W.
Vancouver, BC
www.mwtech.com

"rmacias" wrote:
I had to re-read it too :) Sorry it's late.

You have your solution that contains your "Desktop" project. Right click
your solution and point to "Add" and then click on "Existing Project".
Browse for your project file for you Data Transfer DLL project file (*.cproj).

Your solution will now have two projects. Now right click your "Desktop"
project and click on "Add Reference". Select the "Projects" tab and it will
list the avaliable projects in your solution. Select the "DataTransfer"
project.

Now everytime you re-compile your solution, Data Transfer will recompile and
it will be copied to your Desktop projects bin directory every time.

When you deploy your application, you can put DataTranser.dll in either the
same directory as Desktop.exe or in the GAC.

"Robert W." wrote:
Hi There,

I've re-read your first sentence 3 times but don't understand the wording.
Could you rephrase in another way?

--
Robert W.
Vancouver, BC
www.mwtech.com

"rmacias" wrote:
Why not just the DLL to your solution and reference it through the "Projects"
tab instead of browsing for it? That will also elimenate your problem. When
you Rebuild your solution, you'll always use the latest copy of the DLL.

"Robert W." wrote:

> Scott,
>
> Thanks for your response. I also just noticed that in the Project
> Properties there's a section entitled References Path. One can actually
> change the order.
>
> How things got out of order, I do not know, but I just forced the source
> folder to the top of the list and now everything works perfectly again!
>
> --
> Robert W.
> Vancouver, BC
> www.mwtech.com
>
>
>
> "Scott M." wrote:
>
> > When you compile an assembly, unless you give it a strong name and register
> > it into the GAC, it will be a "Private" assembly. When you make a reference
> > to a private assembly, you get a copy of that assembly brought into your
> > project and that is what your project works off of, not the original. This
> > is done so that multiple versions of an assembly can be used by different
> > applications easily.
> >
> >
> > "Robert W." <Ro*****@discussions.microsoft.com> wrote in message
> > news:84**********************************@microsof t.com...
> > >I have a VS2003 WinForms app with a main project called "Desktop". It
> > > references a DLL I've also created called "DataTransfer".
> > >
> > > When setting up the references of Desktop I specifically chose the
> > > DataTransfer.dll file WITHIN DataTransfer\bin\Debug
> > >
> > > When I run the project, everything works fine and I can step through the
> > > code of DataTransfer (which runs in a different thread by the way).
> > >
> > > But then later on and definitely after a Rebuild the reference gets
> > > changed
> > > to point to the DataTransfer.dll in Desktop\bin\Debug. The app still runs
> > > but I can no longer step through the code in DataTransfer.
> > >
> > > Why is this happening and how I can prevent it?
> > >
> > > --
> > > Robert W.
> > > Vancouver, BC
> > > www.mwtech.com
> > >
> >
> >
> >

Jun 8 '06 #7
Undo the changes you made to the Reference Paths property. In fact, those
should be empty. It sounds like that there could be multiple references to
the same DLL.

"Robert W." wrote:
Thank you for that tip. I had never tried that approach before.

Something strange happened when I did it though. I got over a 1,000 warning
about various system items being defined in multiple places.

Here's an example:

C:\Documents and Settings\Robert Werner\My Documents\Visual Studio
Projects\PocketPollster\Desktop\frmMain.cs(646,37) : warning CS1595:
'System.Drawing.Font' is defined in multiple places; using definition from
'c:\WINDOWS\Microsoft.NET\Framework\v1.1.4322\Syst em.Drawing.dll'
What would cause this to happen?

Just so you know, Desktop references both DataTransfer and DataObjects.
DataTransfer itself references DataObjects.

I don't know if that's the source of the problem though. It seems like
somehow there's some ambiguity about which System object to reference. But I
am only using the .Net Framework 1.1, having never tried 2.0

Any ideas?

--
Robert W.
Vancouver, BC
www.mwtech.com

"rmacias" wrote:
I had to re-read it too :) Sorry it's late.

You have your solution that contains your "Desktop" project. Right click
your solution and point to "Add" and then click on "Existing Project".
Browse for your project file for you Data Transfer DLL project file (*.cproj).

Your solution will now have two projects. Now right click your "Desktop"
project and click on "Add Reference". Select the "Projects" tab and it will
list the avaliable projects in your solution. Select the "DataTransfer"
project.

Now everytime you re-compile your solution, Data Transfer will recompile and
it will be copied to your Desktop projects bin directory every time.

When you deploy your application, you can put DataTranser.dll in either the
same directory as Desktop.exe or in the GAC.

"Robert W." wrote:
Hi There,

I've re-read your first sentence 3 times but don't understand the wording.
Could you rephrase in another way?

--
Robert W.
Vancouver, BC
www.mwtech.com

"rmacias" wrote:

> Why not just the DLL to your solution and reference it through the "Projects"
> tab instead of browsing for it? That will also elimenate your problem. When
> you Rebuild your solution, you'll always use the latest copy of the DLL.
>
> "Robert W." wrote:
>
> > Scott,
> >
> > Thanks for your response. I also just noticed that in the Project
> > Properties there's a section entitled References Path. One can actually
> > change the order.
> >
> > How things got out of order, I do not know, but I just forced the source
> > folder to the top of the list and now everything works perfectly again!
> >
> > --
> > Robert W.
> > Vancouver, BC
> > www.mwtech.com
> >
> >
> >
> > "Scott M." wrote:
> >
> > > When you compile an assembly, unless you give it a strong name and register
> > > it into the GAC, it will be a "Private" assembly. When you make a reference
> > > to a private assembly, you get a copy of that assembly brought into your
> > > project and that is what your project works off of, not the original. This
> > > is done so that multiple versions of an assembly can be used by different
> > > applications easily.
> > >
> > >
> > > "Robert W." <Ro*****@discussions.microsoft.com> wrote in message
> > > news:84**********************************@microsof t.com...
> > > >I have a VS2003 WinForms app with a main project called "Desktop". It
> > > > references a DLL I've also created called "DataTransfer".
> > > >
> > > > When setting up the references of Desktop I specifically chose the
> > > > DataTransfer.dll file WITHIN DataTransfer\bin\Debug
> > > >
> > > > When I run the project, everything works fine and I can step through the
> > > > code of DataTransfer (which runs in a different thread by the way).
> > > >
> > > > But then later on and definitely after a Rebuild the reference gets
> > > > changed
> > > > to point to the DataTransfer.dll in Desktop\bin\Debug. The app still runs
> > > > but I can no longer step through the code in DataTransfer.
> > > >
> > > > Why is this happening and how I can prevent it?
> > > >
> > > > --
> > > > Robert W.
> > > > Vancouver, BC
> > > > www.mwtech.com
> > > >
> > >
> > >
> > >

Jun 8 '06 #8
Robert W. wrote:
Thank you for that tip. I had never tried that approach before.


Project references are the preferred way to reference other assemblies.
Check the following link:

http://msdn.microsoft.com/library/de...ml/tdlg_rm.asp

Look especially at chapter 4, "Managing Dependencies", where it talks
about the advantages of using project references.

Jun 8 '06 #9
Thank you both, gentlemen!

Chris, I read the article you cited. Excellent.

"rmacias", I followed your instructions to a T and learned a lot in the
process. Now I much better understand all the referencing in my app and what
I should look for.

Not a bad start to a Thursday morning ... and even before I finished my
first cup of coffee!

Do you all remember the bad old days before the Internet? I do. With the
help of knowledgeable people like you, programming has become a whole lot
easier (less painful) than it was back then!
--
Robert W.
Vancouver, BC
www.mwtech.com

"Chris Dunaway" wrote:
Robert W. wrote:
Thank you for that tip. I had never tried that approach before.


Project references are the preferred way to reference other assemblies.
Check the following link:

http://msdn.microsoft.com/library/de...ml/tdlg_rm.asp

Look especially at chapter 4, "Managing Dependencies", where it talks
about the advantages of using project references.

Jun 8 '06 #10
You are very welcomed. Glad I can help. Well, I'm only 26, so I grew up as
the Internet was just taking off in the 90's. Although I can't imagine how
anybody got anywhere without Map Quest or Google Maps :)

"Robert W." wrote:
Thank you both, gentlemen!

Chris, I read the article you cited. Excellent.

"rmacias", I followed your instructions to a T and learned a lot in the
process. Now I much better understand all the referencing in my app and what
I should look for.

Not a bad start to a Thursday morning ... and even before I finished my
first cup of coffee!

Do you all remember the bad old days before the Internet? I do. With the
help of knowledgeable people like you, programming has become a whole lot
easier (less painful) than it was back then!
--
Robert W.
Vancouver, BC
www.mwtech.com

"Chris Dunaway" wrote:
Robert W. wrote:
Thank you for that tip. I had never tried that approach before.


Project references are the preferred way to reference other assemblies.
Check the following link:

http://msdn.microsoft.com/library/de...ml/tdlg_rm.asp

Look especially at chapter 4, "Managing Dependencies", where it talks
about the advantages of using project references.

Jun 9 '06 #11

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

Similar topics

5
by: ChronicFatigue | last post by:
Hello My current host has register_globals switched on in their php.ini file. Would it be prudent for me to design code which works when register_globals is switched off in case I switch hosts...
5
by: Paul | last post by:
I want to use sessions to cover myself in case the user switches off cookies so I am passing the session ID manually through a hidden input field. This is what I have so far. index.php page...
1
by: Daniel Polansky | last post by:
I wonder if anyone has experienced a similar problem and knows a remedy. I have switched to Java 1.4.2 on Windows recently and my previously working applet does not work any more: the status line...
3
by: Dilantha Seneviratne | last post by:
Hi Could someone advice me on how I detect if JavaScript is switched off from a browser. thanks
5
by: war_wheelan | last post by:
My trancaction log is 25GB and my database file is 39GB. I just switched to the 'Simple' recovery model from the 'Full' recovery model. When if ever can I expect the size of the transaction log to...
1
by: Rocketman | last post by:
I am trying to find out when i reach the next line when multiline is switched on and i DON'T PRESS ENTER TO GO TO THE NEXT LINE(lines method is there for that purpose). Is there any other method i...
3
by: Greg Stark | last post by:
I haven't seen it mentioned, but I could have missed it. It seems like this kind of thing must be known and probably fixed already? I'm actually still using 7.4 beta 5. IIRC that was the last beta...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
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:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
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...
1
by: Sonnysonu | last post by:
This is the data of csv file 1 2 3 1 2 3 1 2 3 1 2 3 2 3 2 3 3 the lengths should be different i have to store the data by column-wise with in the specific length. suppose the i have to...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
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
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...

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.