I have developed an application using .net 3.5 and have deployed it as an .exe on a number of machines with the same environment. However, on one particular machine I get th
You Need to give the permission to the temp folder which is in windows folder. And Your Problem is Solved...........
You need to add *IIS_IUSR* user with read write permission to C:\Windows\Temp folder.
NOTE: Everyone user will not work with full control.
XML Serialisation works by generating code to perform the serialisation. This is done in a temporary assembly created for that purpose the first time it is needed.
However this relies on being able to write the assembly to disk.1
Your options are either to (1) given the user account which is running the process write permission (for an ASP.NET application this is likely to be a bad idea). (2) Use the SDK tool (sgen.exe) to pre-generate (at development/compile time) the serialisation assembly, and then use (and deplot) that assembly.
1Open question: the APIs exist to create assemblies dynamically in memory: why not do that?
the APIs exist to create assemblies dynamically in memory: why not do that?
Just a wild guess: I assume this possibility did not exist yet in .NET 1.0, or at least when the XmlSerializer was created and MS doesn't like changing existing behavior...
I just spent a lot of time searching for the answer to this so I thought I'd add it here to save some headache for others. If you use the xsd.exe tool to generate your cs it may have added double arrays [][] where an array should be []. Replace all [][] with [] in your generated cs file and retry.
Give Read/Write Privileges to 'C:\WINDOWS\TEMP' folder. It will work.