Приложение Mono / MVC5 / EF6 / PostgreSQL завершилось неудачно при обновлении с mono 5.8 до 5.14 - PullRequest
0 голосов
/ 20 сентября 2018

У меня есть приложение, которое работает на Mono с провайдером Mvc5, EF6 и PostgreSQL Npgsql.Работает нормально на моно 5.8.Но это не работает с моно 5.14.Выдает исключение

"System.TypeInitializationException: The type initializer for 'System.Data.Entity.Core.Objects.ELinq.ExpressionConverter' threw an exception. ---> System.TypeInitializationException: The type initializer for 'MethodCallTranslator' threw an exception. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: key".

Я написал простой тестовый код для воспроизведения этой проблемы.

class Program
{
    static void Main(string[] args)
    {
        Model1 model1 = new Model1();

        var query = from b in model1.mx_busi_info
                    select b;

        foreach (var b in query)
        {
            Console.WriteLine(b.busi_name);
        }
    }
}

Любая помощь приветствуется.

Полная трассировка стека исключений:

    Unhandled Exception:
System.TypeInitializationException: The type initializer for 'System.Data.Entity.Core.Objects.ELinq.ExpressionConverter' threw an exception. ---> System.TypeInitializationException: The type initializer for 'MethodCallTranslator' threw an exception. ---> System.ArgumentNullException: Value cannot be null.
Parameter name: key
  at System.Collections.Generic.Dictionary`2[TKey,TValue].TryInsert (TKey key, TValue value, System.Collections.Generic.InsertionBehavior behavior) [0x00008] in <2943701620b54f86b436d3ffad010412>:0
  at System.Collections.Generic.Dictionary`2[TKey,TValue].Add (TKey key, TValue value) [0x00000] in <2943701620b54f86b436d3ffad010412>:0
  at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter+MethodCallTranslator.InitializeMethodTranslators () [0x00031] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0
  at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter+MethodCallTranslator..cctor () [0x00014] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0
   --- End of inner exception stack trace ---
  at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter+<GetTranslators>d__0.MoveNext () [0x00345] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0
  at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter.InitializeTranslators () [0x00050] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0
  at System.Data.Entity.Core.Objects.ELinq.ExpressionConverter..cctor () [0x00000] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0
   --- End of inner exception stack trace ---
  at System.Data.Entity.Core.Objects.ELinq.ELinqQueryState.CreateExpressionConverter () [0x0000c] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0
  at System.Data.Entity.Core.Objects.ELinq.ELinqQueryState.GetExecutionPlan (System.Nullable`1[T] forMergeOption) [0x0008d] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0
  at System.Data.Entity.Core.Objects.ObjectQuery`1+<>c__DisplayClass7[T].<GetResults>b__6 () [0x0000b] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0
  at System.Data.Entity.Core.Objects.ObjectContext.ExecuteInTransaction[T] (System.Func`1[TResult] func, System.Data.Entity.Infrastructure.IDbExecutionStrategy executionStrategy, System.Boolean startLocalTransaction, System.Boolean releaseConnectionOnSuccess) [0x0008a] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0
  at System.Data.Entity.Core.Objects.ObjectQuery`1+<>c__DisplayClass7[T].<GetResults>b__5 () [0x00033] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0
  at System.Data.Entity.Infrastructure.DefaultExecutionStrategy.Execute[TResult] (System.Func`1[TResult] operation) [0x00000] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0
  at System.Data.Entity.Core.Objects.ObjectQuery`1[T].GetResults (System.Nullable`1[T] forMergeOption) [0x00093] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0
  at System.Data.Entity.Core.Objects.ObjectQuery`1[T].<System.Collections.Generic.IEnumerable<T>.GetEnumerator>b__0 () [0x00000] in <b7b192e5a05f4f14a14aa0d5b14aeeeb>:0

1 Ответ

0 голосов
/ 21 сентября 2018

Кажется, на вас повлияла эта регрессия .

Но исправление в Mono уже объединено.

Возможно, вы будетенужно дождаться следующего выпуска 5.16, который мог получить это исправление в качестве бэкпорта.

Добро пожаловать на сайт PullRequest, где вы можете задавать вопросы и получать ответы от других членов сообщества.
...