Today I built the most trivial of ASP.NET 2.0 Web applications that called the most trivial of ASP.NET 2.0 Web services. I deployed both to IIS 6.0, and the one wouldn’t call the other. I was getting these, over and over:
Description: 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.
Exception Details: System.Security.SecurityException: Request for the permission of type ‘System.Net.WebPermission, System, Version=220.127.116.11, Culture=neutral, PublicKeyToken=b77a5c561934e089’ failed.
Not very elegant here, but I added this to the web.config of the calling Web site, and it works:
<trust level=”Full” originUrl=””/>