<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<section name="unity" type="Microsoft.Practices.Unity.Configuration.UnityConfigurationSection,Microsoft.Practices.Unity.Configuration"/>
</configSections>
<unity xmlns="http://schemas.microsoft.com/practices/2010/unity">
<container>
<!--register type="full class name,namespace"-->
<register type="UnityTest.ISqlHelper,UnityTest" mapTo="UnityTest.MysqlHelper,UnityTest">
<lifetime type="singleton"/>
</register>
</container>
</unity>
</configuration>
注:<configSection><section name="unity" .....> </configSection>必须放在配置文件第一个