runtime: GetColumnSchema not supported
Originally filed as https://github.com/aspnet/EntityFrameworkCore/issues/10686 by @dominicrooijackers Moved here since this is either an issue with ADO.NET or possibly with the way the third-party EntityFrameworkExtras uses ADO.NET, but is not an issue with EF Core itself.
Overnight out .NET core 1.1.0 application broke on our development server. The application still works fine while running it from visual studio 2015
The error that I’m getting is An unhandled exception occurred while processing the request. NotSupportedException: Specified method is not supported. System.Data.Common.DbDataReaderExtensions.GetColumnSchema(DbDataReader reader)
Stacktrace as follows:
System.Data.Common.DbDataReaderExtensions.GetColumnSchema(DbDataReader reader) EntityFrameworkExtras.EFCore.DatabaseExtensions.GetModelFromQuery<T>(DatabaseFacade databaseFacade, string sql, Object[] parameters) in DatabaseExtensions.cs EntityFrameworkExtras.EFCore.DatabaseExtensions.ExecuteStoredProcedure<T>(DatabaseFacade database, object storedProcedure) in DatabaseExtensions.cs DocumentPortal.Components.FolderViewComponent+<>c__DisplayClass3_0.<GetFolderContentAsync>b__0() in FolderViewComponent.cs System.Threading.Tasks.Task.InnerInvoke() System.Threading.Tasks.Task.Execute() System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) System.Runtime.CompilerServices.TaskAwaiter.GetResult() DocumentPortal.Components.FolderViewComponent+<InvokeAsync>d__2.MoveNext() in FolderViewComponent.cs System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker+<InvokeAsyncCore>d__6.MoveNext() System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentInvoker+<InvokeAsync>d__5.MoveNext() System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) Microsoft.AspNetCore.Mvc.ViewComponents.DefaultViewComponentHelper+<InvokeCoreAsync>d__12.MoveNext()
The following code is causing the error
IEnumerable<string> actualNames = dr.GetColumnSchema().Select(o => o.ColumnName);
Further technical details
EF Core version: 1.1.0 Database Provider: Microsoft.EntityFrameworkCore.SqlServer Operating system: Server 2012R2 IDE: Visual Studio 2015
No application updates have been made anytime recently, so I strongly believe it has something to do with the server environment.
About this issue
- Original URL
- State: closed
- Created 6 years ago
- Comments: 18 (8 by maintainers)
@pantonis I’ve ended up copying solution from net 462:
@David-Engel Is that repo public? Do you have a link to the bug report? I’m experiencing the same issues where changing a project to target .NET 4.7.2 broke my application due to
System.Data.Common
no-longer having the correctDbDataReaderExtensions
implementation.The temporary workaround is to target .net 4.6.2. But we can’t stay on it forever. When is this going to be resolved? It’s been 6 months already.