views:

299

answers:

4

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?

A: 

Haven't done this but isn't it possible to have a desktop version of the Live Operating Environment? This would seem a good start for troubleshooting.

dove
I can't get it to run in my Vista box yet :(
sebastian
A: 

You can change trust in the web.config, unless that has been disallowed in the machine.config (which it often is in shared hosting). inside your put and see what happens.

If you are not allowed to do that, see if you can get your control GACd by talking to your provider. If that doesn't work, sorry to say but you are out of luck. Sometimes you can find workarounds that don't require full trust for a specific method, but if a third party dll requires it there is not much you can do

Matt Briggs
+1  A: 

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.

sebastian
+1  A: 

I also found a question regarding my same issue and how if was fixed.
Here the link: Lucene.Net fails at my host because it calls GetTempPath(). What’s the work around?

sebastian