Unable to load the specified metadata resource

Discussion of open issues, suggestions and bugs regarding Entity Developer - ORM modeling and code generation tool
Post Reply
lonker
Posts: 3
Joined: Sun 19 Apr 2009 06:59

Unable to load the specified metadata resource

Post by lonker » Sun 19 Apr 2009 07:19

I'm using Entity Developer for "dotConnect for Oracle", have trouble as below:

1.Create project in Entity Developer by \menu\Create from Database\Entity Framework

2.setup all properties about connection(I use Direct=False)

3.make a connection successfully.

4.press next and selected tables

5.keep the namespace & name of Entity Model as default

6.press next to create

7.shown "Wizard finished successfully"

8.check "Run generator for model" & selected Template = Entity Visual Basic, set Destination Folder as my \VS2008 project folder\app_code

9.click Finish

10.I can see 4 files created in my \VS2008 project folder\app_code:

xxx.csdl
xxx.msl
xxx.ssdl
xxx.vb

11.my code as below, will get an error while running:
"Unable to load the specified metadata resource", how can I do?

Code: Select all

Imports Devart.Data.Oracle, System.Data, Opennodesmodel

Protected Sub ButtonCheckPass_Click(ByVal sender As Object, ByVal e As System.EventArgs) Handles ButtonCheckPass.Click

Dim con As OPENNODESEntities = New OPENNODESEntities

Dim query = From it In con.SiteUsers Where it.UserId = "A9" Select it

Dim user As Opennodesmodel.SiteUser
    For Each user In query
        If user.Password = FormsAuthentication.HashPasswordForStoringInConfigFile("12301230", "SHA1") 
        Then
            Label1.Text = "pass!"
        Else
            Label1.Text = "error!"
        End If
    Next
End Sub

I did try to put the connectionString in to web.config, but still get the same error message. please help me!

Thanks!

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 22 Apr 2009 08:43

The upcoming build of Entity Developer will contain the advanced Visual Studio integration, including the Web projects.
The best solution so far is to create context in your code using the modified connection string, like in the following example:

Code: Select all

Dim con As DataSourceModel.DataSourceModel = new DataSourceModel.DataSourceModel("metadata=~/App_Code/DataSourceModel.csdl|~/App_Code/DataSourceModel.ssdl|~/App_Code/DataSourceModel.msl;provider=Devart.Data.Oracle;provider connection string=\"User Id=***;Password=***;Server=***;Persist Security Info=True\"")

lonker
Posts: 3
Joined: Sun 19 Apr 2009 06:59

Post by lonker » Wed 22 Apr 2009 17:18

thanks for reply, but

message change:

Schema specified is not valid. Errors:
Devart.Data.Oracle.Entity.StoreSchemaDefinition.ssdl(2,69) : error 0169: All SSDL artifacts must target the same provider. The ProviderManifestToken 'ORA' is different from 'Ora11g' that was encountered earlier.

When I use Entity + Linq with Devart, very unstable with some error with no rule:

An attempt was made to load a program with an incorrect format.(Exception from HRESULT:0x8007000B)

Attempted to read or write protected memory. This is often an indication that other memory is corrupt.

Until now, I can't find out any rules stable for Entity solutions.

ps.my database is Oracle 11g, does it work fine with this?

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 23 Apr 2009 10:54

Please send us a small test project illustrating this problem.

lonker
Posts: 3
Joined: Sun 19 Apr 2009 06:59

Post by lonker » Sat 02 May 2009 12:18

The probleam is solved when I use v5.20.29.

Thank you very much.

Projekt2501
Posts: 7
Joined: Thu 11 Sep 2008 08:45

Post by Projekt2501 » Sat 02 May 2009 19:46

The problem persists for me and the workaround did not work.
I am using the most current installer for MySQL (v5.20.29 / 2.0.18) and Vista64 + VS2008.

Any further suggestions?

Best Regards

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Tue 05 May 2009 11:50

What problem are you facing (the one with paths or the one with ProviderManifestToken?)?

Projekt2501
Posts: 7
Joined: Thu 11 Sep 2008 08:45

Post by Projekt2501 » Tue 05 May 2009 16:24

I face the problem with the pathes. Just to make sure that it is clear that I use dotConnect for MySql.

This happens in both cases when I use Entitity Developer to manually create the files and when I use the Visual Studio integration. Preferably I would like to use the VS integration.

For a hint a workaround I would be very greatful.

Best Regards
Timo Griese

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Wed 06 May 2009 13:03

The steps for using VS integration:
1. Create the App_Code folder in your Web Site.
2. Add Devart Entity Model into this folder.
3. Create your model (either using drag&drop from Database Explorer or using the Create from database... option).
4. Save the model.
5. Go back to Visual Studio and make sure that the Model.Designer.cs, Model.csdl, Model.ssdl, and Model.msl files were created.
You may need to press the Refresh button in your Solution Explorer to view the changes.
You might experience a problem on the 4th step, like the "Project unavailable" error. You will need to save the project and reopen Visual Studio.
After making these steps a correct model should be created.
We have sent you the test web site.

Projekt2501
Posts: 7
Joined: Thu 11 Sep 2008 08:45

Post by Projekt2501 » Wed 06 May 2009 19:07

The website you sent me worked fine. Unfortunately I do not use that project type.

My project types are Web-applications (not websites), console applications and wcf web-services.

None of the named works out.

I posted you an example project to illustrate what I get when using a default console application and add a Devart Entity Model.
Hopefully it will help to find out what went wrong.

Test-Project:
http://www.griese-medien.info/ConsoleApplication1.zip

Best Regards
Timo Griese

AndreyR
Devart Team
Posts: 2919
Joined: Mon 07 Jul 2008 13:16

Post by AndreyR » Thu 07 May 2009 11:14

Thank you for the report, we have reproduced the problem.
As a temporary workaround, try to set the Metadata Artifact Processing property of the model to CopyToOutputDirectory.
This should fix the problem.

Projekt2501
Posts: 7
Joined: Thu 11 Sep 2008 08:45

Post by Projekt2501 » Thu 07 May 2009 11:58

The workaround worked out. Thanks!

I am already exited about the upcoming version :)

Best Regards
Timo Griese

Post Reply