|
dev
newsgroups
|
|||||||||||||||||||||||
|
|||||||||||||||||||||||
Accessing files on a network shareI'm Writing a smart-client application, when running both server and client on the same machine everthing works fine, but running the client on a different machine get me into trouble. I have written a very simple application just to figure out what goes wrong. The only ting it does is start up the gui and read a file located inn the same directory as the server. The server is a windows 2003, and .net framework 2.0. The error I get: Request for the permission of type 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. What I've tried to do is give the server a strong name, add it to the .net configuration with full trust and add the .exe-file to c:\windows\assemby folder. The public key of that folder matches that of sn -T <server.exe>. Still I'm getting the same errormessage. y.s. lars arve On Feb 28, 9:47 am, lasabo <las***@discussions.microsoft.com> wrote:
Show quote > Hi, And why you dont send the file to client when they connect to server,> > I'm Writing a smart-client application, when running both server and client > on the same machine everthing works fine, but running the client on a > different machine get me into trouble. I have written a very simple > application just to figure out what goes wrong. The only ting it does is > start up the gui and read a file located inn the same directory as the > server. The server is a windows 2003, and .net framework 2.0. > > The error I get: > Request for the permission of type > 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, > Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. > > What I've tried to do is give the server a strong name, add it to the .net > configuration with full trust and add the .exe-file to c:\windows\assemby > folder. The public key of that folder matches that of sn -T <server.exe>. > Still I'm getting the same errormessage. > > y.s. > lars arve over http, remoting, tcp? I know is not what you are doing now, but is a workaround.. Best regards > And why you dont send the file to client when they connect to server, Hi,> over http, remoting, tcp? I know is not what you are doing now, but is > a workaround.. > Best regards > > Yes, this would be a workaround, but I need to set up the right permissions, my next task is to read from a webserver, and this also failes, with the error: Request for the permission of type 'System.Net.WebPermission, System, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. y.s. lars arve The user account under which the application runs must have permission to
read files in the folder it is reading the file from. This would be a domain account, unless you're using a workgroup, in which case it must be an account with the same name and password as an account on the target machine with the necessary permissions. This can also be done via impersonation. -- Show quoteHTH, Kevin Spencer Microsoft MVP Software Composer http://unclechutney.blogspot.com I had the same problem once. Fixed it using the same solution. "lasabo" <las***@discussions.microsoft.com> wrote in message news:5A808A58-0A84-4122-93E2-4B75A06F1A92@microsoft.com... > Hi, > > I'm Writing a smart-client application, when running both server and > client > on the same machine everthing works fine, but running the client on a > different machine get me into trouble. I have written a very simple > application just to figure out what goes wrong. The only ting it does is > start up the gui and read a file located inn the same directory as the > server. The server is a windows 2003, and .net framework 2.0. > > The error I get: > Request for the permission of type > 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, > Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. > > What I've tried to do is give the server a strong name, add it to the .net > configuration with full trust and add the .exe-file to c:\windows\assemby > folder. The public key of that folder matches that of sn -T <server.exe>. > Still I'm getting the same errormessage. > > y.s. > lars arve Hi,
It turned out I've been misstaken on where to set the full trust, I've been adjusting the server, while it was on the client the security had to be set. I ran a etherealtrace and it turned out with no activity towards the server as the error arised. Everything works as a charm now :) Thanks to everybody for great input :) y.s. lars arve Show quote "Kevin Spencer" wrote: > The user account under which the application runs must have permission to > read files in the folder it is reading the file from. This would be a domain > account, unless you're using a workgroup, in which case it must be an > account with the same name and password as an account on the target machine > with the necessary permissions. This can also be done via impersonation. > > -- > HTH, > > Kevin Spencer > Microsoft MVP > Software Composer > http://unclechutney.blogspot.com > > I had the same problem once. Fixed it using the same solution. > > "lasabo" <las***@discussions.microsoft.com> wrote in message > news:5A808A58-0A84-4122-93E2-4B75A06F1A92@microsoft.com... > > Hi, > > > > I'm Writing a smart-client application, when running both server and > > client > > on the same machine everthing works fine, but running the client on a > > different machine get me into trouble. I have written a very simple > > application just to figure out what goes wrong. The only ting it does is > > start up the gui and read a file located inn the same directory as the > > server. The server is a windows 2003, and .net framework 2.0. > > > > The error I get: > > Request for the permission of type > > 'System.Security.Permissions.FileIOPermission, mscorlib, Version=2.0.0.0, > > Culture=neutral, PublicKeyToken=b77a5c561934e089' failed. > > > > What I've tried to do is give the server a strong name, add it to the .net > > configuration with full trust and add the .exe-file to c:\windows\assemby > > folder. The public key of that folder matches that of sn -T <server.exe>. > > Still I'm getting the same errormessage. > > > > y.s. > > lars arve > > > |
|||||||||||||||||||||||