Page 1 of 1

Unable to retrieve metadata

Posted: Fri 14 Jun 2013 13:02
by edstaffin
Hi,

I am using version 7.4.146

I am setting up a new MVC4 application using devart to connect to oracle. I have a single context and model. I have been able to instantiate a db context and query the db. So I know I have my connection info right. However, when I try to create a controller for my one and only model, I get:

Unable to retrieve metadata for 'my db'. Using the same DbCompiledModel to create contexts against different types of database servers is not supported. Instead, use a separate DbCompiledModel for each type of server being used.

I have no idea what this means or what I can do about it.
Please help.
Thanks ... Ed

Re: Unable to retrieve metadata

Posted: Tue 18 Jun 2013 15:53
by Shalex
We cannot reproduce the problem at the moment. Please give us the following information:
1. Are you using Devart Entity Model (*.emdl) or ADO.NET Entity Data Model (*.edmx)?
2. Specify the template (-s) used in your model.
3. Tell us the version of your Entity Framework.
4. Does the problem persist with the latest (7.7.257) build of dotConnect for Oracle?
5. Send us a small test project and specify the steps we should follow to reproduce the issue in our environment.

Re: Unable to retrieve metadata

Posted: Thu 20 Jun 2013 09:37
by ZioLuca
I'm trying the Devart library for oracle and I have the same problem.

The problem occur when I try to insert a new controller class with all methods and views. If I insert a controller without views the class is created and the controller works fine.

I don't need that VS create for me views and all the methods but the error give me a worry that somethings is wrong inside the project or in the library.

I'm using the version 7.7.257.0 and my project has the following :
- Visual Studio 2012, EF 5 and MVC 4
- Build with code first and api fluent configuration classes.
- Use ORACLE EXPRESS 11G.
- Use SimpleMembership API provided by Devart.Common.Web namespace.

Thanks for any help/explanation.

Regards,
Luca

Re: Unable to retrieve metadata

Posted: Tue 25 Jun 2013 14:28
by Shalex
Please send us a small test project (with the SQL scripts if needed) and specify the steps we should follow to reproduce the issue in our environment.

Re: Unable to retrieve metadata

Posted: Wed 26 Jun 2013 16:26
by ZioLuca
I send you a zip file with solution and db scripts.

Regards,
Luca

Re: Unable to retrieve metadata

Posted: Fri 20 Sep 2013 17:32
by tjdecker
I running into the same issue. Has this been resolved yet?

Re: Unable to retrieve metadata

Posted: Wed 25 Sep 2013 10:33
by Shalex
Here is a solution we have sent to ZioLuca:

We have reproduced the error. This issue was discussed at http://stackoverflow.com/questions/1232 ... tudio-2012.

Open your Web.config and add an additional connection string to SQL Server, e.g.:

Code: Select all

<add name="Workaround" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=MvcMusicStore;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\MvcMusicStore.mdf" providerName="System.Data.SqlClient" />
Then replace
"public MyDbContext(): base("name=MyDbContext")"
in Models/MyDbContext.cs with
"public MyDbContext(): base("name=Workaround")"
and generate controllers.

After this, use the MyDbContext connection string in Models/MyDbContext.cs again.[/i]