Solved

Visual Studio Debugs Old Version of File

Posted on 2011-02-16
5
259 Views
Last Modified: 2012-05-11
I have a C# application in VS 2010 that was migrated a few weeks ago from VS2008.  I made changes to a class about a week ago, and did considerable debugging wihout problem.  Now when I look at the class again, the debugger seems to be going haywire.  When I step through the code, sometijmes the F10 command results in no movement, sometimes the step actually goes backward.  It seems to me I've had this issue some time ago, and it has something to do with the debugger working with an older vsion of the file.  But I don't remember exactly what the issue was.

Is anyone familiar with what's going on here?
0
Comment
Question by:jkavx
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 2
  • 2
5 Comments
 
LVL 22

Expert Comment

by:Snarf0001
ID: 34913039
I've had issues with this before.

Apart from the obvious (you are in fact rebuilding the project on each run), the most common issue I've had is with the temp files caching.
I have no idea why or how this starts, but find the temp asp.net files folder

C:\Windows\Microsoft.NET\Framework\xxx\Temporary ASP.NET Files

and delete everything in there.  Then try rebuilding and running again.
0
 

Author Comment

by:jkavx
ID: 34913667
Thx.  I found this folder but it was empty.
0
 
LVL 3

Expert Comment

by:chandra_darbha
ID: 34913861
Do a clean solution, delete the bin and obj folders and then rebuild the solution.

Thanks,
Chandra
0
 

Author Comment

by:jkavx
ID: 34913982
Thx.  I just tried this - cleaned the solution, deleted the bin and object folders and rebuilt the solution but I have the same debugging problem with this one class.
0
 
LVL 3

Accepted Solution

by:
chandra_darbha earned 500 total points
ID: 34922918
That means, you application is not loading the latest DLL and hence the latest PDB. During the runtime assembly binding, the CLR looks in the GAC first and then the application folders and some standard set of folders. If it finds the DLL in any other place than your bin folder where the DLL would not be the latest one, then you would get this issue. Check in GAC or any other location where the CLR might search for the assembly and update or remove the assembly from that location as appropriate.

If you don't know of any other location and the assembly is not in GAC then you can switch on Fusion logs. These are the assembly binder logs.

You can find information about the binder logs at  
http://msdn.microsoft.com/en-us/library/e74a18c4(v=VS.100).aspx

Hope this helps

Thanks,
Chandra
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Introduction Although it is an old technology, serial ports are still being used by many hardware manufacturers. If you develop applications in C#, Microsoft .NET framework has SerialPort class to communicate with the serial ports.  I needed to…
Summary: Persistence is the capability of an application to store the state of objects and recover it when necessary. This article compares the two common types of serialization in aspects of data access, readability, and runtime cost. A ready-to…
Email security requires an ever evolving service that stays up to date with counter-evolving threats. The Email Laundry perform Research and Development to ensure their email security service evolves faster than cyber criminals. We apply our Threat…

763 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question