首页 新闻 会员 周边

Spring.Net配置

0
悬赏园豆:50 [已关闭问题] 关闭于 2014-07-07 12:05

我从nuget上下了Spring.Core。项目自动添加了Spring.Core.dll和CommonLogin.dll。然后我在app.config里配置Spring的Context及Object。配置如下:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
    <startup>
        <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
    </startup>
    <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">
            <description>An  example that demonstrates simple IoC features.</description>
        </objects>
    </spring>
</configuration>

。结果在var context = ContextRegistry.GetContext()报错。错误内容如下:

Could not configure Common.Logging from configuration section 'common/logging

我不知道这个common.Logging里面到底怎么写的。还有我根本不需要日志。可以不使用日志模块么?我这段Spring配置是从官网的例子中拷贝过来的。还有就是我即便加上

<sectinGroup name=common>

 <section name="loggin" type="..."/>

</sectionGroup>也没用

Sago的主页 Sago | 初学一级 | 园豆:48
提问于:2014-07-05 14:32
< >
分享
所有回答(1)
0

我不知道这个common.Logging里面到底怎么写的。还有我根本不需要日志。可以不使用日志模块么?

不可以,这个东西必须引用,你引用上,再试一下

朝曦 | 园豆:1073 (小虾三级) | 2014-07-05 15:29

我的配置文件中多了一行,<StartUp>标签,这是VS自动生成的。我把这个去了就行了。

支持(0) 反对(0) Sago | 园豆:48 (初学一级) | 2014-07-07 12:05
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册