Bug 48110 - Entity Framework 5 & Mono project & MySql Connector : NullReferenceException
Summary: Entity Framework 5 & Mono project & MySql Connector : NullReferenceException
Status: RESOLVED DUPLICATE of bug 31914
Alias: None
Product: Class Libraries
Classification: Mono
Component: System.XML ()
Version: 4.2.1 (C6SR0)
Hardware: PC Linux
: --- normal
Target Milestone: Untriaged
Assignee: Bugzilla
URL:
Depends on:
Blocks:
 
Reported: 2016-11-27 17:24 UTC by bruno.tete
Modified: 2016-11-28 11:24 UTC (History)
1 user (show)

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

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 on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED DUPLICATE of bug 31914

Description bruno.tete 2016-11-27 17:24:15 UTC
I am using mono project via Synology and develop a simple project with Owin in VS 2015 community.

I have a mariadb and a MySql connector using EF5. It works perfeclty on windows, but once I copy my dll in mono, and start my request I have the following issue

Object reference not set to an instance of an object

at System.Xml.XmlReader.CalcBufferSize (System.IO.Stream input)
System.Xml.XmlTextReaderImpl.InitStreamInput (System.Uri baseUri, System.String baseUriStr, System.IO.Stream stream, System.Byte[] bytes, Int32 byteCount, System.Text.Encoding encoding)
System.Xml.XmlTextReaderImpl.InitStreamInput (System.IO.Stream stream, System.Text.Encoding encoding)
System.Xml.XmlTextReaderImpl..ctor (System.String url, System.IO.Stream input, System.Xml.XmlNameTable nt) 
System.Xml.XmlTextReaderImpl..ctor (System.IO.Stream input) 
System.Xml.XmlTextReader..ctor (System.IO.Stream input) 
System.Xml.Schema.XmlSchema.Read (System.IO.Stream stream, System.Xml.Schema.ValidationEventHandler validationEventHandler) 
System.Data.EntityModel.SchemaObjectModel.Schema+SomSchemaSetHelper.AddXmlSchemaToSet (System.Xml.Schema.XmlSchemaSet schemaSet, XmlSchemaResource schemaResource, System.Collections.Generic.HashSet1 schemasAlreadyAdded) 
  at System.Data.EntityModel.SchemaObjectModel.Schema+SomSchemaSetHelper.AddXmlSchemaToSet (System.Xml.Schema.XmlSchemaSet schemaSet, XmlSchemaResource schemaResource, System.Collections.Generic.HashSet1 schemasAlreadyAdded) 
System.Data.EntityModel.SchemaObjectModel.Schema+SomSchemaSetHelper.ComputeSchemaSet (SchemaDataModelOption dataModel) 
System.Data.Common.Utils.Memoizer2+<Evaluate>c__AnonStorey0[TArg,TResult].<>m__0 () 
  at System.Data.Common.Utils.Memoizer2+Result[TArg,TResult].GetValue () 
System.Data.Common.Utils.Memoizer2[TArg,TResult].Evaluate (System.Data.Common.Utils.TArg arg) 
  at System.Data.EntityModel.SchemaObjectModel.Schema+SomSchemaSetHelper.GetSchemaSet (SchemaDataModelOption dataModel) 
  at System.Data.EntityModel.SchemaObjectModel.Schema.CreateXmlReaderSettings () 
  at System.Data.EntityModel.SchemaObjectModel.Schema.Parse (System.Xml.XmlReader sourceReader, System.String sourceLocation) 
  at System.Data.EntityModel.SchemaObjectModel.SchemaManager.ParseAndValidate (IEnumerable1 xmlReaders, IEnumerable1 sourceFilePaths, SchemaDataModelOption dataModel, System.Data.EntityModel.SchemaObjectModel.AttributeValueNotification providerNotification, System.Data.EntityModel.SchemaObjectModel.AttributeValueNotification providerManifestTokenNotification, System.Data.EntityModel.SchemaObjectModel.ProviderManifestNeeded providerManifestNeeded, IList1& schemaCollection) 
System.Data.EntityModel.SchemaObjectModel.SchemaManager.ParseAndValidate (IEnumerable1 xmlReaders, IEnumerable1 sourceFilePaths, SchemaDataModelOption dataModel, System.Data.Common.DbProviderManifest providerManifest, IList1& schemaCollection) 
  at System.Data.Metadata.Edm.EdmItemCollection.LoadItems (IEnumerable1 xmlReaders, IEnumerable1 sourceFilePaths, SchemaDataModelOption dataModelOption, System.Data.Common.DbProviderManifest providerManifest, System.Data.Metadata.Edm.ItemCollection itemCollection, Boolean throwOnError) 
  at System.Data.Metadata.Edm.EdmItemCollection.Init (IEnumerable1 xmlReaders, IEnumerable1 filePaths, Boolean throwOnError) 
  at System.Data.Metadata.Edm.EdmItemCollection..ctor (IEnumerable1 xmlReaders, IEnumerable1 filePaths) 
  at System.Data.Metadata.Edm.MetadataCache+EdmMetadataEntry.LoadEdmItemCollection (System.Data.Metadata.Edm.MetadataArtifactLoader loader) 
  at System.Data.Metadata.Edm.MetadataCache+EdmItemCollectionLoader.LoadItemCollection (System.Data.Metadata.Edm.EdmMetadataEntry entry) 
  at System.Data.Metadata.Edm.MetadataCache.LoadItemCollection[T] (IItemCollectionLoader1 itemCollectionLoader, System.Data.Metadata.Edm.T entry) 
System.Data.Metadata.Edm.MetadataCache.GetOrCreateEdmItemCollection (System.String cacheKey, System.Data.Metadata.Edm.MetadataArtifactLoader loader, System.Object& entryToken) 
System.Data.EntityClient.EntityConnection.LoadEdmItemCollection (System.Data.Metadata.Edm.MetadataWorkspace workspace, System.Data.Metadata.Edm.MetadataArtifactLoader artifactLoader) 
System.Data.EntityClient.EntityConnection.GetMetadataWorkspace (Boolean initializeAllCollections) 
(wrapper remoting-invoke-with-check) System.Data.EntityClient.EntityConnection:GetMetadataWorkspace (bool) at System.Data.Objects.ObjectContext.RetrieveMetadataWorkspaceFromConnection () 
System.Data.Objects.ObjectContext..ctor (System.Data.EntityClient.EntityConnection connection, Boolean isConnectionConstructor) 
System.Data.Objects.ObjectContext..ctor (System.Data.EntityClient.EntityConnection connection) 
System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel () 
System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel () 
System.Data.Entity.Internal.LazyInternalContext.InitializeContext () 
System.Data.Entity.Internal.InternalContext.Initialize () 
System.Data.Entity.Internal.InternalContext.GetEntitySetAndBaseTypeForType (System.Type entityType) 
System.Data.Entity.Internal.Linq.InternalSet1[TEntity].Initialize () 
  at System.Data.Entity.Internal.Linq.InternalSet1[TEntity].GetEnumerator () 
System.Data.Entity.Infrastructure.DbQuery1[TResult].System.Collections.Generic.IEnumerable
  at System.Collections.Generic.List1[T]..ctor (IEnumerable1 collection) 
  at System.Linq.Enumerable.ToList[TSource] (IEnumerable1 source) 
PA.WebApi.Controllers.TestController.Get ()
Comment 1 bruno.tete 2016-11-28 11:24:46 UTC
https://bugzilla.xamarin.com/show_bug.cgi?id=31914

*** This bug has been marked as a duplicate of bug 31914 ***