I have a very simple custom assembly written in C# using VS2017 that is being deployed to Microsoft SQL Server Reporting Services Version 13.0.4435.0 running with SQL Server 2016 (SP1-CU3) (KB4019916) on a Windows 10 box.
Below is the C# code for this "Hello World" custom assembly:
Namespace MyCustomAssembly
{
public class HellowWorldClass
{
public static string HellowWorld()
{
return "Hello World!";
}
}
}
Microsoft describes a step-by-step process for deploying a Custom Assembly:
https://learn.microsoft.com/en-us/sql/reporting-services/custom-assemblies/deploying-a-custom-assembly
Following the steps in the process, the first thing that I discovered is that the Report Designer default directory was different. After trying various folders, the destination that worked was the following:
C:\Program Files (x86)\Microsoft Visual Studio\2017\Professional\Common7\IDE\CommonExtensions\Microsoft\SSRS
After depositing the custom assembly DLL in this directory, the report preview worked as expected. This provided verification that the expression in the report textbox was defined correctly.
In accordance with the process, to deploy the custom assembly on the server the DLL should be placed in the following destination, adjusted for the specific SSRS version:
C:\Program Files\Microsoft SQL Server\MSRS13.MSSQLSERVER\Reporting Services\ReportServer\bin
The process then describes steps that extend the permissions of the custom assembly but this simple example should not require that. Execution permission should be sufficient. Therefore modification of rssrvpolicy.config should be unnecessary.
When I attempt to deploy the report to the serer by right clicking on the report in the Solution Explorer of VS2017 and selecting "Deploy", I get the following message (and only this text):
The definition of the report '/HelloWorldReport' is invalid.
If I remove the textbox containing the reference to the HelloWorld function in the custom assembly, the report deploys successfully to the server. So while there is no further information available in the message about why the report is invalid, it appears to be associated with the custom assembly on the server.
Here is what I have tried:
None of the above efforts worked.
I can share the RDL file or other material that might help identify the problem but I don't believe that the issue is with the report definition because the report will deploy if the references to the functions within the custom assembly are removed. And I don't believe that the issue is with the custom assembly because the preview works within the VS2017 environment. Is has to be something with the server but the error message is very opaque.
This is the first time that I have reached out to the SO community. I'm generally reserved and somewhat hesitant. Yet the experience of others has proven valuable to get by past development challenges and I am grateful. But I am really stumped this time. No one seems to have had this exact experience that I can find and I have searched exhaustively. I have little concern if the solution turns out to be a simple oversight or some basic ignorance that is worthy of ridicule. I just need a solution with what seems to be a non-problem for others.
One solution that worked is to use Report Manager to add the report rather than deploy from Visual Studio.