WCF + EF5 + Oracle issue! Cannot connect when deploying WCF service. RRS feed

  • Question

  • Good morning y'all!

    I'm getting a problem here that's making me nuts!!! 

    When I execute locally my service, everything works perfectly...but when I deploy my WCF to the server, well, it gives me an exception with something about the ProviderManifestToken string.

    One particular thing about my environment is that I connect my EF project with Oracle's library And as far as I can see, it's not so common people connecting this way.

    Well, bellow I'll show my web.config and the exception that's thrown:


    <?xml version="1.0" encoding="utf-8"?>
    <!-- For more information on Entity Framework configuration, visit -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <appSettings />
    <httpRuntime />
    <pages controlRenderingCompatibilityVersion="4.0" />
    <service name="ApuracaoAFDT.WCF.Servico">
    <endpoint address="" binding="basicHttpBinding" bindingConfiguration="StreamHttpBinding" contract="ApuracaoAFDT.WCF.IServico" />
    <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration="" contract="IMetadataExchange" />
    <serviceMetadata httpGetEnabled="true" httpsGetEnabled="true" />
    <serviceDebug includeExceptionDetailInFaults="false" />
    <add binding="basicHttpsBinding" scheme="https" />
    <serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="true" />
    <modules runAllManagedModulesForAllRequests="true" />
    <directoryBrowse enabled="true" />
    <add name="ApuracaoAFDT.WCF.Context.AFDTContext" providerName="Oracle.DataAccess.Client" connectionString="DATA SOURCE=datasource;USER ID=userID;PASSWORD=pass" />
    <add name="ApuracaoAFDT.WCF.Context.ORC0Context" providerName="Oracle.DataAccess.Client" connectionString="DATA SOURCE=datasource;USER ID=userID;PASSWORD=pass" />
    <trace autoflush="true" indentsize="4">
    <add name="myListener" type="System.Diagnostics.TextWriterTraceListener" initializeData="application.log" />
    <remove name="Default" />
    <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
    <bindingRedirect oldVersion="" newVersion="" />


    Occurred in: 29/04/2013 16:31:35
    Exception: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct.
    Inner exception: The provider did not return a ProviderManifestToken string.
    Stack trace:    at System.Data.Entity.ModelConfiguration.Utilities.DbProviderServicesExtensions.GetProviderManifestTokenChecked(DbProviderServices providerServices, DbConnection connection)
       at System.Data.Entity.ModelConfiguration.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection connection, DbProviderManifest& providerManifest)
       at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
       at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
       at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
       at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
       at System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType(Type entityType)
       at System.Data.Entity.Internal.Linq.InternalSet`1.Initialize()
       at System.Data.Entity.Internal.Linq.InternalSet`1.GetEnumerator()
       at System.Data.Entity.Infrastructure.DbQuery`1.System.Collections.Generic.IEnumerable<TResult>.GetEnumerator()
       at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
       at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
       at ApuracaoAFDT.WCF.Base.RepositoryBase`1.Get(Expression`1 filter, Func`2 orderBy, String includeProperties)
       at ApuracaoAFDT.WCF.Apuracao.ObterTodosPorCentroCusto(String centroCusto)

    EDIT: this is the main part of my client side there anything wrong with it?!

        internal static class WCFApuracao
            #region Membros

            private static WCF_Apuracao.ApuracaoClient m_WCF;
            private static string m_enderecoServidor;

            public static ApuracaoClient Wcf
                get { return m_WCF ?? new ApuracaoClient("BasicHttpBinding_IApuracao", Settings.Default.EnderecoServidor + "Apuracao/Apuracao/"); }
                set { m_WCF = value; }


            #region Construtor
            internal static List<AFDTFunc> ListarTodosPorCentroCusto(string obra)
                    var listaFuncionarios = Wcf.ObterTodosPorCentroCusto(obra).ToList();
                    return listaFuncionarios;
                catch (WebException ex)
                    Wcf = null;
                    throw new WebException("Não foi possível pegar os dados do servidor.");
                catch (Exception ex)
                    Wcf = null;
                    throw new WebException("Erro ao obter uma lista de funcionário.\r\n" + ex.Message);


    I would really appretiate if some of you could help me with this issue.


    Davi Rodrigues

    • Edited by DaviARodrigues Tuesday, April 30, 2013 2:15 PM put the main part of my client side class
    Tuesday, April 30, 2013 11:14 AM


  • Look at this..

    Verify "Building the model" section in below link.


    Happy Coding, Kishore.

    Tuesday, April 30, 2013 5:01 PM

All replies

  • Hello..

    Try using "System.Data.OracleClient" for providerName in ConnectionString.


    Happy Coding, Kishore.

    • Edited by KoyaKishore Tuesday, April 30, 2013 1:05 PM
    Tuesday, April 30, 2013 1:03 PM
  • Hello Koya,

    At least until now, no deal, my friend...I mean, the exception changed, but I'm really working with THAT specific oracle connection library...


    Tuesday, April 30, 2013 2:06 PM
  • Hi..

    Check out this link. This may help you.!!


    Happy Coding, Kishore.

    Tuesday, April 30, 2013 3:21 PM
  • Hey mate, this is a good choice, but assuming that I've created my EF project with Code First...I guess it won't work...


    Tuesday, April 30, 2013 4:17 PM
  • Look at this..

    Verify "Building the model" section in below link.


    Happy Coding, Kishore.

    Tuesday, April 30, 2013 5:01 PM