web
You’re offline. This is a read only version of the page.
close
Skip to main content

Announcements

No record found.

News and Announcements icon
Community site session details

Community site session details

Session Id :
Microsoft Dynamics CRM (Archived)

SSRS with custom assembly request for permission error

(0) ShareShare
ReportReport
Posted on by

Hello,

I'm testing out a fresh copy of CRM 2015 on-premises with SQL Server 2014 Enterprise on top of Windows Server 2012 R2 and have an issue with SSRS report that uses custom DLL to query SQL server.

I have a blank report with a single textbox and I referenced my assembly in report properties. I'm using textbox expression to return string from my custom assembly (just for testing purpose) and everything works fine until I add these 2 rows before making a query to SQL server:

Dim pSql As New System.Data.SqlClient.SqlClientPermission(Security.Permissions.PermissionState.Unrestricted)
pSql.Assert()

When I try to preview or run it in DebugLocal mode Visual Studio 2012 shows this error:

Request for permission of type 'System.Security.Permissions.SecurityPermission, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKey Token=b77a5c561934e089' failed.

Any other action that doesn't require access to SQL server from assembly works fine. Visual Studio is launched through Run as Administrator...

I tried every solution that I found on Google to solve this but nothing helps yet. I added my assembly to GAC using gacutil -i, turned the firewall off, done everything mentioned in here and in here

CRM, SQL Server and Active Directory domain runs on the same machine. Any suggestions what else should I try?

p.s. I'm testing this because I have a on-premises CRM 2013 that my organization uses for some years and we want to upgrade to CRM 2016. We have a lot of business logic inside custom assemblies so it's crucial for us that this SSRS + custom assembly + SQL server thing works.

*This post is locked for comments

I have the same question (0)
  • Community Member Profile Picture
    on at

    Is someone out there?:)

  • ScottDurow Profile Picture
    23 on at

    Hi,

    Using a custom assembly from SSRS isn't a supported configuration for Dynamics CRM. I've never seen it done before! One of the things I try to avoid is using techniques that won't upgrade easily. Perhaps you could move your reports to outside CRM?

  • Community Member Profile Picture
    on at

    Hi Scott, thanks for response. The thing is that assembly is accessible from SSRS and it works fine unless it tries to do something with SQL. Everything works with our currenct CRM 2013 + SQL Server 2008 + Windows Server 2008 R2 stack. I have a feeling, that there should be some kind of workaround or fix for this. But I'm jus guessing..

    How do you suggest we could move reports to outside?

  • Suggested answer
    ScottDurow Profile Picture
    23 on at

    If you have custom code logic that can't be written in SQL then you could include it in a SQL CLR Assembly - msdn.microsoft.com/.../ms254498(v=vs.110).aspx

    You could then have a custom reporting database that connects to the CRM database using synonyms/linked server.

    That way your SSRS could be a plain stored procedure call and the code would run in SQL rather than SSRS.

    Hope this helps!

  • Community Member Profile Picture
    on at

    That's an interesting approach, thank's for idea.

    Please correct me if I'm wrong, but by doing this, we would need to remake all of the reports almost from scratch. If that's really true, then we must postpone our migration from CRM 2013, because it will cost a large amount of time to rebuild those reports.

Under review

Thank you for your reply! To ensure a great experience for everyone, your content is awaiting approval by our Community Managers. Please check back later.

Helpful resources

Quick Links

Introducing the 2026 Season 1 community Super Users

Congratulations to our 2026 Super Stars!

Meet the Microsoft Dynamics 365 Contact Center Champions

We are thrilled to have these Champions in our Community!

Congratulations to the April Top 10 Community Leaders

These are the community rock stars!

Leaderboard > 🔒一 Microsoft Dynamics CRM (Archived)

#1
ScottDurow Profile Picture

ScottDurow 2

#2
GJones Profile Picture

GJones 1

Last 30 days Overall leaderboard

Featured topics

Product updates

Dynamics 365 release plans