views:

97

answers:

3

I have a .net 3.5 application that I'm running over an intranet and as far as I know it should "just run" over a mapped drive but I get a SecurityException type "FileIOPermission" this happens when I call

File.Open(mCurrentFile, FileMode.Create, FileAccess.Write, FileShare.Read)

I can create files on the mapped drive so i do have write permissions.. And also the computer is not in a domain..

I know that 2.0 applications did not run from a network but as far as i know 3.5 should do that now could it be that The System dll is v2.0 but there is no v3.5 so I can't change it...

+3  A: 

I think you need to clarify the issue here. I believe you are confusing two different, unrelated things:-

1) Your application encounters an exception when trying to open a network file

2) An application may not be executable if residing on a network share.

It seems from your question that 2) is not an issue sicne you are able to run your app. If so, you should remove references to this from your question.

If indeed, it is only 1) that is your problem, then it would seem to me that the account under which the process is executing does not have permission to read from the specified location. You need to confirm 2 things, a) that the path to the file is correct at the point of execution and b) that the account in which the process is running has the necessary permissions in that location.

AdamRalph
Petoj
Sorry but that last sentence does not make any sense
AdamRalph
+1  A: 

Marc Gravell you told me to try 3.5 sp1 and it did work but i cant mark you answer as the correct as it seems you removed your ansewer...

Petoj
ha lolz :) Marc G. is good - not surprised he picked up the correct answer :) I'll happily take his points :P
Pure.Krome
A: 

There are permission settings for each computer as far as what they will let run in a .NET executable that is run from different places. I believe there are settings for Local Computer, LAN, and Internet. I would try increasing the authority for the LAN...if that doesn't work, try the internet too, just in case. You can find this control tool in the control panel->admin tools on XP, not sure about Vista.

teeks99