title: Argument 'xmlReader' is not valid. A minimum of one .ssdl artifact must be supplied
body: <p>I have a class that is going to execute entity framework based queries. This class is a general class and is <code>DbContext</code> independent class(I mean there is no <code>ssdl</code> or <code>semiliar</code> files). In this class I am going to execute raw sql queries too. in order to this I add a method like:</p>
  <pre><code> Return _dbContext.Database.SqlQuery(Of String)(query).FirstOrDefault()
  </code></pre>
  <p>to execute scalars. but there is an error in this stage that says:</p>
  <pre><code>Additional information: Argument 'xmlReader' is not valid. A minimum of one .ssdl artifact must be supplied.
  </code></pre>
  <p>When I was going to create new instance of <code>DbContext</code>, I had passed this connection string to it:</p>
  <pre><code>metadata=res://*;provider=System.Data.SqlClient;provider connection string=&quot;Data Source=.;Initial Catalog=MyDb;integrated security=true;
  </code></pre>
  <p>Error Detail:</p>
  <pre><code>System.ArgumentException was unhandled by user code
  HResult=-2147024809
  Message=Argument 'xmlReader' is not valid. A minimum of one .ssdl artifact must be supplied. 
  Source=EntityFramework
  StackTrace:
     at System.Data.Entity.Core.EntityUtil.CheckArgumentEmpty[T](IEnumerable`1&amp; enumerableArgument,  Func`2 errorMessage, String argumentName)
     at System.Data.Entity.Core.Metadata.Edm.StoreItemCollection..ctor(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths)
     at System.Data.Entity.Core.Metadata.Edm.MetadataCache.LoadStoreCollection(EdmItemCollection edmItemCollection, MetadataArtifactLoader loader)
     at System.Data.Entity.Core.Metadata.Edm.MetadataCache.&lt;&gt;c__DisplayClass5.&lt;&gt;c__DisplayClass7.&lt;GetMetadataWorkspace&gt;b__1()
     at System.Lazy`1.CreateValue()
     at System.Lazy`1.LazyInitValue()
     at System.Lazy`1.get_Value()
     at System.Data.Entity.Core.Metadata.Edm.MetadataCache.&lt;&gt;c__DisplayClass5.&lt;&gt;c__DisplayClass7.&lt;GetMetadataWorkspace&gt;b__4()
     at System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.LoadAndCheckItemCollection[T](Func`1 itemCollectionLoader)
     at System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.&lt;&gt;c__DisplayClass16.&lt;.ctor&gt;b__f()
     at System.Lazy`1.CreateValue()
     at System.Lazy`1.LazyInitValue()
     at System.Lazy`1.get_Value()
     at System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.GetItemCollection(DataSpace dataSpace, Boolean required)
     at System.Data.Entity.Core.Metadata.Edm.MetadataWorkspace.GetItemCollection(DataSpace dataSpace)
     at System.Data.Entity.Core.Objects.ObjectContext.InitializeMappingViewCacheFactory(DbContext owner)
     at System.Data.Entity.Core.Objects.ObjectContext..ctor(EntityConnection connection, Boolean isConnectionConstructor, ObjectQueryExecutionPlanFactory objectQueryExecutionPlanFactory, Translator translator, ColumnMapFactory columnMapFactory)
     at System.Data.Entity.Core.Objects.ObjectContext..ctor(EntityConnection connection)
     at System.Data.Entity.Internal.InternalConnection.CreateObjectContextFromConnectionModel()
     at System.Data.Entity.Internal.LazyInternalConnection.CreateObjectContextFromConnectionModel()
     at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
     at System.Data.Entity.Internal.InternalContext.Initialize()
     at System.Data.Entity.Internal.LazyInternalContext.get_ObjectContext()
     at System.Data.Entity.Internal.InternalContext.ExecuteSqlQuery[TElement](String sql, Nullable`1 streaming, Object[] parameters)
     at System.Data.Entity.Internal.InternalContext.ExecuteSqlQueryAsIEnumerator[TElement](String sql, Nullable`1 streaming, Object[] parameters)
     at System.Data.Entity.Internal.InternalContext.ExecuteSqlQuery(Type elementType, String sql, Nullable`1 streaming, Object[] parameters)
     at System.Data.Entity.Internal.InternalSqlNonSetQuery.GetEnumerator()
     at System.Data.Entity.Infrastructure.DbRawSqlQuery`1.GetEnumerator()
     at System.Linq.Enumerable.FirstOrDefault[TSource](IEnumerable`1 source)
     at IdeaDataAccess.EF.EntityFrameworkQueryPerformer`1.ExecuteScalar(String query)
     at IdeaBusiness.DatabaseCore.Core`2.ExecuteScalar(String query)
     at IdeaBusiness.DatabaseCore.Facade.ExecuteScalar(String query)
     at IdeaComponent.IdeaComponent.IdeaGridView.OnRowCreated(GridViewRowEventArgs e) in D:\Solutions\IdeaCenter\Source Code\IdeaCenterV2\IdeaComponent\Components\GridView\IdeaGridView.vb:line 515
     at System.Web.UI.WebControls.GridView.CreateRow(Int32 rowIndex, Int32 dataSourceIndex, DataControlRowType rowType, DataControlRowState rowState, Boolean dataBind, Object dataItem, DataControlField[] fields, TableRowCollection rows, PagedDataSource pagedDataSource)
     at System.Web.UI.WebControls.GridView.CreateChildControls(IEnumerable dataSource, Boolean dataBinding)
     at System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data)
     at System.Web.UI.WebControls.GridView.PerformDataBinding(IEnumerable data)
     at System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data)
     at System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback)
     at System.Web.UI.WebControls.DataBoundControl.PerformSelect()
     at System.Web.UI.WebControls.BaseDataBoundControl.DataBind()
     at System.Web.UI.WebControls.GridView.DataBind()
     at WebApplication1.WebForm1.Page_Load(Object sender, EventArgs e) in C:\Users\idea\Desktop\New folder\WebForm1.aspx.vb:line 8
     at System.Web.UI.Control.OnLoad(EventArgs e)
     at System.Web.UI.Control.LoadRecursive()
     at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
     InnerException: 
  </code></pre>