locked
Load operation failed for query 'GetAuthenticationInfo' error after adding Syncfusion ReportViewer control to HTML Client... RRS feed

  • Question

  • Hi All,

    I have recently added Syncfusion ReportViewer control to my HTML Client, and now after deployment I get

    "Load operation failed for query 'GetAuthenticationInfo'. Unable to load one or more of the requested types. Retrieve the LoaderExceptions property for more information." when trying to open Desktop Client.

    I've read a lot about this error message and nothing seems to apply to me. I think that the problem may be caused by some routing issues in Global.asax. The moment I delete bit of code related to ReportViewer from Global.asax, delete SSRSReportConroller.cs file and re-deploy the application, everything starts working back again.

    My project contains the following:

    - Global.asax:

    using System;
    using System.Web.Routing;
    using System.Web.Http;
    
    namespace LightSwitchApplication
    {
        public class Global : System.Web.HttpApplication
        {
            
            protected void Application_Start(object sender, EventArgs e)
            {
    
                //Part responsible for permissions
                RouteTable.Routes.MapHttpRoute("PermissionsApi", "UserPermissions/{controller}");
    
    
                //part responsible for ReportViewer
    
                System.Web.Http.GlobalConfiguration.Configuration.Routes.MapHttpRoute(
                name: "DefaultApi",
                routeTemplate: "api/{controller}/{action}/{id}",
                defaults: new { id = RouteParameter.Optional });
           }
           
        }
    }

    The following line of code had been in the file before I added Syncfusion's bit. This code is needed for permissions controller:

     RouteTable.Routes.MapHttpRoute("PermissionsApi", "UserPermissions/{controller}");

    Here is the permissions controller I'm referring to "UserPermissionsController.cs":

    using System;
    using System.Collections.Generic;
    using System.Linq;
    using System.Net;
    using System.Net.Http;
    using System.Web.Http;
    using Microsoft.LightSwitch.Server;
    using Microsoft.LightSwitch.Security;
    using Microsoft.LightSwitch.Security.Server;
    using LightSwitchApplication;
    
    
    namespace LightSwitchApplication.UserPermissions
    {
        public class UserPermissionsController : ApiController
        {
            public Dictionary<string, Boolean> Get()
            {
                Dictionary<string, Boolean> permissions = new Dictionary<string, Boolean>();
    
                using (ServerApplicationContext context = ServerApplicationContext.CreateContext())
                {
                    var currentUser = context.Application.User;
    
                    if (currentUser.IsAuthenticated)
                    {
                        permissions.Add(Permissions.SecurityAdministration, currentUser.HasPermission(Permissions.SecurityAdministration));
    
                        currentUser.AddPermissions(Permissions.SecurityAdministration);
    
                        foreach (Permission permission in context.DataWorkspace.SecurityData.Permissions)
                        {
                            if (permission.Id != Permissions.SecurityAdministration)
                            {
                                permissions.Add(permission.Id, currentUser.HasPermission(permission.Id));
                            }
                        }
                    }
                }
                return permissions;
    
            }
    
        }
    }

    Syncfusion is using the following controller "SSRSReportController.cs":

    using Syncfusion.EJ.ReportViewer;
    using Syncfusion.Reports.EJ;
    using System.Collections.Generic;
    using System.Web.Http;
    
    
    namespace LightSwitchApplication.Api
    {
        public class SSRSReportController : ApiController, IReportController
        {
            //Post action for processing the rdl/rdlc report
            public object PostReportAction(Dictionary<string, object> jsonResult)
            {
                return ReportHelper.ProcessReport(jsonResult, this);
            }
    
            //Get action for getting resources from the report
            [System.Web.Http.ActionName("GetResource")]
            [AcceptVerbs("GET")]
            public object GetResource(string key, string resourcetype, bool isPrint)
            {
                return ReportHelper.GetResource(key, resourcetype, isPrint);
            }
    
            //Method is called when initialize the report options before start processing the report
            public void OnInitReportOptions(ReportViewerOptions reportOption)
            {
                reportOption.ReportModel.ReportServerCredential = new System.Net.NetworkCredential("SSRSuser", "password");
                reportOption.ReportModel.DataSourceCredentials.Add(new DataSourceCredentials("DataSource", "SQLUser", "password"));
            }
    
            //Method is called when reported is loaded
            public void OnReportLoaded(ReportViewerOptions reportOption)
            {
                //Report options here
            }
        }
    }

    Everything works perfectly fine in Visual Studio 2013, but when I deploy the app, I am unable to open Desktop client and permissions in HTML client don't seem to work. That is why I suspect Global.asax configuration. Does what I did there look ok, or perhaps I messed it up completely? 

    Thanks a lot in advance!



    • Edited by l3ulky Wednesday, July 27, 2016 4:37 PM
    Wednesday, July 27, 2016 4:35 PM

Answers

  • Hi Angie,

    Thanks for your reply.

    I have been fighting with this problem for more than a week. Today I woke up and something came to my mind. I've immediately tried it and it worked!!!

    The problem was being caused by the fact that some of the references (.dll) were not copied to the server during deployment. I've changed all of them from top to bottom to "Copy local - true" and magically 'GetAuthenticationInfo' error went away.

    This is really frustrating, because there were no errors during build / compilation process. All diagnostics at the server side were not showing anything etc. Weird, but I'm glad it is working now. Hopefully this post will save someone else's time...

    Thanks!

    Regards,

    Tom

    • Marked as answer by l3ulky Monday, August 1, 2016 6:32 AM
    Monday, August 1, 2016 6:31 AM

All replies

  • Hi,

    Please check whether you miss any steps during create  create your ReportViewer project in LightSwitch HTML, here is a reference:  How to create your first ReportViewer in LightSwitch HTML

    Secondlu, a list of common problems you need check that users can run into that result with the "GetAuthenticationInfo" error: List of LS deploy issues

    hope it helps.

    Regards,

    Angie


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Friday, July 29, 2016 2:48 AM
  • Hi Angie,

    Thanks for your reply.

    I have been fighting with this problem for more than a week. Today I woke up and something came to my mind. I've immediately tried it and it worked!!!

    The problem was being caused by the fact that some of the references (.dll) were not copied to the server during deployment. I've changed all of them from top to bottom to "Copy local - true" and magically 'GetAuthenticationInfo' error went away.

    This is really frustrating, because there were no errors during build / compilation process. All diagnostics at the server side were not showing anything etc. Weird, but I'm glad it is working now. Hopefully this post will save someone else's time...

    Thanks!

    Regards,

    Tom

    • Marked as answer by l3ulky Monday, August 1, 2016 6:32 AM
    Monday, August 1, 2016 6:31 AM
  • Congratulations! Glad that you have solved this issue by yourself. : )

    Best regards,

    Angie


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    Tuesday, August 2, 2016 6:36 AM