Link to home
Start Free TrialLog in
Avatar of kevp75
kevp75Flag for United States of America

asked on

c# Writing to system temp folder?

One of my boss's hosting clients is coming up with an issue on his site.  It seems that whatever web service they are using is causing a permissions issue.  I think they get a list, and export it to XML, and this is where the errors occur.

Can someone point me in the right direction to look through their code?  I don't know C# at all, so any reference to where I should begin looking would help...
Avatar of JimBrandley
JimBrandley
Flag of United States of America image

What is the error?
Avatar of kevp75

ASKER

this is the exact error:

System.InvalidOperationException: Unable to generate a temporary class (result=1).
error CS2001: Source file 'C:\WINDOWS\TEMP\4ir2ueu-.0.cs' could not be found
error CS2008: No inputs specified

   at System.Xml.Serialization.Compiler.Compile(Assembly parent, String ns, CompilerParameters parameters, Evidence evidence)
   at System.Xml.Serialization.TempAssembly.GenerateAssembly(XmlMapping[] xmlMappings, Type[] types, String defaultNamespace, Evidence evidence, CompilerParameters 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, Type type)
   at System.Xml.Serialization.XmlSerializer.FromMappings(XmlMapping[] mappings)
   at System.Web.Services.Protocols.XmlReturn.GetInitializers(LogicalMethodInfo[] methodInfos)
   at System.Web.Services.Protocols.XmlReturnWriter.GetInitializers(LogicalMethodInfo[] methodInfos)
   at System.Web.Services.Protocols.MimeFormatter.GetInitializers(Type type, LogicalMethodInfo[] methodInfos)
   at System.Web.Services.Protocols.HttpServerType..ctor(Type type)
   at System.Web.Services.Protocols.HttpServerProtocol.Initialize()
   at System.Web.Services.Protocols.ServerProtocolFactory.Create(Type type, HttpContext context, HttpRequest request, HttpResponse response, Boolean& abortProcessing)

ASKER CERTIFIED SOLUTION
Avatar of JimBrandley
JimBrandley
Flag of United States of America image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kevp75

ASKER

Ok.  So...how/where/what would I look for in the code to prevent this from trying to dump this file in C:\WINDOWS\TEMP
If you look at the call stack, it appears that there is no user code invoked yet. Try granting write permission to that directory.
Avatar of kevp75

ASKER

can't do it.  Too much of a security risk invloved in letting the users have that kind of access.

There must be something in the code that we can change that will write the file to a different directory rather than the windows\temp directory
I have not been able to locate a way to do that. Leave the question open for a while, and maybe someone else will see it who knows of a way.
I'm going to email another expert asking him to take a peek at this one....

Jim
Avatar of kevp75

ASKER

thanks Jim
He must bee off the air - I'll post a link...
Hi kevp75

Consider using Isolated storage:
http://msdn2.microsoft.com/en-us/library/bdts8hk0.aspx
Avatar of kevp75

ASKER

for some reason I kind of doubt the host would be willing to do that, however I will mention it to him.

So am I to assume that there is nothing code wise to specify the path where this temporary file will be stored?
Avatar of Bob Learned
This sounds like a configuration problem.  Is this ASP.NET 2.0 or 1.1?

Bob
Avatar of kevp75

ASKER

.NET 2.0
Has the hosting company specified custom security attributes for the TEMP directory?

Bob
Avatar of kevp75

ASKER

no.  they are the default
SOLUTION
Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of kevp75

ASKER

sorry for the delay.  You've asked me a question that I cannot answer, and am just waiting on the powers that be to answer....