1
Vote

Provider Connection Issue

description

I have the following errors when trying to run this SSAS Provider v2.7.0.0 with EF 6.1.3 and SQL SVR 2012.

No Entity Framework provider found for the ADO.NET provider with invariant name 'AgileDesign.SsasEntityFrameworkProvider'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.
I resolved this by putting the following element in the EF Providers section like so:
<entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
  <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
  __<provider invariantName="AgileDesign.SsasEntityFrameworkProvider" type="AgileDesign.SsasEntityFrameworkProvider.SsasProviderFactory, SsasEntityFrameworkProvider, Version=2.7.0.0, Culture=neutral, PublicKeyToken=0c609c2d7c233e82"/>__
</providers>
</entityFramework>

However now I'm getting the following error:
The 'Instance' member of the Entity Framework provider type 'AgileDesign.SsasEntityFrameworkProvider.SsasProviderFactory, SsasEntityFrameworkProvider, Version=2.7.0.0, Culture=neutral, PublicKeyToken=0c609c2d7c233e82' did not return an object that inherits from 'System.Data.Entity.Core.Common.DbProviderServices'. Entity Framework providers must inherit from this class and the 'Instance' member must return the singleton instance of the provider. This may be because the provider does not support Entity Framework 6 or later; see http://go.microsoft.com/fwlink/?LinkId=260882 for more information.

Which is weird because I'm calling CreateForOlap() as shown below but instead of calling that method for the constructor it's calling and bombing on the constructor that take a connection string parameter

static void Main(string[] args)
    {
        var ctx = DWEntities.CreateForOlap();

        var results = ctx.DimCurrencies.Select(c => c.Currency).ToList();

        foreach (var item in results)
        {
            Console.WriteLine(item);
        }
    }
private DWEntities(string nameOrConnectionString)
        : base(nameOrConnectionString)
    {
    }
public partial class DWEntities
{
    public DWEntities()
        : base("name=BergstromBIUKConnex")
    {
    }

    private DWEntities(string nameOrConnectionString)
        : base(nameOrConnectionString)
    {
    }


    //protected override void OnModelCreating(DbModelBuilder modelBuilder)
    //{
    //    modelBuilder.Configurations.Add();
    //}

    public static DWEntities CreateForOlap()
    {
        Database.SetInitializer<Wales1DWEntities>(null);
        return new DWEntities("Name=BergstromBIUKConnexOLAP");
        //"NorthwindEFContextOlap" is a name of your connection string to SSAS.
    }

    public static DWEntities CreateForSql()
    {
        return new DWEntities();
    }
}
Connection String
<connectionStrings>
<add name="BergstromBIUKConnexOLAP" connectionString="Provider=MSOLAP.5;Data Source=172.21.241.201;Initial Catalog=Analysis Services Project1;user id=Admin; password=password;Cube=Indented BOM Ext" providerName="AgileDesign.SsasEntityFrameworkProvider" />
<add name="DWEntities" connectionString="metadata=res:///DataModel.DWModel.csdl|res:///DataModel.Wales1DWModel.ssdl|res://*/DataModel.DWModel.msl;provider=System.Data.SqlClient;provider connection string="data source=172.21.241.201;initial catalog=DW;user id=Admin;password=password;MultipleActiveResultSets=True;App=EntityFramework"" providerName="System.Data.EntityClient" />

</connectionStrings>

comments