2

My current default browser is Chrome (dev). I'm using VS2010 and Silverlight4, with ASP.NET MVC3. I don't seem to have the problems with debugging that I've seen others have. My main complaint is that I regularly have to clear my browser cache to get the latest version of my app to show up. Sometimes I have to clear it two or three times. I've taken to changing the background color of certain elements just to be sure whether I've got the actual latest changes.

Are Firefox or IE better in this regard? Is there are trick to make my latest version always appear?

Thomas
  • 3,348
  • 4
  • 35
  • 49

4 Answers4

3

Too lazy to do fiddler.

Seems I hadn't googled very well before, this article seems to be precisely what I wanted http://codeblog.larsholm.net/2010/02/avoid-incorrect-caching-of-silverlight-xap-file

via this discussion which has other options and some useful discussion https://betaforums.silverlight.net/forums/p/11995/449355.aspx

Unfortunately, that part of my project has been on hold for a bit, so I haven't tried it out yet.

Thomas
  • 3,348
  • 4
  • 35
  • 49
1

Like you, I use Chrome for my main browser, and I don't use IE for any regular browsing. But I do use IE for Silverlight development, for this reason and others. I rarely if ever have trouble with the IE cache holding onto outdated versions of my XAP file, but this happens pretty regularly with FireFox and Chrome. In addition, depending on how I closed my previous debug session, when I start up a new one, FireFox and Chrome frequently open up my previous tab(s) in addition to the one that I'm actually trying to debug. Consequently, IE is (for me) the cleanest browser to actually debug with.

This isn't really an answer -- just an observation. Sorry :-).

Ken Smith
  • 20,305
  • 15
  • 100
  • 147
  • This was part of my question, no apologies necessary. How do you get it to spawn into IE on F5? Toggle your default broswer? – Thomas Jan 22 '11 at 14:45
  • Went ahead and toggled the default browser, it's a little annoying when I forget to toggle it back, but the simplicity of it never caching is worth it. Thanks. – Thomas Jan 23 '11 at 22:41
  • I actually leave IE as my default browser, which makes it a little annoying when I'm opening a URL from another application, since it opens in IE. But I leave Chrome with about 10 tabs open on my second monitor, and that's the only browser I use for "real" browsing. It would be nice if Visual Studio let you set whatever browser you want to use, like Eclipse does, rather than taking the OS default. – Ken Smith Jan 24 '11 at 16:56
0

Have you tried investigating why this is happening using Fiddler or a similar HTTP debugging tool? Personally I've never been able to debug Silverlight in Chrome so I usually have to force IE when debugging. But I never have the problem of a stale application. I'd check Fiddler to see if you can isolate the issue. It's probably not directly related to Silverlight.

Josh
  • 68,005
  • 14
  • 144
  • 156
  • I'm not sure how to set that up. I used Chrome's inspection tool and it certainly says it used the cache, which is obvious from the results – Thomas Jan 12 '11 at 23:58
  • It's pretty simple. If you go www.fiddlertool.com and install it, it will set itself to be the default WinInet proxy when it runs and then set it back when you exit. You'll then see the HTTP requests between the client and server. You can use this info to find out why a cached response is being used. – Josh Jan 13 '11 at 00:20
0

Your probleme looks like a lot like a cache configuration issue. The web server is often configurated rather aggressively concerning caching of static files, as the XAP.

So the response header are probably set in a way that maximize browser caching.

You could change the webserver configuration to prevent client side caching of the XAP file.

Don't forget to remove these setting in production, however.

Community
  • 1
  • 1
Eilistraee
  • 8,220
  • 1
  • 27
  • 30
  • In this case, I'm using CassiniDev. I don't see an option for this for it. – Thomas Jan 12 '11 at 23:46
  • What does fiddler have to say about your XAP requests? What are the cache control headers? The options I spoke about are set in the web.config file of your application. I think (but I am not sure) that Cassini will set the right cache headers if you provide it with the right configuration. – Eilistraee Jan 13 '11 at 14:33