Sql – How to give permissions so ASP. NET website can open SQLConnection from a DLL added as a reference to the a project

asp.netdllsql-server-2005

I am trying to open a SQLConnection and this exception occurs:

Description: The application attempted to perform an operation not allowed by the security policy. To grant this application the required permission please contact your system administrator or change the application's trust level in the configuration file.

Exception Details: System.Security.SecurityException: Request for the permission of type 'System.Data.SqlClient.SqlClientPermission, System.Data, Version=2.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089' failed.

The Open() method is called in other DLL that I added as a reference to the project.

I made tests calling the Open() method "inside" the website code and not using other ddl, and it works.

What kind of settings do I need to make in order to use other dlls as reference to my project, and so that dlls can open a SQLConnection or write to the Event Viewer?

This exception only occurs when I deploy the site.

Thanks.

Best Answer

Try putting the DLL in the GAC (Global Assembly Cache) if you're working with WSS.

Related Topic