3

I work on a team building Silverlight apps (version 4). We use SVN and all work on separate parts of the code, and regularly update the project with latest code. The Silverlight app runs from an ASP.NET web app. We are having very frustrating issues when updating our code. It seems like old versions of the XAP are being cached.

Example: Francisco changes the wording of a popup dialog, and commits his changes. A very simple change, what could possibly go wrong? I get the latest code. I see the new code in my IDE (VS2010), and run it. When I view that dialog, it does not have the new wording, even though I can see the new wording in my files. I put a breakpoint on the code right where the change is, but when I run the app, the breakpoint is disabled!

I try Clean build of the Silverlight and the Web host. I kill my local ASP.NET development server. I run the app - same thing! I delete the xap from ClientBin. No good. Each of us on the team are experiencing this issue. Now we occasionally solve it, but are never sure what exactly fixed things, which is not satisfactory.

There must be some setting or something that we are missing. You would think that deleting the ClientBin xap file would solve it, as the new XAP must come from compiling the Silverlight app, right?

If you've seen this problem before and have a real solution, please let me know. (The solution of "format your hard drive and re-install everything" will NOT be accepted!)

Thank you,

Daniel Wiliams

Daniel Williams
  • 8,912
  • 15
  • 68
  • 107

5 Answers5

6

I recommend that you use IE for Silverlight development. See also this answer.

The problem with using Firefox for development is that Firefox runs plugins in a separate process (plugin-container.exe). When launching the debugger, VS doesn't know that Silverlight won't be running from the process it launched, so it doesn't attach to the correct process. The breakpoints in Silverlight code appear not to work because the VS debugger hasn't attached to any process running the Silverlight code.

I believe it's possible to disable the use of the plugin-container.exe process (see, for example, LIMPET235's post here), but that won't fix the apparent caching you're also experiencing.

I used to use Firefox for Silverlight development, but I found that things worked much more smoothly when I switched to using IE.

Community
  • 1
  • 1
Luke Woodward
  • 63,336
  • 16
  • 89
  • 104
  • OMG, that was it. No love for Firefox when debugging silverlight. Well, good thing I'm coming to love IE9. Thank you very much! – Daniel Williams Mar 31 '11 at 20:57
1

couple things to check.

  • Make sure your silverlight project's output path is correct.
  • Make sure your silverlight application has been added to your web app project.
  • Enable silverlight debugging in your web app project.
  • Set the silverlight project as a dependency in your web application's settings
agradl
  • 3,536
  • 2
  • 18
  • 16
  • Silverlight debugging is set, but none of the breakpoints work. They turn into red unfilled circles when I run the app – Daniel Williams Mar 31 '11 at 18:24
  • Try right clicking on the web application project in VS solution explorer and click 'Project Dependencies' then make sure your silverlight project is checked. – agradl Mar 31 '11 at 18:49
1

First of all, could you please check is your .xap file also included into source control? it should not be included..., no need IMHO. Most likely your xap file is set to read only. go to that file location and make ClientBin folder not read only if is.

Sonosar
  • 526
  • 2
  • 12
  • what abot checking is it set to read only? If it is read only then most likely it will not be replaced with new one. removing and adding it again to web project(each web should know what silverlight content it is showing thats why we add mapping to silverlight application that web should show) should help as well. – Sonosar Mar 30 '11 at 10:04
1

I've seen this before the XAP file is cached. Try emptying your browsers cache and then putting a query string on the XAP. So your XAP reference would look something like Foo.xap?1234

Rus
  • 1,827
  • 1
  • 21
  • 32
0

The solution of "format your hard drive and re-install everything" will NOT be accepted!

Format your hard drive and install Linux (:

More to the point, configure the Silverlight Applications tab in the SomeSilverlightApp.Web project to copy the xap file from the SomeSilverlightApp project to the ClientBin folder which shows there by default.

The ClientBin folder is also part of the SomeSilverlightApp.Web project in my case and the xap properties are set to CopyToOutputDirectory: Always so that it also gets deployed.

This is probably not the right solution but it works here and I have not time to try to investigate this weird logic.

pasx
  • 2,718
  • 1
  • 34
  • 26