<?xml version="1.0" encoding="utf-8"?> <configuration> <!--一定要在紧跟着configuration下面添加--> <configSections> <!--跟下面Spring.Net节点配置是一一对应关系--> <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.Net节点配置--> <spring> <context> <!--容器配置--> <resource uri="config://spring/objects"/> </context> <objects xmlns="http://www.springframework.net"> <!--这里放容器里面的所有节点--> <description>这里放容器里面的所有节点</description> <!--name 必须要唯一的,type=类的全名称,所在的程序集--> <object name="Bank50" type="cropay.Service.Bank50, cropay.Service"></object> <object name="Bank51" type="cropay.Service.Bank51, cropay.Service"></object> <object name="Bank53" type="cropay.Service.Bank53, cropay.Service"></object> </objects> </spring> <system.web> <compilation debug="true" targetFramework="4.7.1" /> <httpRuntime targetFramework="4.7.1" /> </system.web> </configuration>