Thursday, April 12, 2012

System.Net.WebPermission error in deploying a sandbox solution

You have deployed you sandbox solution successfully. And you see this permission error while inserting your web part:
Request for the permission of the type 'System.Net.WebPermission, System, Version 2.0.0.0, Culture-neutral, PublicKeyToken=b77a5c561934e089' failed.

It means that your sandbox solution is trying to access some resources which are not permitted.

Simply, change your Sandbox solution to Farm solution (steps given below) and probably, the error would disappear.

Convert Sandbox solution to Farm solution:
  • Click your project
  • Press F4 (or go to project properties)
  • Change Sandbox Solution to False.

1 comment: