none
webpart error : Request for the permission of the type System.Security.Permissions.FileIOPermission, mscorlib... failed

    Question

  • Dear all,

    When I have this code : SPWeb web = SPContext.Current.Web  , It's has an error :

    Request for the permission of the type "System.Security.Permissions.FileIOPermission, mscorlib,... " failed

    I don't know why?

    Please help me!

    Thank you very much!

    Tuesday, July 08, 2008 11:05 AM

Answers

  • Typically this is related to trust level in your web.config.  Try to bump it to full trust and see if you still have that issue.  It looks like you are trying to access th file system which is not allowed under the default trust, wss_minimal.

     

    Also make sure your web part has been added to the <safecontrols> section.

     

    Tuesday, July 08, 2008 11:12 AM