Home

Object reference not set to an instance of an object.

I have a LINQ to SQL setup and it was working before the update to 6.10.13, now one of the databases in the server comes with this error. But all the rest work, I can use standard SQL commands even though it gives me this error. When I try to use LINQ of C# Program with LINQ this completely fails and will not grab any information. Is there a way to COMPLETELY delete all the settings, I cleared app data and the folders I found, but when I start up LINQPad, it instantly knows who I am and this database again fails... Help me obi wans!

Comments

  • Works in LINQPad 5 and not in beta 6.

  • Can you post the full stack trace?

  • edited October 2020

    Here is the log that happens just before with the error.

    6.10.13 (X64) 2020-10-15T09:04:19.2515557-04:00 Custom Data Context Driver
    NullReferenceException - Object reference not set to an instance of an object.
    Source=LINQPad.Runtime
    
     -LINQPad.Extensibility.DataContext.DbSchema.Database+<>c System.String <ReadColumns>b__39_0(LINQPad.Extensibility.DataContext.DbSchema.Column) offset: 0xC
     -LINQPad.ProjectedEqualityComparer`2 Int32 GetHashCode(T) offset: 0x1
     -System.Collections.Generic.Dictionary`2 Boolean TryInsert(TKey, TValue, System.Collections.Generic.InsertionBehavior) offset: 0x2F
     -System.Collections.Generic.Dictionary`2 Void Add(TKey, TValue) offset: 0x0
     -LINQPad.Extensibility.DataContext.DbSchema.Database Void ReadColumns(System.Collections.Generic.IEnumerable`1[LINQPad.Extensibility.DataContext.DbSchema.Column]) offset: 0xA4
     -LINQPad.Extensibility.DataContext.DbSchema.Database Void Populate() offset: 0x17
     -LINQPad.Extensibility.DataContext.DbSchema.Database Void .ctor(System.String, System.String, System.String, LINQPad.Extensibility.DataContext.IDynamicSchemaOptions, System.Collections.Generic.IEnumerable`1[LINQPad.Extensibility.DataContext.DbSchema.Column], System.Collections.Generic.IEnumerable`1[LINQPad.Extensibility.DataContext.DbSchema.ColumnAssociation], System.Collections.Generic.IEnumerable`1[LINQPad.Extensibility.DataContext.DbSchema.Parameter], LINQPad.Extensibility.DataContext.DbSchema.Database[]) offset: 0x76
     -LINQPad.Drivers.SqlClient.SqlServerSchemaReader LINQPad.Extensibility.DataContext.DbSchema.Database GetDatabase(LINQPad.Extensibility.DataContext.DataContextDriver, LINQPad.Extensibility.DataContext.IConnectionInfo, LINQPad.Drivers.LinkedDatabase, Boolean, System.String) offset: 0x368
     -LINQPad.Drivers.SqlClient.SqlServerSchemaReader LINQPad.Extensibility.DataContext.DbSchema.Database GetDatabase(LINQPad.Extensibility.DataContext.DataContextDriver, LINQPad.Extensibility.DataContext.IConnectionInfo) offset: 0x1
     -LINQPad.Drivers.LinqToSql.DynamicDriver System.Collections.Generic.List`1[LINQPad.Extensibility.DataContext.ExplorerItem] GetSchemaAndBuildAssembly(LINQPad.Extensibility.DataContext.IConnectionInfo, System.Reflection.AssemblyName, System.String ByRef, System.String ByRef) offset: 0x25
     -LINQPad.Extensibility.DataContext.DynamicDataContextDriver LINQPad.Extensibility.DataContext.DynamicSchemaResult GetSchemaAndBuildAssemblyInternal(System.String, System.String) offset: 0x28
    
    6.10.13 (X64) 2020-10-15T09:04:19.2687287-04:00 GuiAppHost
    RemoteException - NullReferenceException - Object reference not set to an instance of an object.
    Source=LINQPad.Runtime
    
     -LINQPad.Extensibility.DataContext.DbSchema.Database+<>c System.String <ReadColumns>b__39_0(LINQPad.Extensibility.DataContext.DbSchema.Column) offset: 0xC
     -LINQPad.ProjectedEqualityComparer`2 Int32 GetHashCode(T) offset: 0x1
     -System.Collections.Generic.Dictionary`2 Boolean TryInsert(TKey, TValue, System.Collections.Generic.InsertionBehavior) offset: 0x2F
     -System.Collections.Generic.Dictionary`2 Void Add(TKey, TValue) offset: 0x0
     -LINQPad.Extensibility.DataContext.DbSchema.Database Void ReadColumns(System.Collections.Generic.IEnumerable`1[LINQPad.Extensibility.DataContext.DbSchema.Column]) offset: 0xA4
     -LINQPad.Extensibility.DataContext.DbSchema.Database Void Populate() offset: 0x17
     -LINQPad.Extensibility.DataContext.DbSchema.Database Void .ctor(System.String, System.String, System.String, LINQPad.Extensibility.DataContext.IDynamicSchemaOptions, System.Collections.Generic.IEnumerable`1[LINQPad.Extensibility.DataContext.DbSchema.Column], System.Collections.Generic.IEnumerable`1[LINQPad.Extensibility.DataContext.DbSchema.ColumnAssociation], System.Collections.Generic.IEnumerable`1[LINQPad.Extensibility.DataContext.DbSchema.Parameter], LINQPad.Extensibility.DataContext.DbSchema.Database[]) offset: 0x76
     -LINQPad.Drivers.SqlClient.SqlServerSchemaReader LINQPad.Extensibility.DataContext.DbSchema.Database GetDatabase(LINQPad.Extensibility.DataContext.DataContextDriver, LINQPad.Extensibility.DataContext.IConnectionInfo, LINQPad.Drivers.LinkedDatabase, Boolean, System.String) offset: 0x368
     -LINQPad.Drivers.SqlClient.SqlServerSchemaReader LINQPad.Extensibility.DataContext.DbSchema.Database GetDatabase(LINQPad.Extensibility.DataContext.DataContextDriver, LINQPad.Extensibility.DataContext.IConnectionInfo) offset: 0x1
     -LINQPad.Drivers.LinqToSql.DynamicDriver System.Collections.Generic.List`1[LINQPad.Extensibility.DataContext.ExplorerItem] GetSchemaAndBuildAssembly(LINQPad.Extensibility.DataContext.IConnectionInfo, System.Reflection.AssemblyName, System.String ByRef, System.String ByRef) offset: 0x25
     -LINQPad.Extensibility.DataContext.DynamicDataContextDriver LINQPad.Extensibility.DataContext.DynamicSchemaResult GetSchemaAndBuildAssemblyInternal(System.String, System.String) offset: 0x28
    
    Source=System.Private.CoreLib
    
     -System.Runtime.ExceptionServices.ExceptionDispatchInfo Void Throw() offset: 0x11
     -System.Runtime.CompilerServices.TaskAwaiter Void ThrowForNonSuccess(System.Threading.Tasks.Task) offset: 0x27
     -System.Runtime.CompilerServices.TaskAwaiter Void HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task) offset: 0x28
     -System.Runtime.CompilerServices.ConfiguredTaskAwaitable`1+ConfiguredTaskAwaiter TResult GetResult() offset: 0xB
     -LINQPad.DataContextManager+<FetchDCInfoCore>d__31 Void MoveNext() offset: 0x4BA
    
    
       INNER: NullReferenceException - Object reference not set to an instance of an object.
       Source=LINQPad.Runtime
    
          at LINQPad.Extensibility.DataContext.DbSchema.Database.<>c.<ReadColumns>b__39_0(Column c)
          at LINQPad.ProjectedEqualityComparer`2.GetHashCode(T obj)
          at System.Collections.Generic.Dictionary`2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
          at System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value)
          at LINQPad.Extensibility.DataContext.DbSchema.Database.ReadColumns(IEnumerable`1 columns)
          at LINQPad.Extensibility.DataContext.DbSchema.Database.Populate()
          at LINQPad.Extensibility.DataContext.DbSchema.Database..ctor(String serverName, String catalogName, String systemSchema, IDynamicSchemaOptions schemaOptions, IEnumerable`1 columns, IEnumerable`1 associations, IEnumerable`1 routineParameters, Database[] linkedDatabases)
          at LINQPad.Drivers.SqlClient.SqlServerSchemaReader.GetDatabase(DataContextDriver driver, IConnectionInfo cxInfo, LinkedDatabase serverLinkedDb, Boolean sameServerLink, String systemSchema)
          at LINQPad.Drivers.SqlClient.SqlServerSchemaReader.GetDatabase(DataContextDriver driver, IConnectionInfo cxInfo)
          at LINQPad.Drivers.LinqToSql.DynamicDriver.GetSchemaAndBuildAssembly(IConnectionInfo cxInfo, AssemblyName assemblyToBuild, String& nameSpace, String& typeName)
          at LINQPad.Extensibility.DataContext.DynamicDataContextDriver.GetSchemaAndBuildAssemblyInternal(String repositoryData, String assemblyPathToBuild)
    
    First Chance Data:
       -System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() offset=0x11
    
  • Thanks for the info. I'll a get a fix into the next beta, in a day or two.

  • Try now - a new beta is available.

  • @JoeAlbahari said:
    Try now - a new beta is available.

    Sorry for the delay, that fixed it, thank you!

Sign In or Register to comment.