配置Spring.NET

先引入關鍵的程序集spring

Common.Logging.dllspa

Spring.Core.dll.net

在配置文件配置中:code

 <configSections>

       ......

       <sectionGroup name="spring">
            <section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
            <section name="objects" type="Spring.Context.Support.DefaultSectionHandler, Spring.Core"/>
       </sectionGroup>

 </configSections>


<spring>
    <context>
      <resource uri="config://spring/objects" />
    </context>

    <objects xmlns="http://www.springframework.net"><!--xmlns屬性就是配置提示的-->
      <object id="BLL" type="BLLA.Ou_Permission,BLLA"  singleton="false" ></object>
      <object id="BLLSession" type="BLLA.BLLSession,BLLA" singleton="false"></object>
      <object id="DBSessFactory" type="DALMSSQL.DBSessionFactory,DALMSSQL"></object>
    </objects>

</spring>

而後在項目下建個文件夾,將spring.net解壓後: Spring.NET-1.3.1\Spring.NET\doc\schema 下的 spring-objects-1.3.xsd 複製到新建的文件夾,是爲了配置有智能提示。xml

相關文章
相關標籤/搜索