1

I am facing strange problem in Visual Studio 2012. I recently moved from Visual Studio 2010 to Visual Studio 2012 I am using its web development feature with asp.net.

The problem actually is, sometime in debug mode it is not showing the change that I made in my code. The thing is I added some charts and some TextBoxes according to the design which I was asked to make. But It was not updating the change when I open the page I developed from studio in debug mode. Even it was not updating the changes I made to the CSS.

But when I open the page in the web browser directly the changes have actually been made!! But I was not able to see it from the studio's debugger.

I tried to search on MSDN but unfortunately couldn't find anything relevant to the problem I am facing.

Can anyone tell me what's wrong with it?

enter image description here

Community
  • 1
  • 1
SPandya
  • 1,161
  • 4
  • 26
  • 63

1 Answers1

4

Make sure that when you are debugging, your code was compiled with the latest changes. I Recommend:

  1. clean your solution in order to make sure you don't have any leftovers from previous builds
  2. In your configuration manager make sure your project is being built for the configuration you are using. enter image description here
  3. Make sure your code re-compiles before you run it.
    (Tools > Options > Projects and Solutions > Build and Run > Set On Run, when projects are out of date to Always build. Set On Run, when build or deployment error occur to Do not launch). enter image description here
Avi Turner
  • 10,234
  • 7
  • 48
  • 75
  • Thanks, Every-time when I run my code I have the habit of rebuilding the solution. But still clueless.. – SPandya Dec 24 '13 at 05:30
  • @SPandya Are you making sure that the file with the changes is part of the re-build (step 1)? I also recommend cleaning your solution in order to make sure you don't have leftovers from previous builds. – Avi Turner Dec 24 '13 at 05:45
  • Yes I am certain about it. And the changes you suggested are already there in place. – SPandya Dec 24 '13 at 05:48
  • @SPandya how about trying to refresh the browser using [Ctrl + F5](http://stackoverflow.com/questions/385367/what-requests-do-browsers-f5-and-ctrl-f5-refreshes-generate) in order to make sure you do not get a cached copy? – Avi Turner Dec 24 '13 at 05:53
  • No luck..Still stuck :( – SPandya Dec 24 '13 at 06:00
  • @SPandya just for debugging, put a breakpoint on the modified file. is the Breakpoint being hit? – Avi Turner Dec 24 '13 at 06:07
  • @SPandya I'm a bit rusty with ASP, but could it be that you are adding the control in the wrong event? Try adding it in the `Pre render` event, or in the same way/location you created controls that are showing. – Avi Turner Dec 24 '13 at 08:46
  • Actually it didn't work for me.. I still get the old version of my javascript – gayan1991 Aug 11 '15 at 18:39
  • @gayan1991 this does not apply to js files. js is a script is not being compiled and the reason your are getting your old code is probably because it is cached, Try using `Ctrl+F5`. take a look [here](http://stackoverflow.com/questions/385367/what-requests-do-browsers-f5-and-ctrl-f5-refreshes-generate): – Avi Turner Aug 12 '15 at 03:43
  • @AviTurner I'm sorry but after that I found the error. It has to do with chrome. if you disable the cache. chrome updates as well – gayan1991 Aug 12 '15 at 04:57