Page 1 of 1

Code first with CTP5 error??

Posted: Thu 27 Jan 2011 15:12
by stienessen
I'm attempting to create a code-first model to support both Oracle and SQL Server - I have the SQL side working, however with an eval of the devart provider I'm getting the following with Oracle... any ideas what I'm doing wrong?

The server encountered an error processing the request. The exception message is 'Schema specified is not valid. Errors: (8,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (9,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (10,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (11,6) : error 0040: The Type date is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (19,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (20,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (21,6) : error 0040: The Type date is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (28,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (29,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (30,6) : error 0040: The Type blob is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (31,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (32,6) : error 0040: The Type date is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification. (40,6) : error 0040: The Type varchar2 is not qualified with a namespace or alias. Only PrimitiveTypes can be used without qualification.'. See server logs for more details. The exception stack trace is:

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) at System.Data.Entity.ModelConfiguration.Edm.Db.DbDatabaseMetadataExtensions.ToStoreItemCollection(DbDatabaseMetadata database, Action`1 storeAction) at System.Data.Entity.ModelConfiguration.Edm.Db.Mapping.DbDatabaseMappingExtensions.ToMetadataWorkspace(DbDatabaseMapping databaseMapping, Action`1 storeAction) at System.Data.Entity.Internal.CodeFirstCachedMetadataWorkspace.GetMetadataWorkspace(DbConnection connection) at System.Data.Entity.Infrastructure.DbModel.CreateObjectContext[TContext](DbConnection existingConnection) at System.Data.Entity.Internal.LazyInternalContext.InitializeContext() at System.Data.Entity.Internal.LazyInternalContext.get_ObjectContext() at AmCom.Services.Model.Meta.TenantModel.op_Implicit(TenantModel ctx) in C:\Users\daves\Documents\Visual Studio 2010\Projects\DataServicesWebApp\AmCom.Services.Model\Meta\TenantModel.cs:line 49 at WcfService1.TenantService.CreateDataSource() in C:\Users\daves\Documents\Visual Studio 2010\Projects\DataServicesWebApp\WcfService1\TenantService.svc.cs:line 41 at System.Data.Services.DataService`1.CreateProvider() at System.Data.Services.DataService`1.HandleRequest() at System.Data.Services.DataService`1.ProcessRequestForMessage(Stream messageBody) at SyncInvokeProcessRequestForMessage(Object , Object[] , Object[] ) at System.ServiceModel.Dispatcher.SyncMethodInvoker.Invoke(Object instance, Object[] inputs, Object[]& outputs) at System.ServiceModel.Dispatcher.DispatchOperationRuntime.InvokeBegin(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage5(MessageRpc& rpc) at System.ServiceModel.Dispatcher.ImmutableDispatchRuntime.ProcessMessage31(MessageRpc& rpc) at System.ServiceModel.Dispatcher.MessageRpc.Process(Boolean isOperationContextSet)

Posted: Thu 27 Jan 2011 16:28
by Remco Blok
this will solve that

modelBuilder.Conventions.Remove();

Posted: Fri 28 Jan 2011 11:40
by AndreyR
Remco Blok, thank you for sharing your knowledge.
This is absolutely correct, removing this convention should solve the problem.

Posted: Wed 02 Mar 2011 11:58
by AndreyR
We have posted an article about CTP 5 support in our blog. It contains some information about Code First and Database creation, and some samples as well.