System.Security problem
Hi,
I have developed a .NET Windows application. I able to run(Execute) it from the local drive of my PC. If I try to execute it from the from network drives, then it gave the below Exception,
/************************************************** ****
Input directory dose not exists. Do you want to create?(Y/N): y
Error: at System.Security.CodeAccessSecurityEngine.CheckHelp er(PermissionSet grantedSet, PermissionSet deniedSet, Cod
eAccessPermission demand, PermissionToken permToken)
at System.Security.CodeAccessSecurityEngine.Check(Per missionToken permToken, CodeAccessPermission demand, StackCrawlM
ark& stackMark, Int32 checkFrames, Int32 unrestrictedOverride)
at System.Security.CodeAccessSecurityEngine.Check(Cod eAccessPermission cap, StackCrawlMark& stackMark)
at System.Security.CodeAccessPermission.Demand()
at System.IO.Directory.CreateDirectory(String path)
at CSExport.DataExport.Main(String[] args)-Request for the permission of type System.Security.Permissions.FileIOPermi
ssion, mscorlib, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 failed.
Program is terminated!
************************************************** ************/
and the application is Crashing.
This is my code and I know for sure the program throws exception when it triies to create directory.
Please help me in solving this problem by adding code in the
application.
Thanks & Regards,
John
|