Security violations when running on a network drive

D

Dom

In my C++ and VB days, it was easy to put a program on a network
drive, and allow each user to shortcut to it. Then, when needed, I
could just update the program on the network drive, and each user
automatically had it the next time they ran it.

Sometimes seems to be happening in CSharp. Now I get the error:

"Request for the permission of type
'System.Data.SqlClient.SqlClientPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=<...>' failed."

Is there a work around here, or is this really a question for an XP
group? I'm reduced to emailing programs to users, but I need to munge
the ".exe" to ".exe_X", and let the users rename it. Some are not
comfortable with this.

Dom
 
P

parez

In my C++ and VB days, it was easy to put a program on a network
drive, and allow each user to shortcut to it. Then, when needed, I
could just update the program on the network drive, and each user
automatically had it the next time they ran it.

Sometimes seems to be happening in CSharp. Now I get the error:

"Request for the permission of type
'System.Data.SqlClient.SqlClientPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=<...>' failed."

Is there a work around here, or is this really a question for an XP
group? I'm reduced to emailing programs to users, but I need to munge
the ".exe" to ".exe_X", and let the users rename it. Some are not
comfortable with this.

Dom

SqlClientPermission probably means that your program doesnt have the
right credentials to access the DB.
Check the connection string..
 
P

parez

SqlClientPermission probably means that your program doesnt have the
right credentials to access the DB.
Check the connection string..

if thats not the probem, that this could fx it..

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol -q -machine -
addgroup 1 -url file://s:/Applicatoin/Some.exe FullTrust -name "My
App"
 
D

Dom

if thats not the probem, that this could fx it..

C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\caspol -q -machine -
addgroup 1 -url file://s:/Applicatoin/Some.exe  FullTrust -name "My
App"- Hide quoted text -

- Show quoted text -

Thanks for the two suggestions. I'd like to see if I can fix it in
the connection string. Here is the one I am using:

"Data Source=<Server>; Initial Catalog=<Database>; User ID=sa;
Password=; Connection Timeout=60"

Am I leaving something important out? The "sa" and no password is
done on my "test server".

Dom
 
I

Ignacio Machin ( .NET/ C# MVP )

In my C++ and VB days, it was easy to put a program on a network
drive, and allow each user to shortcut to it.  Then, when needed, I
could just update the program on the network drive, and each user
automatically had it the next time they ran it.

Sometimes seems to be happening in CSharp.  Now I get the error:

"Request for the permission of type
'System.Data.SqlClient.SqlClientPermission, System.Data,
Version=2.0.0.0, Culture=neutral, PublicKeyToken=<...>' failed."

Is there a work around here, or is this really a question for an XP
group?  I'm reduced to emailing programs to users, but I need to munge
the ".exe" to ".exe_X", and let the users rename it.  Some are not
comfortable with this.

Dom

Hi,

If you give full trust to the local network your problems might be
solved.

One question though, does this error happen always or just some times?
 
D

Dom

Hi,

If you give full trust to the local network your problems might be
solved.

One question though, does this error happen always or just some times?- Hide quoted text -

- Show quoted text -

Always, at least for the program in question. Of course, if I write a
program that does not access the server, this error won't occur, and I
assume no other error will either.

Dom
 
I

Ignacio Machin ( .NET/ C# MVP )

Always, at least for the program in question.  Of course, if I write a
program that does not access the server, this error won't occur, and I
assume no other error will either.

Dom- Hide quoted text -

- Show quoted text -

Give the local network full trust and see what happen
 

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