|
-
May 14th, 2007, 05:22 PM
#1
Thread Starter
Hyperactive Member
[2.0] System.Security.SecurityException
Hi,
I've developed an application that reads data from a CSV file. All is fine when I access the file on my local PC, the one I developed it on.
The problem is that if I try and access a file on a networked PC using a network share I receive the following error: -
************ Exception Name ************
System.Security.SecurityException
**************** Source ****************
mscorlib
*************** Message ****************
Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.
I've checked all I can think of e.g. user permission and rights, I can see the file from the PC giving me the error and open it and save it.
Does anyone have any ideas where to start or what this message means?
Regards
-
May 14th, 2007, 07:53 PM
#2
Re: [2.0] System.Security.SecurityException
My guess is that this is a .Net permissions issue. You need to explicitly grant your app the right to run from a network share. You can use the .Net 2.0 Framework configuration app to add it by hand.
-
May 15th, 2007, 03:27 AM
#3
Thread Starter
Hyperactive Member
Re: [2.0] System.Security.SecurityException
Hi,
Thanks for the reply.
The thing is my application isn't running from a network share.
It's stand alone on another PC trying to access the file to read, which is on a network share.
Regards
-
May 15th, 2007, 08:09 AM
#4
Re: [2.0] System.Security.SecurityException
Is it running as a service or just a normal desktop app?
-
May 15th, 2007, 12:54 PM
#5
Thread Starter
Hyperactive Member
Re: [2.0] System.Security.SecurityException
Hi,
Just as a normal app. I now know it's not my code, as I tried it on a different PC and it works fine, so it must be the configuration of the PC, but what?
The PC throwing up the exception is using a user with the same name & password and is in the Administrator group. I can see the share from that PC and open and save the file through notepad.
All looks the same, don't you just love Micro****e!!!
Any ideas or help would be much appreciated.
Regards
-
May 15th, 2007, 04:22 PM
#6
Re: [2.0] System.Security.SecurityException
Is it an XP SP2 machine? Is the builtin firewall blocking your app from talking to the network?
Try disabling the firewall and see if it works. If it does, reenable the firewall and add your app to the firewall exceptions.
-
May 15th, 2007, 05:34 PM
#7
Thread Starter
Hyperactive Member
Re: [2.0] System.Security.SecurityException
Hi,
I'm sure I did that and it made no difference, but will try it again.
The app I developed is actualy a 'Plug-In' for an application and the app using the plug-in works fine with the firewall running, I will look at it again though.
Regards,
Posting Permissions
- You may not post new threads
- You may not post replies
- You may not post attachments
- You may not edit your posts
-
Forum Rules
|
Click Here to Expand Forum to Full Width
|