Search code examples
asp.netazuresecurityexceptioncloud-platform

SecurityException in ASP.net application


I have a web app which queries a Lucene index and it works just fine in a W2K3 server in my network. Now I got my azure code so I wanted to test the service uploading the app. In order to do that I had to install Vista (I did it in a Virtual machine) cause the Azure SDK won't install on an XP box.

I created my Cloud Service, added the files from my app but when I run it (just F5) I get a SecurityException, when I call Lucene to query the index, saying:

The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

I've been googling around and the solutions I've found concern modifying the machine.config file which is something I won't be able to do "in the cloud".

Could anybody help on this?


Solution

  • Ok, in case somebody is facing the same issues, this is the correct answer which I got from the Azure forum:

    This is because of the trust policy for the Windows Azure CTP. The enviroment variablies TEMP and TMP are avaliable and set up appropiately. However, System.IO.Path.GetTempPath and System.IO.GetTempFile do not work as they require unrestricted environment permissions. I would suggest you contact the Lucene developers to see if they can modify the code so it runs properly in medium trust environments.

    Thanks to Daniel C. Wang for the answer.