I am changing the directory that the temp files are created in when calling information from a soap request (web service) as giving access to windows directories is a no-no per our sys admins.
I've added the following to my web.config:
<system.xml.serialization>
<xmlSerializer tempFilesLocation="C:\\foo" />
</system.xml.serialization>
I am working in VS2010 with .NET 2.0 and C#
My web.config gives me a warning that the 'tempFilesLocation' attribute is not allowed. But per some tutorials and other questions here - I proceeded anyway - it says that C:\foo doesn't have permissions, but it's recognizing the change - so I created a temp directory in the application directory and updated the web.config to point to my appropriate directory:
<xmlSerializer tempFilesLocation="c:\\inetpub\wwwroot\myapplicationdirectory\temp"/>
Then when I run debug (or build->publish) I get the following error:
System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\Windows\TEMP\z7z7l54i.0.cs' could not be found
error CS2008: No inputs specified
at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, XmlSerializerCompilerParameters xmlParameters, Evidence evidence)
at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, XmlSerializerCompilerParameters parameters, Assembly assembly, Hashtable assemblies)
at System.Xml.Serialization.TempAssembly..ctor(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, String location, Evidence evidence)
at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings, Evidence evidence)
at System.Web.Services.Protocols.SoapServerType..ctor(Type type, WebServiceProtocols protocolsSupported)
at System.Web.Services.Protocols.SoapServerProtocol.Initialize()
at System.Web.Services.Protocols.ServerProtocol.SetContext(Type type, HttpContext context, HttpRequest request, HttpResponse response)
at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)
--- End of inner exception stack trace ---
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.ServiceModel.FaultException: System.Web.Services.Protocols.SoapException: Server was unable to process request. ---> System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\Windows\TEMP\z7z7l54i.0.cs' could not be found
error CS2008: No inputs specified
How do I change so it's no longer trying to access the C:\Windows\TEMP directory? I thought that's what the addition to web.config did?
I'm trying to change the directory to somewhere else I can give appropriate level access as needed to create those temp files.