Bug 12800 - Problem with EntityFramework5 based application and Mono 3.0.11
Summary: Problem with EntityFramework5 based application and Mono 3.0.11
Status: NEW
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.Data (show other bugs)
Version: master
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2013-06-20 16:26 UTC by Viktor Sychev
Modified: 2013-07-01 14:39 UTC (History)
2 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
Log file, created with mono -v (3.65 MB, text/x-log)
2013-06-20 16:26 UTC, Viktor Sychev
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report for Bug 12800 on GitHub or Developer Community if you have new information to add and do not yet see a matching new report.

If the latest results still closely match this report, you can use the original description:

  • Export the original title and description: GitHub Markdown or Developer Community HTML
  • Copy the title and description into the new report. Adjust them to be up-to-date if needed.
  • Add your new information.

In special cases on GitHub you might also want the comments: GitHub Markdown with public comments

Related Links:
Status:
NEW

Description Viktor Sychev 2013-06-20 16:26:34 UTC
Created attachment 4171 [details]
Log file, created with mono -v

I'm trying to launch my application, which was developed using EntityFramework 5 and VisualStudio 2012 (.NET Framework versions 4.0 ( Generic profile) or 4.5), and have problems when my application tried to retrieve data from its datamodel. Under Microsoft Windows with original .NET Framework from Microsoft I haven't any problems( manually tested many times). 
Exception which was produced during code execution I will attach below after this message.

