14

Have recently upgraded to Visual Studio 2013 Pro and am having some teething problems.

Primarily if I change any HTML or CSS in either a .aspx page for Web Forms or .cshtml for MVC, the changes aren't always reflected on the page I'm working on when I debug it and don't appear not matter how times I refresh or clear my cache.
Am using web essentials, which should put the changes straight on the page with have to refresh the page but this doesn't seem to be working either.

Also occasionally, but not always, if I stop debugging, change the code behind then run the project again it says it's running from a different version of the code than the one being debugged and I have to stop it, rebuild and then debug.

Have never had these problems on previous version of Visual Studio.

Any suggestions?

csharpwinphonexaml
  • 3,659
  • 10
  • 32
  • 63
HuwD
  • 1,800
  • 4
  • 27
  • 58
  • you need to mark your project to be compiled in the dropdown in the toolbar (Configuration Manager). – balexandre Apr 14 '14 at 15:27
  • did you ever find a solution to this? I have tried all the things listed in the answers – Ryand.Johnson Dec 21 '16 at 14:46
  • @Ryand.Johnson It was a long time ago but I believe I used the answer provided by Rebo lavo in the end. Other thing to look out for is to make sure your definitely running in Debug. I find Visual Studio 2015 swaps me over to Release mode when I do a publish and I have to switch it back if I want to continue to debug any further changes. – HuwD Dec 22 '16 at 10:42

8 Answers8

21

Go to Tools-Options

Under Projects and solution -> Build and Run select "Always build" under "On Run, when projects are out of date"

enter image description here

huMpty duMpty
  • 14,346
  • 14
  • 60
  • 99
  • Cool, seems to be behaving itself now. Weird that isn't the default. Thanks – HuwD Apr 14 '14 at 15:52
  • 1
    Actually may have been a little premature. The source code is building properly now but .aspx and .cshtml changes are still not updating? – HuwD Apr 14 '14 at 16:06
  • @HuwD: I had similar issue, but doing this it was sorted. Have you tried the this which balexandre mentioned in the comment? – huMpty duMpty Apr 14 '14 at 16:08
  • 2
    Configuration manager has build selected for debug but don't see an option for compile. Only way I've found to get it show up to date code is select "Clean Solution" from the build menu – HuwD Apr 14 '14 at 16:14
  • 4
    This answer has nothing to do with the problem. – reaz Jun 05 '15 at 14:09
9

I had the same issue today. I already had that setting on (Always Build). Cleaning & rebuilding the solution didn't do the trick. I looked under C:\Windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\ and I found a folder named root with a lot of temporary hexa-numeric named folders. Only one folder had today's date. I closed all VS 2013 windows and removed that folder. After I restarted VS 2013 I simply run the project and my changes are now back.

boggy
  • 3,674
  • 3
  • 33
  • 56
  • Insane. This was my last hope and you saved me. Thank you! – BossWalrus Mar 16 '15 at 03:37
  • I'm having the same issue, where whenever I have made changes to the controller it doesn't take effect and I have tried this method but nothing seems to change – Sue Sep 12 '17 at 18:15
  • I see it create the folder root in 2 different folders framework & framework64 – Sue Sep 12 '17 at 18:22
1

I just spent the past hour trying every answer and none of them worked. I simply cleared the cache on the browser I was using to debug (google chrome) and it updated my changes. This question had the correct answer: visual studio not updating html / javascript to server / browser

kay
  • 356
  • 1
  • 4
  • 18
0

I was experiencing old code in the debugger with a console application calling a DLL. I believe it was occurring because the previous version of the DLL was installed in the Global Assembly Cache (GAC), and the Visual Studio debugger was calling the DLL in the GAC (Which had the old code) instead of the current version. I uninstalled the DLL from the GAC and the problem was resolved.

Uninstall an assembly from the GAC (MSDN)

Chris Koester
  • 492
  • 4
  • 9
0

I had this issue and tried all the Build config changes etc without success. I'm running VS2015 in a Parallels VM and saving the project on a drive on the Mac. It appears that there is some odd/tiny difference between the Mac time stamps and the Win10 clock.

Setting the Win10 clock back 5 seconds resolved the issue. Bizarre but saved my sanity...

Rich Freeman
  • 1,009
  • 2
  • 9
  • 22
  • This worked temporarily. I'd been using the Mac Dropbox that Parallels let me access as an external drive. When I Ioaded Dropbox natively onto the WinVM this problem went away. Incidentally build times improved too, which was nice. – Rich Freeman Feb 16 '17 at 07:40
0

I had a similar issue and found the solution by checking the path of the virtualDirectory for your sites that are found within your applicationhost.config file.

Typically located here: C:\Users{your user name}\Documents\IISExpress\config

You want to make sure the physical path for both locations are the same since sometimes they get wonky when working on various branches/projects etc.

Stephen Kennedy
  • 20,585
  • 22
  • 95
  • 108
0

for my case, I tried all the before mentioned answers but nothing worked. and then I went to the system logs and found a hint about failure in loading IIsexpress for the running application. I changed the port that the application used and voila! everything is back to normal. thought this might help someone

Yomna Mahmoud
  • 11
  • 1
  • 1
-2

it's not a bug at all, and has nothing to do with the above answers.

Go to solution explorer and click on --> sync with active document. as shown bellow: enter image description here

rebo lavo
  • 179
  • 1
  • 2
  • 13
  • 13
    This option just synchronized the solution explorer to highlight the active document. This doesn't affect how changed files are served by the development server. – AggieEric Jul 26 '16 at 12:26