none
Unable to run hosted web application having entity framework used to perform db operations RRS feed

  • Question

  • Hi,

    We are useing sql server database and using entity framework in web application to make DDL, DML operations.

    We are geting below error while creating object of entity framework table class.

    Because the underlying provider had overridden DbProviderManifest.SupportsEscapingLikeArgument to return true, the DbProviderManifest.EscapeLikeArgument method must also be implemented by the provider.

    Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

    Exception Details: System.Data.Entity.Core.ProviderIncompatibleException: Because the underlying provider had overridden DbProviderManifest.SupportsEscapingLikeArgument to return true, the DbProviderManifest.EscapeLikeArgument method must also be implemented by the provider.

    Source Error:

    An unhandled exception was generated during the execution of the   current web request. Information regarding the origin and location of the   exception can be identified using the exception stack trace below.


    Stack Trace:

    [ProviderIncompatibleException: Because the underlying provider   had overridden DbProviderManifest.SupportsEscapingLikeArgument to return   true, the DbProviderManifest.EscapeLikeArgument method must also be   implemented by the provider.]

       System.Data.Entity.Core.Common.DbProviderManifest.EscapeLikeArgument(String   argument) +6478272

         System.Data.Entity.SqlServer.SqlProviderServices..ctor() +151

         System.Data.Entity.SqlServer.SqlProviderServices..cctor() +28

    [TypeInitializationException: The type initializer for   'System.Data.Entity.SqlServer.SqlProviderServices' threw an exception.]

         System.Data.Entity.SqlServer.SqlProviderServices.get_Instance() +21

    [TargetInvocationException: Exception has been thrown by the   target of an invocation.]

       System.RuntimeMethodHandle.InvokeMethod(Object   target, Object[] arguments, Signature sig, Boolean constructor) +0

         System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(Object obj, Object[]   parameters, Object[] arguments) +229

       System.Reflection.RuntimeMethodInfo.Invoke(Object   obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo   culture) +211

         System.Reflection.RuntimePropertyInfo.GetValue(Object obj, Object[] index)   +38

         System.Data.Entity.Infrastructure.DependencyResolution.ProviderServicesFactory.GetInstance(Type   providerType) +357

         System.Data.Entity.Internal.AppConfig.<.ctor>b__2(ProviderElement e)   +183

         System.Linq.WhereSelectEnumerableIterator`2.MoveNext() +270

         System.Collections.Generic.List`1..ctor(IEnumerable`1 collection) +536

       System.Linq.Enumerable.ToList(IEnumerable`1 source)   +80

         System.Data.Entity.Internal.AppConfig.<.ctor>b__1() +108

       System.Lazy`1.CreateValue() +497

       System.Lazy`1.get_Value() +14338318

       System.Data.Entity.Internal.AppConfig.get_DbProviderServices()   +16

         System.Data.Entity.Infrastructure.DependencyResolution.AppConfigDependencyResolver.RegisterDbProviderServices()   +27

         System.Data.Entity.Infrastructure.DependencyResolution.AppConfigDependencyResolver.GetServiceFactory(Type   type, String name) +113

         System.Collections.Concurrent.ConcurrentDictionary`2.GetOrAdd(TKey key,   Func`2 valueFactory) +83

         System.Data.Entity.Infrastructure.DependencyResolution.AppConfigDependencyResolver.GetService(Type   type, Object key) +151

       System.Linq.WhereSelectArrayIterator`2.MoveNext()   +82

       System.Linq.Enumerable.FirstOrDefault(IEnumerable`1   source, Func`2 predicate) +215

         System.Data.Entity.Infrastructure.DependencyResolution.CompositeResolver`2.GetService(Type   type, Object key) +41

         System.Data.Entity.Infrastructure.DependencyResolution.DbDependencyResolverExtensions.GetService(IDbDependencyResolver   resolver) +81

         System.Data.Entity.DbContext.InitializeLazyInternalContext(IInternalConnection   internalConnection, DbCompiledModel model) +118  

    Can someone please help us to sove this issue?

    Thanks & Regards,

    Ash


    • Edited by AshItsMe Friday, October 30, 2015 9:35 AM
    Friday, October 30, 2015 9:34 AM

All replies

  • Hello AshItsMe,

    >>We are useing sql server database and using entity framework in web application to make DDL, DML operations.

    Have you made a test with the model separately to narrow down this issue, if this is caused by the EF itself or some code in the web application?

    >>We are geting below error while creating object of entity framework table class.

    It seems you are using code first approach? Could you please share some code with us about how you write the code to create the table object?

    Or you could just share a demo project which could reproduce this issue with us, we could help make a test with it.

    Regards.


    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.

    Monday, November 2, 2015 2:44 AM
    Moderator