Invalid backend error

3 posts, 0 answers
  1. Javierdj
    Javierdj avatar
    9 posts
    Member since:
    Sep 2006

    Posted 06 May Link to this post

    I'm having the following problem loading the configuration file via BackendConfiguration. I recieve the error:"Invalid backend". Can anyone help me?

    Config File:

    <configSections>
    <section name="openAccessConfiguration" type="Telerik.OpenAccess.Config.OpenAccessConfigSectionHandler, Telerik.OpenAccess" requirePermission="false" />
    </configSections>
     
    <openAccessConfiguration xmlns="http://www.telerik.com/OpenAcessConfiguration">
    <backendConfiguration name="CreditosPreaprobadosConfiguration" connectionTimeout="134" />
    </openAccessConfiguration>

    Context Class:

    using System;
        using System.Linq;
        using Telerik.OpenAccess;
        using Telerik.OpenAccess.Metadata;
     
        public partial class CreditosPreaprobadosContext : OpenAccessContext
        {
            private static MetadataContainer metadataContainer = new CreditosPreaprobadosMetadataSource().GetModel();
            private static BackendConfiguration backendConfiguration = GetBackendConfiguration();
     
            public CreditosPreaprobadosContext(string dbConnection) : base(dbConnection, backendConfiguration, metadataContainer)
            {
            }
     
            public IQueryable<TipoCanales> TipoCanales
            {
                get
                {
                    return this.GetAll<TipoCanales>();
                }
            }
     
            /// <summary>
            /// Devuelve un objeto <see cref="BackendConfiguration"/>
            /// </summary>
            /// <returns></returns>
            public static BackendConfiguration GetBackendConfiguration()
            {
               BackendConfiguration backendConfiguration = new BackendConfiguration()
                {
                    Backend = "CreditosPreaprobadosContext"
                };
     
               BackendConfiguration.MergeBackendConfigurationFromConfigFile(backendConfiguration, ConfigurationMergeMode.ConfigFileDefinitionWins, "CreditosPreaprobadosConfiguration");
     
               return backendConfiguration;
            }
        }

  2. Boris Georgiev
    Admin
    Boris Georgiev avatar
    190 posts

    Posted 11 May Link to this post

    Hello Javier,

    Unfortunately the code snippets which you had sent are not enough to investigate the issue. Although in the config file snippet is missing the "backend" property in the backend configuration, could you try to add it and see if the issue will exists after that? For more information how to configure the OpenAccessContext via Config File you could refer to this documentation article.

    If the issue still exists could you send us the entire config file and the context class?

    I am looking forward to hearing from you.

    Regards,
    Boris Georgiev
    Telerik
     
    Check out the latest announcement about Telerik Data Access vNext as a powerful framework able to solve core development problems.
  3. DevCraft banner
  4. Javierdj
    Javierdj avatar
    9 posts
    Member since:
    Sep 2006

    Posted 12 May in reply to Javierdj Link to this post

    Boris from Telerik help to solve the problem is missing the "backend" property in the backend configuration. Thanks a lot!!!!
Back to Top