I have made a small app that resides on a server share. It needs to draw
some data from a SQL Server database that resides on yet another server. And
the app should be possible to run from client computers.
When we run it from clients we get the following error: "Request for the
permission of type System.Data.SqlClient.SqlClientPermission, System.Data,
Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089
failed".
I have tried to change the code access security policy on the SQL Server
server by using Microsoft .NET Framework 1.1 Configuration - Increase
Assembly Trust and added the path \\AppServerName\c$\AppFolder\App.exe but I
still get the error when running the app from a client.
What more can I do?
Regards
/Grober
Changing the CAS policy on the server won't help. Your application is being
prevented from connecting to the database because of CAS policy on the
client machines, not on the server. To address this, you will need to
modify the CAS policy on the client machines to grant the necessary
SqlClientPermission to your assembly. See
http://blogs.msdn.com/shawnfa/archive/2003/06/20/57023.aspx for details.
>I have made a small app that resides on a server share. It needs to draw
>some data from a SQL Server database that resides on yet another server.
[quoted text clipped - 14 lines]
> Regards
> /Grober
Grober Myttelson - 27 Sep 2006 15:48 GMT
It's working, thank you, splendid article that explains things in a mode
that is sufficient for me.
Regards
/Grober
> Changing the CAS policy on the server won't help. Your application is
> being prevented from connecting to the database because of CAS policy on
[quoted text clipped - 21 lines]
>> Regards
>> /Grober