Solved

Visual Studio Debugs Old Version of File

Posted on 2011-02-16
5
253 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
  • 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

How to run any project with ease

Manage projects of all sizes how you want. Great for personal to-do lists, project milestones, team priorities and launch plans.
- Combine task lists, docs, spreadsheets, and chat in one
- View and edit from mobile/offline
- Cut down on emails

Join & Write a Comment

Bit flags and bit flag manipulation is perhaps one of the most underrated strategies in programming, likely because most programmers developing in high-level languages rely too much on the high-level features, and forget about the low-level ones. Th…
Article by: Najam
Having new technologies does not mean they will completely replace old components.  Recently I had to create WCF that will be called by VB6 component.  Here I will describe what steps one should follow while doing so, please feel free to post any qu…
This video gives you a great overview about bandwidth monitoring with SNMP and WMI with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're looking for how to monitor bandwidth using netflow or packet s…
In this tutorial you'll learn about bandwidth monitoring with flows and packet sniffing with our network monitoring solution PRTG Network Monitor (https://www.paessler.com/prtg). If you're interested in additional methods for monitoring bandwidt…

758 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

Need Help in Real-Time?

Connect with top rated Experts

18 Experts available now in Live!

Get 1:1 Help Now