Skip to main content

MSDN

Silverlight 3 creates a lot of XCP temp files (20MB each)RSS Feed

(0)

erikloman
erikloman

Member

Member

0 points

4 Posts

Silverlight 3 creates a lot of XCP temp files (20MB each)

Hi all! We are writing a Silverlight 3 management interface for our appliance. A soap client request is made every 5 seconds to update the on-screen runtime values. But with every request Silverlight is writing an XCP*.tmp file of 20.971.520 bytes (20MB!) to the temp folder. Can somebody please explain why Silverlight 3 is creating these huge XCP tmp files in the %temp% folder? And perhaps provide a solution to prevent this from happening? Regards, Erik

Jonathan Shen – MSFT
Jonatha...

All-Star

All-Star

41770 points

4,104 Posts

Microsoft

Re: Silverlight 3 creates a lot of XCP temp files (20MB each)

Hi Erikloman,

For the safety consideration, Silverlight cannot access to the client folders/drivers except the Isolated Storage.  Its default size 1M and we can extend it. 

Best regards,

Jonathan

Jonathan Shen
Microsoft Online Community Support
Please remember to mark the replies as answers if they help and unmark them if they provide no help.

erikloman
erikloman

Member

Member

0 points

4 Posts

Re: Silverlight 3 creates a lot of XCP temp files (20MB each)

I don't thing this has anything to do with Isolated Storage or accessing client folders/drives. When creating a soap request and setting the MaxBufferSize of the Binding to a large value (ex. 20MB) causes Silverlight to write XCP*.tmp files in the %temp% folder for each and every request without cleaning it up until the Silverlight control closes. So if you have 100 requests to update your runtime values UI it easily eats up your hard drive space. Does someone have a solution?

dgonth
dgonth

Member

Member

4 points

4 Posts

Re: Silverlight 3 creates a lot of XCP temp files (20MB each)

I am making frequent SOAP calls in the same way for the same reason as you and I'm seeing the same problem.  I am not setting MaxBufferSize to a large value but I am setting  MaxReceivedMessageSize on the binding to 1024000.

 The idea that a SOAP call in a silverlight app can chew up that much disk space on the users machine (completely ignoring any browser temporary file cache limits) is pretty scary.  I can't believe someone from Microsoft hasn't come back with more information.  The replies to date have not been helpful.

 I did find one workaround that helps.  I was creating a binding and using it to initialize the SoapClient object making the calls.  I would then reuse the SoapClient object.  I found that destroying the SoapClient object and recreating it for each call instead of reusing it causes the tmp files to eventually be destroyed, probably as the SoapClient object or the binding is garbage collected. 

c1johnj
c1johnj

Member

Member

2 points

1 Posts

Re: Silverlight 3 creates a lot of XCP temp files (20MB each)

Another workaround is to call GC.Collect() directly at the end of your async event handler. This will clean up the previously created temp file.

phobos7
phobos7

Member

Member

4 points

8 Posts

Re: Silverlight 3 creates a lot of XCP temp files (20MB each)

I've tested this, reproduced the problem, and proven that calling:

GC.Collect();

does appear to clear up the XCP files.

I've written up my brief findings in a blog post.

markspenser
markspe...

Member

Member

60 points

25 Posts

Re: Re: Silverlight 3 creates a lot of XCP temp files (20MB each)

Introducing Garbage collector will save the disk space and certainly helps application to execute much faster, IMHO.

rockallm
rockallm

Member

Member

2 points

1 Posts

Re: Re: Silverlight 3 creates a lot of XCP temp files (20MB each)

We have a Silverlight application with the same problem. We ensured CloseAsync calls are specified after web service calls throughout the code, and added GC.Collect statements too,  but for users at client PCs, runing on either IE7 or IE8, the XCP* files are still generated.  On some PCs those files do go, on others they remain until IE is closed.  Depending on te disk space free, these PCs are soon dangerously low on disk space (full.)   So we cannot continue to use the application.  Changing the IE settings to not use HTTP 1.1 protocol means that the XCP* files are not generated, but this also stops the web service response messages to the client from being compressed.  In our circumstances, that is also undesirable.
Ideally we need to be able to compress web service responses, and have these decompressed at the client PC in memory, without touching the client PC disk space at all.  What settings are needed to do this, and does the client PC need any particular software?  Any idea what components existing at the PCs would give the different results we are experiencing ?

jony11
jony11

Member

Member

2 points

1 Posts

Re: Silverlight 3 creates a lot of XCP temp files (20MB each)

Hi Friends, I am Cine and I have read your site in a very deep and I would like to appreciate you on this brilliant effort. You have provided some thing so much different that I can't have words for thanks.

  • Unanswered Question
  • Answered Question
  • Announcement