Accessing files on a network share

G

Guest

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
 
O

oscar.acostamontesde

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

And why you dont send the file to client when they connect to server,
over http, remoting, tcp? I know is not what you are doing now, but is
a workaround..
Best regards
 
K

Kevin Spencer

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.
 
G

Guest

And why you dont send the file to client when they connect to server,
over http, remoting, tcp? I know is not what you are doing now, but is
a workaround..
Best regards

Hi,

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
 
G

Guest

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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top