Multiple Configuration Files - error in forward mapping dialog

4 posts, 0 answers
  1. David Hollins
    David  Hollins avatar
    15 posts
    Member since:
    Dec 2009

    Posted 29 Jul 2010 Link to this post

    I am trying to separate the configuration files specific to my particular libraries but the Forward Mapping Wizard doesn't like them to be separated.  It is giving errors even though I followed the example here.

    It is complaining about missing connection section and mappings section.  Do ALL configuration files have to have those sections in them to work properly?

    Any help would be appreciated!
  2. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 03 Aug 2010 Link to this post

    Hi David Hollins,
    You could look at this code library - “Using Multiple Data-Models”, which demonstrates how to distribute the configuration information over several config files.
    Every configuration file should contain information for the class mappings but it is not necessary to contain information for the connection settings. A mapping section describes how your persistent classes are mapped to tables and columns in the database. If no connection strings are specified OpenAccess will try to follow the references defined under the <references> node and obtain this information from the referenced config files.
    Hope you will find useful the provided example. 

    Regards,
    Damyan Bogoev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
  3. DevCraft banner
  4. David Hollins
    David  Hollins avatar
    15 posts
    Member since:
    Dec 2009

    Posted 04 Aug 2010 Link to this post

    The connection information isn't the problem that it is hanging up on.  It is the fact that the mapping for some of the classes is in the other configuration file and NOT in this configuration file.

    So essentially, how can an object in one library having its own configuration file reference an object in another library which is mapped an an entirely different configuration file?
  5. Damyan Bogoev
    Admin
    Damyan Bogoev avatar
    581 posts

    Posted 06 Aug 2010 Link to this post

    Hello David Hollins,

    I have prepared a sample application which demonstrates the approach you want to use. There are two class libraries, each with one class:
    - ClassLibrary1.Account;
    - ClassLibrary2.Region;
    The mapping for the Region class is placed within the ClassLibrary1.App.config. You should only reference the assemblies which contain the mapping information within the executing application’s configuration file:

    <references>
          <reference assemblyname="ClassLibrary1" configrequired="True" />
          <reference assemblyname="ClassLibrary2" configrequired="True" />
    </references>

    Hope you will find useful the provided information and example.

    Greetings,
    Damyan Bogoev
    the Telerik team
    Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items
Back to Top