Click to See Complete Forum and Search --> : ERROR!: Security related error... Please help me!


laxatcg1
April 3rd, 2010, 12:47 AM
Let me brief you what I was trying... I work on Visual Studio 2005 / MS-SQL / C#.

The error what I get is:
===================================================
System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
===================================================

Whats this and how I do solve this error?

Thanx & rgds

DataMiser
April 3rd, 2010, 08:16 AM
Where are you trying to write files? Some folders require more access than others.
Have you tried run as administrator?

laxatcg1
April 4th, 2010, 09:53 PM
Thank you for your response.

I was trying to pick up a file from the server folder (using server.mappath) and send as an attachment using asp.net mail.

DataMiser
April 4th, 2010, 10:20 PM
Does your site have file i/o permissions for the folder in question?

laxatcg1
April 5th, 2010, 12:21 AM
Yes and I have even given full permission to the folder and the files.

dglienna
April 5th, 2010, 04:45 PM
Try mapping a folder and using it's drive letter

laxatcg1
April 5th, 2010, 09:14 PM
Thank you for your response...

Yes I have mapped to the complete path including the drive letter...

Cimperiali
April 8th, 2010, 03:10 AM
by the way, you checked out what path\filename you got after server.mappath... to be sure you really got the phisical path and filename you needed?