Archived Support Site

This support site is archived. You can view the old support discussions but you cannot post new discussions.

Getting this error : Keyword not supported: 'server'.

I am having problem with my Entity framework connection string, this is the connection string i am using but I keep getting this error:

Connection string:

  <add name="ElraProject1Container"

connectionString="metadata=res:///Models.ElraProject1.csdl|res:///Models.ElraProject1.ssdl|res://*/Models.ElraProject1.msl;

        provider=System.Data.SqlClient; provider connection string='Server=dbXXX.appharbor.net;
        Initial Catalog=Test;User ID=db0000; Password=PASSWORD;MultipleActiveResultSets=True'"

providerName="System.Data.EntityClient" />

Error message :

[ArgumentException: Keyword not supported: 'server'.]

I would like to point out that this connection works perfectly fine on localhost but not appharbor !

Showing page 2 of 2. View the first page

  1. This is the error text :

    504 Gateway Time-out

    nginx/0.8.54

  2. What's the url?

  3. I can not say the URL as this is a business related project.

    Thanks

  4. We have changed the load balancer timeout limit, are you still seeing 504's?

  5. The 504 Gateway time-out is now gone but I am now getting the same old error as before.

  6. Have you tried James Arceri suggestion above?

  7. If you are getting the metadata keyword error it is because EF can't locate the resource embedded in your assembly.
    Please see my previous post.

    -----Original Message-----
    From: Michael Friis [mailto:[email blocked]]
    Sent: Sunday, April 03, 2011 3:24 PM
    To: [email blocked]
    Subject: Re: Getting this error : Keyword not supported: 'server'. [Support]

  8. Example of connectionstring:

    <connectionStrings>
            <add name="yourenitites" connectionString="
                 metadata=
    res://assemblyname/resourcename.csdl|
    res://assemblyname/resourcename.ssdl|
    res://assemblyname/resourcename.msl;
    provider=System.Data.SqlClient;provider
    connection string=&quot;data source=*.*.*.*;
    initial catalog=databasename;persist security info=True;
    user id=user;password=password;multipleactiveresultsets=True;App=EntityFramework&quot;"
    providerName="System.Data.EntityClient" />
        </connectionStrings>

    -----Original Message-----
    From: james.arceri [mailto:[email blocked]]
    Sent: Sunday, April 03, 2011 3:45 PM
    To: [email blocked]
    Subject: Re: Getting this error : Keyword not supported: 'server'. [Support]

  9. Don't use the namesspace use the assembly name!

    -----Original Message-----
    From: james.arceri [mailto:[email blocked]]
    Sent: Sunday, April 03, 2011 4:18 PM
    To: [email blocked]
    Subject: Re: Getting this error : Keyword not supported: 'server'. [Support]

  10. Hi james.arceri

    I tried what you mentioned, used the Assembly name instead of * but it didn't fix it.

  11. Run reflector on that assembly and make sure that the resources are embedded.

    -----Original Message-----
    From: rahamohebbi [mailto:[email blocked]]
    Sent: Monday, April 04, 2011 6:10 AM
    To: [email blocked]
    Subject: Re: Getting this error : Keyword not supported: 'server'. [Support]

  12. I looked at it and all three of them are in the Resources folder ! :(
    Could it be because I am using edmx model file ?

    This is how my constructor for edmx class looks like :

        public ElraProject1Container() : base("name=ElraProject1Container")
        {
            this.ContextOptions.LazyLoadingEnabled = true;
            OnContextCreated();
        }
    
  13. No, the resources for the edmx file should still work embedded in the assembly. This is the approach I am using, hence why I figured out how to fix the error to begin with. One thing you might also want to check is your other config files. For instance if you have a project setup like this.

    Data
    -- App.Config
    -- EDMX file
    -- DBContext classes
    -- POCOS
    -- Interfaces for repository etc.. IRepository.cs

    The App.config will have a connections string that EF builds for you. Usually with res://* etc.. which means that the assembly will be scanned for resources at runtime. This is not usually problematic since it is the only assembly being loaded and the resources are found.

    When dealing with other layers, say for instance you have another project that sits between your data and your web application. Like:
    DataMapping
    --App.config
    -- Repository.cs

    The App.config for this layer needs to be the same as the previous layer

    Now, once you throw the web layer on top of all this:
    --Web.config (Same connection string as the other app configs pointing to assemblyname/resource.csdl| etc..

    Make sure that you add a reference to the web project that points to the layer with the edmx file in in. This assembly should be in the bin directory of the web application if you are calling it from the web application.

    -----Original Message-----
    From: rahamohebbi [mailto:[email blocked]]
    Sent: Monday, April 04, 2011 7:56 AM
    To: [email blocked]
    Subject: Re: Getting this error : Keyword not supported: 'server'. [Support]

  14. Thanks for your explanations james.arceri.

    I only have one layer for now, however I have created many ASP .net MVC Areas to split the project into logical parts. For instance the place where I am getting this error is in Admin Area.

  15. Try it without areas. Areas are well broken right now in MVC, unless you want to do some whiz bang routing fixups.
    Test to the lowest common denominator.

    -----Original Message-----
    From: rahamohebbi [mailto:[email blocked]]
    Sent: Monday, April 04, 2011 8:36 AM
    To: [email blocked]
    Subject: Re: Getting this error : Keyword not supported: 'server'. [Support]

  16. RE: Keyword not supported: 'server'.

    In my case, appharbor was altering my connectionString in my web.config. All I had to do was change the Connection string name to a name that was different than the Connection string name associated with the connection string that appharbor provides for your database.

    My connection string looked similar to this [one] (http://support.appharbor.com/discussions/problems/309-getting-this-...).

    But appharbor was changing it to something like this: Server=xxx.appharbor.net;Database=dbxxxx;User ID=dbxxxx;Password=xxxxxxi;

  17. For clarification on my previous post:

    In appharbor application settings -> database you'll find this section:

    Connect with database management tool

    Host: db.appharbor.net
    Username: db
    Password: password

    Connection string name: FooConnString <-- Don't use this name for your EDMX unless you want appharbor to override your connection string.

  18. Thanks for sharing Joshua!

  19. friism closed this discussion on 19 Apr, 2011 01:57 AM.

  20. james.arceri re-opened this discussion on 19 Apr, 2011 12:05 PM

  21. If there is an issue with the a portal tpe service for hosting having a dependency on a particular configuration, in this case a connection string, you could always use the connection string builder in your code to build the connection string that points to your edmx files.

    -----Original Message-----
    From: Michael Friis [mailto:[email blocked]]
    Sent: Monday, April 18, 2011 8:58 PM
    To: [email blocked]
    Subject: Re: Getting this error : Keyword not supported: 'server'. [Support]

  22. friism closed this discussion on 19 Apr, 2011 04:42 PM.

Discussions are closed to public comments.
If you need help with AppHarbor please start a new discussion.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac