4

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?

John Saunders
  • 160,644
  • 26
  • 247
  • 397
Bob Wintemberg
  • 3,212
  • 6
  • 34
  • 44

3 Answers3

7

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.

Community
  • 1
  • 1
Massimiliano
  • 16,770
  • 10
  • 69
  • 112
  • that's probably the best option indeed... furthermore, performance will be improved because the serialization assembly won't need to be generated – Thomas Levesque Jul 26 '09 at 16:24
  • I haven't had this problem in quite a while, but the problem would always occur within .NET framework assemblies, not my own assemblies. I believe it was a hosting issue. They moved the web application to a different server a while back and the problem ceased. I wonder if it's just an application pool issue with shared servers with many web applications. – Bob Wintemberg Feb 25 '11 at 19:58
0

The only caveat here is that if generics are involved (e.g., a List < > of your type), it does not seem to be possible to use sgen to pregenerate the serializer assembly.

A workaround for this is to derive from the List < MyType > with your own type, then include this in the pregenerated assembly.

Garrett Hyde
  • 5,409
  • 8
  • 49
  • 55
-1

I could not able to change my project (Previous solution), so I have to find a solution for my customer in customer site and after a long time trying to find a solution by changing Kaspersky antivirus, finally I found the solution. In the IIS right click on Sites and select Add website... and start your site on another port. That is it. Finished!!. yohaaaaa.

user704187
  • 21
  • 2