Unable to retrieve metadata

Unable to retrieve metadata

Postby edstaffin » Fri 14 Jun 2013 13:02

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
edstaffin
 
Posts: 43
Joined: Mon 13 Oct 2008 13:23

Re: Unable to retrieve metadata

Postby Shalex » Tue 18 Jun 2013 15:53

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.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: Unable to retrieve metadata

Postby ZioLuca » Thu 20 Jun 2013 09:37

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
ZioLuca
 
Posts: 4
Joined: Thu 20 Jun 2013 09:17

Re: Unable to retrieve metadata

Postby Shalex » Tue 25 Jun 2013 14:28

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.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44

Re: Unable to retrieve metadata

Postby ZioLuca » Wed 26 Jun 2013 16:26

I send you a zip file with solution and db scripts.

Regards,
Luca
ZioLuca
 
Posts: 4
Joined: Thu 20 Jun 2013 09:17

Re: Unable to retrieve metadata

Postby tjdecker » Fri 20 Sep 2013 17:32

I running into the same issue. Has this been resolved yet?
tjdecker
 
Posts: 1
Joined: Fri 20 Sep 2013 17:30

Re: Unable to retrieve metadata

Postby Shalex » Wed 25 Sep 2013 10:33

Here is a solution we have sent to ZioLuca:

We have reproduced the error. This issue was discussed at http://stackoverflow.com/questions/12323307/error-when-creating-a-controller-in-visual-studio-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.
Shalex
Devart Team
 
Posts: 7780
Joined: Thu 14 Aug 2008 12:44


Return to dotConnect for Oracle