先引入关键的程序集
Common.Logging.dll
Spring.Core.dll
在配置文件配置中:
<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.1Spring.NETdocschema 下的 spring-objects-1.3.xsd 复制到新建的文件夹,是为了配置有智能提示。