Hi!
I have a MVC website in a shared hosting with Medium Trust.
Im trying to delete a file within my own application, but ive got following error.
Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
My host has granted IO-permissions in own application with this in config:
<IPermission version="1" Read="$AppDir$" Write="$AppDir$" Append="$AppDir$" PathDiscovery="$AppDir$"/>
My code is:
Dim file1 As New FileInfo(Server.MapPath("~/" & item.Pic1))
If file1.Exists() Then
file1.Delete()
End If
Anyone has an idea of the Error?
Thanks
...
Go to the complete details ...