This is a migrated thread and some comments may be shown as answers.

Multiple Configuration Files - error in forward mapping dialog

3 Answers 63 Views
Design Time (Visual Designer & Tools)
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
David Hollins
Top achievements
Rank 1
David Hollins asked on 29 Jul 2010, 08:58 PM
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!

3 Answers, 1 is accepted

Sort by
0
Damyan Bogoev
Telerik team
answered on 03 Aug 2010, 08:00 AM
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
0
David Hollins
Top achievements
Rank 1
answered on 04 Aug 2010, 04:08 PM
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?
0
Damyan Bogoev
Telerik team
answered on 06 Aug 2010, 02:45 PM
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
Tags
Design Time (Visual Designer & Tools)
Asked by
David Hollins
Top achievements
Rank 1
Answers by
Damyan Bogoev
Telerik team
David Hollins
Top achievements
Rank 1
Share this question
or