Spring.NET使用assembly方式设置配置文件

 

1、创建object.xml文件

2、写入xml文件的代码:

<?xml version="1.0" encoding="utf-8" ?>

<objects xmlns="http://www.springframework.net"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:schemaLocation="http://www.springframework.net
        http://www.springframework.net/xsd/spring-objects.xsd">

    <object name="PersonDao" type="TSpring.MyDao.PersonDao, TSpring.MyDao">
    </object>

</objects>

*****3、将object.xml文件属性“生成操作”设置为:嵌入的资源

第三步非常重要,如果不变更文件的属性,会在运行时报错:Error creating context 'spring.root'

posted @ 2013-05-02 17:48  liyuzhao  阅读(638)  评论(0编辑  收藏  举报