Click here to Skip to main content
15,887,888 members
Please Sign up or sign in to vote.
1.00/5 (2 votes)
How to resolve "Request for the permission of type 'System.Net.WebPermission, System, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed." for medium trust levels in IIS, if the trust level is "full" we will not get this error! Please provide me with a solution for this. Many thanks in advance.

What I have tried:

I have tried giving trust level = "Full", this will get resolved
Posted
Updated 16-May-17 2:52am

1 solution

You don't. If the medium trust level is too restrictive, you need to get the hosting company to create and apply a custom policy:
How To: Use Medium Trust in ASP.NET 2.0 ⇒ Step 3. Optionally Create a Custom Policy Based on Medium Trust[^]

There's nothing you can do in your code to work around this. If there was, then there wouldn't be any point in having the trust levels in the first place! :)
 
Share this answer
 
Comments
Member 13065293 24-May-17 0:17am    
true, thanks for the link :)

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month


CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900