tags:

views:

371

answers:

1

SOLVED!!!! Thanks for your help

I'm kinda lost here, I'd like to remove all the Spring.NET configuration outside Web.Config but I cant figure out how to put my typeAliases.

I'll appreciate all the help you can give me.

Thanks.

+1  A: 

You can register type aliases either in app.config/web.config:

  <configSections>
    <sectionGroup name="spring">
      <section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
      <section name="typeAliases" type="Spring.Context.Support.TypeAliasesSectionHandler, Spring.Core"/>
    </sectionGroup>
  </configSections>

  <spring>
    <typeAliases>
      <alias name="Prog" type="MyNs.Program, MyLibrary" />
    </typeAliases>

    <context>
      <resource uri="context.xml"/>
    </context>
  </spring>

Or in a spring configuration file by adding a definition for the Spring.Objects.Factory.Config.TypeAliasConfigurer object:

<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net"&gt;

  <object id="program" type="Prog" />


  <object id="myTypeAlias" type="Spring.Objects.Factory.Config.TypeAliasConfigurer, Spring.Core">
    <property name="TypeAliases">
      <dictionary>
        <entry key="Prog" value="MyNs.Program, MyLibrary"/>
      </dictionary>
    </property>
  </object>

</objects>

You will find this in the documentation.

Darin Dimitrov