Need Help Regarding System.Security.Permissions.FileIOPermission

  • Thread starter Thread starter Usman Ghani
  • Start date Start date
U

Usman Ghani

Hi,
I am trying to develop an activex control with the .Net by exposing an
interface to the com as described in the following article.
http://www.c-sharpcorner.com/Upload...rticleID=99d9681d-84de-4d64-9c85-9ae9c15a4ee7.
This works fine for the simple control which is mentioned in the article.Now
I have to read some files on the client machine through this activex.When I
tried to read a file,I got the following error

"Request for the permission of type
System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0,
Culture=neutral, PublicKeyToken=b77a5c561934e089 failed."

I have googled about it,but could n't find some clear solution.
Can someone help me to get rid of this problem

Thanks,

Usman Ghani
 
It is very likely that your problem is not related to ActiveX controls.
SecurityExceptions are thrown if your code executes in a CAS sandbox and
requires more permissions than it has. There can be many possible reasons:
Your code can be executed in a sandboxed appdomain or it can come from a
partially trusted source. My gut feeling is that your application is started
from a network share, which is a partially trusted source.

Marcus
 
Back
Top