I was writing a Windows Azure ASP.NET MVC application and when making a call to a page I received the following exception:

System.Security.SecurityException: That assembly does not allow partially trusted callers

In my application I’m using Castle Windsor for dependency injection and when trying to resolve a service using:

}

IGravatar gravatar = MvcApplication.Container.Resolve<IGravatar>();

I received this message. To solve things I needed to update the WebRole element in the ServiceDefinitions.csdef file so that enableNativeCodeExecution is enabled.

<WebRole name=”TwitterGravatarMVC” enableNativeCodeExecution=”true”>

I found the solution, detailed above, on the Azure Services Platform Developer Centre forum.

Related posts:

  1. Windows Azure – 503 Service Unavailable
Tagged with:
 
  • http://kozmic.pl Krzysztof Ko?mic

    Alternatively, you could pull the Castle source yourself and enable partially trusted callers (see how_to_build.txt) but it is not supported option and it’s not really advised to use it. Good to know though in case you really need it.

Set your Twitter account name in your settings to use the TwitterBar Section.