Spring.Context.Support.ContextRegistry”的类型初始值设定项引发异常

tcwxx 2011-01-28 02:33:29
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Spring.Context;
using Spring.Context.Support;

namespace HelloWorld
{
class Program
{
static void Main(string[] args)
{
IApplicationContext context = ContextRegistry.GetContext();
Hello hello = (Hello)context.GetObject("hello");
System.Console.Out.WriteLine(hello.HelloWord);
System.Console.In.Read();
}
}
}



<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<configSections>
<sectionGroup name="spring">
<section name="context" type="Spring.Context.Support.ContextHandler, Spring.Core"/>
</sectionGroup>
</configSections>

<spring>
<context>
<resource uri="config://spring/objects"/>
</context>
<objects xmlns="http://www.springframework.net">
<object id="hello" type="HelloWorld.Hello">
<property name="HelloWord" value="Hello!Welcome to Spring.Net Word!"/>
</object>
</objects>


</spring>
</configuration>


为什么总是报异常呢???
总是说Spring.Context.Support.ContextRegistry”的类型初始值设定项引发异常
郁闷一天了。。。哪位大侠帮帮忙啊!!
...全文
565 5 打赏 收藏 转发到动态 举报
写回复
用AI写文章
5 条回复
切换为时间正序
请发表友善的回复…
发表回复
tianya0 2011-09-30
  • 打赏
  • 举报
回复
请确认Spring.NET的面向的.NET Framework的版本,是否与你当前应用程序一致。

我的将应用程序是 .NET Framework 4.0,引用的 Spring.NET 是.NET Framework2.0的,结果和你一样出错。

wuyq11 2011-01-28
  • 打赏
  • 举报
回复
http://hi.baidu.com/ybhjj/blog/item/6fd358f8efb09703d8f9fdc6.html
tcwxx 2011-01-28
  • 打赏
  • 举报
回复
~~~~大侠们~!!!
tcwxx 2011-01-28
  • 打赏
  • 举报
回复
没人么???
tcwxx 2011-01-28
  • 打赏
  • 举报
回复
在线等~~~!!!!我用的是vs2010 跟这个有关系么?我引用的也是4.0的Spring.Core.dll ,一运行就报这个异常。。。郁闷。。

110,571

社区成员

发帖
与我相关
我的任务
社区描述
.NET技术 C#
社区管理员
  • C#
  • Web++
  • by_封爱
加入社区
  • 近7日
  • 近30日
  • 至今
社区公告

让您成为最强悍的C#开发者

试试用AI创作助手写篇文章吧