views:

1208

answers:

1

I have an ASP.NET 2.0 web application running on a shared server of a well known web hosting provider. Occasionally I seem to be getting errors like this:

Could not find file 'C:\WINDOWS\TEMP\lxnmfrsz.dll'. Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.IO.FileNotFoundException: Could not find file 'C:\WINDOWS\TEMP\lxnmfrsz.dll'.

I've searched around and it seems that this is a common problem. One solution is to clear out the temp folder or restart IIS. Since I don't have access to these things on a server I do not own, those are not really options. I've tried setting the temp directory to a different directory using a directive in web.config, but it still seems to be using the default temp directory. Is there some other way I can change the temp directory and/or resolve this problem?

+3  A: 

If you always serialize the same type, you can try pre-generating XmlSerializer binaries using sgen.exe. In that case XmlSerializer won't go searching for them.

Yacoder
that's probably the best option indeed... furthermore, performance will be improved because the serialization assembly won't need to be generated
Thomas Levesque