0
votes

We are getting this error when invoking methods on a web service call. According to the following post, Error: Unable to generate a temporary class (result=1) ... When Invoking Methods on a Web Service, we just need to give NETWORKSERVICE access to the C:\Windows\TEMP directory. The problem is we are running this app on Windows Azure and I'm not sure how to go about giving the NETWORKSERVICE role access to the directory every time a server cycles or is deployed.

Any ideas on how to make sure NETWORKSERVICE always has access to that directory on Azure?

EDIT: We tried logging into each server remotely and giving the IIS_IUSRS group Full Access permission to the Windows Temp directly and restarted IIS but are still seeing the issue. On Azure, the windows temp directory is actually stored on the D drive so since the exception states it was trying to access C:\Windows\Temp, we did create that directory manually and gave the same group Full Access permission but still it didn't work.

2
Are you using Azure Web Sites, Azure Web Role or Azure Virtual Machine + IIS ?Fabrizio Accatino
We are using VMs + IIS. I can remote into each server and set it manually but if the instance cycles or if I delete that deployment, I'd have to go in and do it again.Nick Olsen
I do not understand what you're doing. Security properties on directory are not volatile. If you allow user X to read/write a directory, the permission remains the same also after system reboot.Fabrizio Accatino
But if we delete the deployment/service role or if the server is re-imaged for whatever reason, that setting wouldn't stick around right?Nick Olsen
Nick, are you sure you're using Virtual Machine? From your response I think your are using Web Role. As I said, on "raw" VM (Iaas) you have full control of your server(s).Fabrizio Accatino

2 Answers

1
votes

To give extended acces in Azure Cloud Services (web or worker roles, add <Runtime executionContext="elevated" /> to your .csdef inside of the <WorkerRole> or <WebRole> node. For example:

<?xml version="1.0" encoding="utf-8"?>
<ServiceDefinition name="blah" xmlns="http://schemas.microsoft.com/ServiceHosting/2008/10/ServiceDefinition" schemaVersion="2012-10.1.8">
  <WorkerRole name="blah" vmsize="Small">
    <Runtime executionContext="elevated" />
    ...      
   </WorkerRole>
</ServiceDefinition>
0
votes

The problem was that the thrid-party web service did not give their C:\Windows\Temp directly the appropriate permissions. Never rule out that it may not be your fault!