Could not find file "C: \ WINDOWS \ TEMP \ xxxx.dll

Here is what I tried:

  • Change the directory where the temporary files are stored. (Changes locally on each website).
  • Store the XMLSerialization object in a global variable and use this instead of creating a new one each time.
  • Delete all temporary files in the temp windows folder.
  • Set permissions in the Windows \ temp folder (I set them every time for everyone to try to solve the problem).

My setup is as follows:

IIS7 for a dedicated Windows 2008 server. The website is written in ASP.NET using Delphi. I have several XML files that require serialization, and not just one. My site talks about a web service and processes XML (I assume this is the part that breaks everything)

Are there any suggestions other than those listed? I read about using SGEN to precompile a serialization object, but will this work for more than one XML file? I really don't know much about this.

Here is an example:

This is the code for one of my XML files. StockXMLSer is stored globally, and after testing only once is created for each site.

function IntGetSTOCK_ITEMS(S: TStream): STOCK_ITEMS; begin if not Assigned(StockXMLSer) then begin StockXMLSer := XmlSerializer.Create(STOCK_ITEMS.ClassInfo); OutputDebugString('StockXMLSer Serializer Created'); end; Result := STOCK_ITEMS(StockXMLSer.Deserialize(S)); end; 
+6
serialization iis-7 delphi xml-serialization
source share
3 answers

You will need to add some parameters to your code so that you can debug the serialization code. See the following article about msdn.

Fix common problems with the XmlSerializer

There is also a neat trick that will save the files created in your temp folder so you can see what is happening.

Under normal circumstances, the XmlSerializer removes the source C # files for serialization classes when they are no longer needed. There is an undocumented diagnostic switch, however, XmlSerializer deletes to leave these files on your disk. You can install include the application .config file:

 <?xml version="1.0" encoding="utf-8" ?> <configuration> <system.diagnostics> <switches> <add name="XmlSerialization.Compilation" value="4" /> </switches> </system.diagnostics> </configuration> 

With this switch present in the .config file, the C # source files remain in your temporary directory. If you are working on a computer running Windows 2000 or newer, the default location for the directory is temp \ Documents and Settings \\ LocalSettings \ Temp or \ Temp, for Internet applications running under ASPNET Account. C # files are easy to skip because they look very strange, randomly generated file names, something like: bdz6lq-t.0.cs. XmlSerializerPreCompiler sets this diagnostic switch, so you can open files to check the lines for which XmlSerializerPreCompiler reported compilation errors in Notepad or Visual Studio.

+4
source share

XML serialization creates a temporary DLL with serialization code in it, somewhere in the temp directory. This loads into your application domain when creating the serializer. Perhaps you delete this DLL when you clean the Temp directory, and for some reason it does not recover correctly.

+2
source share

Just for the record, I had an error like this and found a solution from this blog

After setting permissions in the TEMP folder, the functionality with which this error started working again.

+2
source share

All Articles