0
votes

I have a application its working fine in my local system but when i run the same code in server its giving the exception as

System.Security.SecurityException: Request for the permission of type 'System.Web.AspNetHostingPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

I had tried unblock security of the dll but this has not solved my problem. Please provide me a solution

1
It is most probably related wihth the asp.net trust level settings of the server. You need to check about trust levels of your server : msdn.microsoft.com/en-us/library/wyts434y%28v=vs.100%29.aspxJean
if you are using a shared hosting service.your hosting provider must be able to answer this.chamara

1 Answers

0
votes

I solved this problem using caspol.exe:

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol.exe -m -ag 1 -url "file:////c:/wwwroot/intepub/MyApp/bin/*" FullTrust -exclusive on

Replace: c:/wwwroot/intepub/MyApp/bin/* with the path of your DLLs.

Reference