Resolution in Visual Studio 2008 Reports

I have successfully added a custom assembly by adding it to the report using AddTrustedCodeModuleInCurrentAppDomain. I am running a report in the current application.

When I try to access SQL, I get Reporting Services System.Data.SqlClient.SqlClientPermission failed.I tried adding System.Datato trusted assemblies as above, but that does not help.

How can I guarantee that this permission is present?

+3
source share
3 answers

Due to an error, it sounds like your user credentials are lost. What kind of authorization do you use?

Windows, "". , . , . .

!

+1

?

ReportViewer Visual Studio 2008 . . . , , . System.Data.SqlClient.

Windows Forms, , . , , , . SqlConnection, GetCommand() , :

[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."
} System.Security.SecurityException 

, , , CLR, SQL Server ASP.Net. ( ), SqlConnection, , -, :

System.Data.SqlClient.SqlClientPermission(System.Security.Permissions.PermissionState.Unrestricted).Assert();
+1

. System.Security.Policy.Evidence ( , ) LocalReport .

reportViewer.LocalReport.ExecuteReportInCurrentAppDomain(System.Reflection.Assembly.GetExecutingAssembly().Evidence);
+1

Source: https://habr.com/ru/post/1697564/


All Articles