Sunday, February 19, 2012

Custom assembly problems in RS

Hi,
I have a custom assembly that is working just fine in the Preview tab in Report Designer. However, the popup preview is blowing up with the error: Execute permissions cannot be acquired.
I've added a code group (at the top of the code group section) in the rsPreviewPolicy.config, which is residing in the default location. My .dll is in the correct place and functioning, as evidenced by the preview tab success. The .dll is using ADO.net to call a stored proc in an Oracle database.
I added the code group by directly editing the config file; I'm no XML veteran, so I'm not sure if it's configured correctly. The .Net editor tells me it's "well-formed". When it wasn't well-formed, I got an error regarding loading the file, so I'm assuming this isn't the problem.
Any insight would be appreciated.
Doug
--
Posted using Wimdows.net NntpNews Component -
Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine supports Post Alerts, Ratings, and Searching.Did you sign the file using the sn command line tool that comes with VS?
-Lukasz
This posting is provided "AS IS" with no warranties, and confers no rights.
"SqlJunkies User" <User@.-NOSPAM-SqlJunkies.com> wrote in message
news:%23W6pS%23eaEHA.2840@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I have a custom assembly that is working just fine in the Preview tab in
> Report Designer. However, the popup preview is blowing up with the error:
> Execute permissions cannot be acquired.
> I've added a code group (at the top of the code group section) in the
> rsPreviewPolicy.config, which is residing in the default location. My
> .dll is in the correct place and functioning, as evidenced by the preview
> tab success. The .dll is using ADO.net to call a stored proc in an Oracle
> database.
> I added the code group by directly editing the config file; I'm no XML
> veteran, so I'm not sure if it's configured correctly. The .Net editor
> tells me it's "well-formed". When it wasn't well-formed, I got an error
> regarding loading the file, so I'm assuming this isn't the problem.
> Any insight would be appreciated.
> Doug
>
> --
> Posted using Wimdows.net NntpNews Component -
> Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine
> supports Post Alerts, Ratings, and Searching.|||It sounds like you did not assert permissions to open a database connection.
Unless you assert the permission explicitly in the custom assembly code, it
will fail with a security exception.
Example for opening a connection to a SQL Server:
...
SqlClientPermission permission = new
SqlClientPermission(PermissionState.Unrestricted);
try
{
permission.Assert(); // Assert security permission!
SqlConnection con = new SqlConnection("...");
con.Open();
...
}
You might also want to check out these links:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/RSPROG/htm/rsp_prog_rdl_0so6.asp
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cpguide/html/cpconAssert.asp
http://msdn.microsoft.com/library/?url=/library/en-us/dnsql2k/html/dngrfCodeAccessSecurityInSQLServer2000ReportingServices.asp
http://msdn.microsoft.com/library/en-us/RSPROG/htm/rsp_prog_rdl_8wyq.asp
Robert M. Bruckner
Microsoft SQL Server Reporting Services
This posting is provided "AS IS" with no warranties, and confers no rights.
"SqlJunkies User" <User@.-NOSPAM-SqlJunkies.com> wrote in message
news:%23W6pS%23eaEHA.2840@.TK2MSFTNGP11.phx.gbl...
> Hi,
> I have a custom assembly that is working just fine in the Preview tab in
Report Designer. However, the popup preview is blowing up with the error:
Execute permissions cannot be acquired.
> I've added a code group (at the top of the code group section) in the
rsPreviewPolicy.config, which is residing in the default location. My .dll
is in the correct place and functioning, as evidenced by the preview tab
success. The .dll is using ADO.net to call a stored proc in an Oracle
database.
> I added the code group by directly editing the config file; I'm no XML
veteran, so I'm not sure if it's configured correctly. The .Net editor
tells me it's "well-formed". When it wasn't well-formed, I got an error
regarding loading the file, so I'm assuming this isn't the problem.
> Any insight would be appreciated.
> Doug
>
> --
> Posted using Wimdows.net NntpNews Component -
> Post Made from http://www.SqlJunkies.com/newsgroups Our newsgroup engine
supports Post Alerts, Ratings, and Searching.

No comments:

Post a Comment