Solved

Visual Studio Debugs Old Version of File

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

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

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

Suggested Solutions

Title # Comments Views Activity
ASP.NET Web API or ASP.NET Core MVC? 3 52
In C#, how would you convert a byte array to its integer value equivalent? 12 38
ADO.NET ENTITY DATA MODEL 3 32
Host asp.net pages 5 25
This article introduced a TextBox that supports transparent background.   Introduction TextBox is the most widely used control component in GUI design. Most GUI controls do not support transparent background and more or less do not have the…
This article aims to explain the working of CircularLogArchiver. This tool was designed to solve the buildup of log file in cases where systems do not support circular logging or where circular logging is not enabled
This tutorial gives a high-level tour of the interface of Marketo (a marketing automation tool to help businesses track and engage prospective customers and drive them to purchase). You will see the main areas including Marketing Activities, Design …
This is used to tweak the memory usage for your computer, it is used for servers more so than workstations but just be careful editing registry settings as it may cause irreversible results. I hold no responsibility for anything you do to the regist…

895 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

13 Experts available now in Live!

Get 1:1 Help Now