The provider did not return a providermanifest instance

Posts   
 
    
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 09-Jun-2010 19:57:26   

I'm using LlblGenPro v3.0; VS2010; Dotnet 4.0; Sql Server 2005;

I am new to the entity framework.

  • I create a simple model from my existing database.
  • Set the target framework to Entity Framework v4
  • Generate source code using preset "SD.Entityframework v4 Proxy friendly POCO Entities"
  • Create Win Forms test project, reference the 2 projects generated in prior step.
  • Add app.config from generated code
  • add following code to program.cs before form is invoked

  var ctxt = new CgmDataForklift02DataContext();
  var query = from c in ctxt.IbwComponentDescriptions select c;
   var results = query.ToList();

  • recieve this error at both compile and run time (when I try to look at results). I don't seem to be getting an exception.

Error 1 Error 168: The provider did not return a ProviderManifest instance. Could not determine storage version; a valid storage connection or a version hint is required. C:\Users\arschr\Documents\Visual Studio 2010\Projects\Systemsmiths\Components\Data\Persistence\CgmDataForklift02.edmx 5 4 Cgm.Data.Persistence

The stack trace is:

   at System.Data.Common.DbProviderServices.GetProviderManifest(String manifestToken)
   at System.Data.Metadata.Edm.StoreItemCollection.Loader.InitializeProviderManifest(Action`3 addError)
   at System.Data.Metadata.Edm.StoreItemCollection.Loader.OnProviderManifestTokenNotification(String token, Action`3 addError)
   at System.Data.EntityModel.SchemaObjectModel.Schema.HandleProviderManifestTokenAttribute(XmlReader reader)
   at System.Data.EntityModel.SchemaObjectModel.Schema.HandleAttribute(XmlReader reader)
   at System.Data.EntityModel.SchemaObjectModel.SchemaElement.ParseAttribute(XmlReader reader)
   at System.Data.EntityModel.SchemaObjectModel.SchemaElement.Parse(XmlReader reader)
   at System.Data.EntityModel.SchemaObjectModel.Schema.HandleTopLevelSchemaElement(XmlReader reader)
   at System.Data.EntityModel.SchemaObjectModel.Schema.InternalParse(XmlReader sourceReader, String sourceLocation)
   at System.Data.EntityModel.SchemaObjectModel.Schema.Parse(XmlReader sourceReader, String sourceLocation)
   at System.Data.EntityModel.SchemaObjectModel.SchemaManager.ParseAndValidate(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths, SchemaDataModelOption dataModel, AttributeValueNotification providerNotification, AttributeValueNotification providerManifestTokenNotification, ProviderManifestNeeded providerManifestNeeded, IList`1& schemaCollection)
   at System.Data.Metadata.Edm.StoreItemCollection.Loader.LoadItems(IEnumerable`1 xmlReaders, IEnumerable`1 sourceFilePaths)
   at System.Data.Metadata.Edm.StoreItemCollection.Init(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths, Boolean throwOnError, DbProviderManifest& providerManifest, DbProviderFactory& providerFactory, String& providerManifestToken, Memoizer`2& cachedCTypeFunction)
   at System.Data.Metadata.Edm.StoreItemCollection..ctor(IEnumerable`1 xmlReaders, IEnumerable`1 filePaths)
   at System.Data.Metadata.Edm.MetadataCache.StoreMetadataEntry.LoadStoreCollection(EdmItemCollection edmItemCollection, MetadataArtifactLoader loader)
   at System.Data.Metadata.Edm.MetadataCache.StoreItemCollectionLoader.LoadItemCollection(StoreMetadataEntry entry)
   at System.Data.Metadata.Edm.MetadataCache.LoadItemCollection[T](IItemCollectionLoader`1 itemCollectionLoader, T entry)
   at System.Data.Metadata.Edm.MetadataCache.GetOrCreateStoreAndMappingItemCollections(String cacheKey, MetadataArtifactLoader loader, EdmItemCollection edmItemCollection, Object& entryToken)
   at System.Data.EntityClient.EntityConnection.LoadStoreItemCollections(MetadataWorkspace workspace, DbConnection storeConnection, DbProviderFactory factory, DbConnectionOptions connectionOptions, EdmItemCollection edmItemCollection, MetadataArtifactLoader artifactLoader)
   at System.Data.EntityClient.EntityConnection.GetMetadataWorkspace(Boolean initializeAllCollections)
   at System.Data.EntityClient.EntityConnection.InitializeMetadata(DbConnection newConnection, DbConnection originalConnection, Boolean closeOriginalConnectionOnFailure)
   at System.Data.EntityClient.EntityConnection.Open()
   at System.Data.Objects.ObjectContext.EnsureConnection()
   at System.Data.Objects.ObjectQuery`1.GetResults(Nullable`1 forMergeOption)
   at System.Data.Objects.ObjectQuery`1.System.Collections.Generic.IEnumerable<T>.GetEnumerator()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at WindowsFormsApplication1.Program.Main() in C:\Users\arschr\Documents\Visual Studio 2010\Projects\Systemsmiths\EntityTest\WindowsFormsApplication1\WindowsFormsApplication1\Program.cs:line 20
   at System.AppDomain._nExecuteAssembly(RuntimeAssembly assembly, String[] args)
   at System.AppDomain.ExecuteAssembly(String assemblyFile, Evidence assemblySecurity, String[] args)
   at Microsoft.VisualStudio.HostingProcess.HostProc.RunUsersAssembly()
   at System.Threading.ThreadHelper.ThreadStart_Context(Object state)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state, Boolean ignoreSyncCtx)
   at System.Threading.ExecutionContext.Run(ExecutionContext executionContext, ContextCallback callback, Object state)
   at System.Threading.ThreadHelper.ThreadStart()

Help? I've looked at the Llblgen Entity framework Support Documentation help file, but didn't find anything I could use. Is there a simple walk through available?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39880
Joined: 17-Aug-2003
# Posted on: 09-Jun-2010 22:16:48   

Project properties -> Output setting values -> in there specify a value for ProvidermanifestTokenValue (e.g. '2008')

walkthrough: http://www.xs4all.nl/~perseus/LLBLGenPro/Videos/v3.0/LLBLGen%20Pro%20with%20EF4.html

(video 12 minutes simple_smile )

Frans Bouma | Lead developer LLBLGen Pro
arschr
User
Posts: 894
Joined: 14-Dec-2003
# Posted on: 09-Jun-2010 22:40:32   

Project properties -> Output setting values -> in there specify a value for ProvidermanifestTokenValue (e.g. '2008')

Thanks, putting in 2005 seems to work.

Couldn't LlblGen fill this project property based on the connection used to reverse engineer the database?

Otis avatar
Otis
LLBLGen Pro Team
Posts: 39880
Joined: 17-Aug-2003
# Posted on: 09-Jun-2010 23:47:43   

arschr wrote:

Project properties -> Output setting values -> in there specify a value for ProvidermanifestTokenValue (e.g. '2008')

Thanks, putting in 2005 seems to work.

Couldn't LlblGen fill this project property based on the connection used to reverse engineer the database?

It is important that the setting is set by the user, what we can do is validate for it in the EF validator. I think I'll add a rule for that.

Frans Bouma | Lead developer LLBLGen Pro
Otis avatar
Otis
LLBLGen Pro Team
Posts: 39880
Joined: 17-Aug-2003
# Posted on: 10-Jun-2010 15:09:09   

This rule is added in the next build.

Frans Bouma | Lead developer LLBLGen Pro