Unhandled Exception:
ProjectGenius.SystemCore.Kernel.Core.Exceptions.DatabaseException: При выполнении операции с БД возникла ошибка Unable to create a constant value of type 'ProjectGenius.SystemCore.Kernel.Schema.Core.rbac_username_db'. Only primitive types or enumeration types are supported in this context.
  at System.Data.Objects.ELinq.ExpressionConverter+ConstantTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.ConstantExpression linq) [0x00000] in <filename unknown>:0                                                                                                                                                                            
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.ConstantExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0                                                                                                                                              
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0                                                   
  at System.Data.Objects.ELinq.ExpressionConverter+NewArrayInitTranslator+<>c__DisplayClass88.<TypedTranslate>b__86 (System.Linq.Expressions.Expression e) [0x00000] in <filename unknown>:0         
  at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator1A`2[System.Linq.Expressions.Expression,System.Data.Common.CommandTrees.DbExpression].MoveNext () [0x00000] in <filename unknown>:0     
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.EnumerableValidator`3[System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.Internal.DbExpressionList].Validate (IEnumerable`1 argument, System.String argumentName, Int32 expectedElementCount, Boolean allowEmpty, System.Func`3 map, System.Func`2 collect, System.Func`3 deriveName) [0x00000] in <filename unknown>:0                                                                                                                                                 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.EnumerableValidator`3[System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.Internal.DbExpressionList].Validate () [0x00000] in <filename unknown>:0                                                                                                                  
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.CreateExpressionList (IEnumerable`1 arguments, System.String argumentName, Boolean allowEmpty, System.Action`2 validationCallback) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.CreateExpressionList (IEnumerable`1 arguments, System.String argumentName, System.Action`2 validationCallback) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.ValidateNewCollection (IEnumerable`1 elements, System.Data.Common.CommandTrees.Internal.DbExpressionList& validElements) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.CreateNewCollection (IEnumerable`1 elements) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.NewCollection (IEnumerable`1 elements) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+NewArrayInitTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.NewArrayExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.NewArrayExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+ConstantTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.ConstantExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.ConstantExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateSet (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+MethodCallTranslator+JoinTranslator.Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.MethodCallExpression call) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+MethodCallTranslator+SequenceMethodTranslator.Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.MethodCallExpression call, SequenceMethod sequenceMethod) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+MethodCallTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.MethodCallExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.MethodCallExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.Convert () [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan (Nullable`1 forMergeOption) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ObjectQuery`1[ProjectGenius.SystemCore.Kernel.Core.Utils.Samdb.BriefUserInfo].GetResults (Nullable`1 forMergeOption) [0x00000] in <filename unknown>:0 
[ERROR] FATAL UNHANDLED EXCEPTION: ProjectGenius.SystemCore.Kernel.Core.Exceptions.DatabaseException: При выполнении операции с БД возникла ошибка Unable to create a constant value of type 'ProjectGenius.SystemCore.Kernel.Schema.Core.rbac_username_db'. Only primitive types or enumeration types are supported in this context.
  at System.Data.Objects.ELinq.ExpressionConverter+ConstantTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.ConstantExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.ConstantExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+NewArrayInitTranslator+<>c__DisplayClass88.<TypedTranslate>b__86 (System.Linq.Expressions.Expression e) [0x00000] in <filename unknown>:0 
  at System.Linq.Enumerable+<CreateSelectIterator>c__Iterator1A`2[System.Linq.Expressions.Expression,System.Data.Common.CommandTrees.DbExpression].MoveNext () [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.EnumerableValidator`3[System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.Internal.DbExpressionList].Validate (IEnumerable`1 argument, System.String argumentName, Int32 expectedElementCount, Boolean allowEmpty, System.Func`3 map, System.Func`2 collect, System.Func`3 deriveName) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.EnumerableValidator`3[System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.DbExpression,System.Data.Common.CommandTrees.Internal.DbExpressionList].Validate () [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.CreateExpressionList (IEnumerable`1 arguments, System.String argumentName, Boolean allowEmpty, System.Action`2 validationCallback) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.CreateExpressionList (IEnumerable`1 arguments, System.String argumentName, System.Action`2 validationCallback) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.Internal.ArgumentValidation.ValidateNewCollection (IEnumerable`1 elements, System.Data.Common.CommandTrees.Internal.DbExpressionList& validElements) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.CreateNewCollection (IEnumerable`1 elements) [0x00000] in <filename unknown>:0 
  at System.Data.Common.CommandTrees.ExpressionBuilder.DbExpressionBuilder.NewCollection (IEnumerable`1 elements) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+NewArrayInitTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.NewArrayExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.NewArrayExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+ConstantTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.ConstantExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.ConstantExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateSet (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+MethodCallTranslator+JoinTranslator.Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.MethodCallExpression call) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+MethodCallTranslator+SequenceMethodTranslator.Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.MethodCallExpression call, SequenceMethod sequenceMethod) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+MethodCallTranslator.TypedTranslate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.MethodCallExpression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter+TypedTranslator`1[System.Linq.Expressions.MethodCallExpression].Translate (System.Data.Objects.ELinq.ExpressionConverter parent, System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.TranslateExpression (System.Linq.Expressions.Expression linq) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ExpressionConverter.Convert () [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ELinq.ELinqQueryState.GetExecutionPlan (Nullable`1 forMergeOption) [0x00000] in <filename unknown>:0 
  at System.Data.Objects.ObjectQuery`1[ProjectGenius.SystemCore.Kernel.Core.Utils.Samdb.BriefUserInfo].GetResults (Nullable`1 forMergeOption) [0x00000] in <filename unknown>:0
Comment 1 Viktor Sychev 2013-06-22 00:48:09 UTC
Bug was produced by function, during LINQ operation:

        public IList<Utils.Samdb.BriefUserInfo> ListUsers_Brief()
        {
            IList<Utils.Samdb.BriefUserInfo> briefList = new List<Utils.Samdb.BriefUserInfo>();
            lock (_Locker)
            {
                try
                {
                    foreach (Utils.Samdb.BriefUserInfo briefInfo in from users in Context.rbac_users join usernames in Context.rbac_username_db on users.username equals usernames.username select new Utils.Samdb.BriefUserInfo() { Name = usernames.data, Uid = users.user_id })
                    {
                        briefList.Add(briefInfo);
                    }
                }
                catch (Exception dbException)
                {
                    throw new Exceptions.DatabaseException(dbException.Message, dbException.StackTrace);
                }
            }
            return briefList;
        }