今天编写String.Net时,遇到“System.TypeInitializationException”类型的未经处理的异常在 Spring.NetDemo.exe 中发生

原因配置文件的顺序写错

原顺序:

 <configuration>
<startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</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>
<!--Spring.Net对象容器的配置-->
<context>
<!--容器里所有对象在哪里配置?-->
<resource uri="config://spring/objects"/>
</context> <!--objects:配置的容器的里面的对象-->
<objects xmlns="http://www.springframework.net" >
<description>An example that demonstrates simple IoC features.</description>
<object name="UserInfoDal" type="Spring.NetDemo.UserInfoDal, Spring.NetDemo" singleton="false" > </object>
</objects>
</spring> </configuration>

改正后的顺序为:

  <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>
<!--Spring.Net对象容器的配置-->
<context>
<!--容器里所有对象在哪里配置?-->
<resource uri="config://spring/objects"/>
</context> <!--objects:配置的容器的里面的对象-->
<objects xmlns="http://www.springframework.net" >
<description>An example that demonstrates simple IoC features.</description>
<object name="UserInfoDal" type="Spring.NetDemo.UserInfoDal, Spring.NetDemo" singleton="false" > </object>
</objects>
</spring> <startup>
<supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
</startup>

String.Net “System.TypeInitializationException”类型的未经处理的异常在 Spring.NetDemo.exe 中发生的更多相关文章

  1. “System.BadImageFormatException”类型的未经处理的异常在 PurchaseDevices.Access.dll 中发生 其他信息: 未能加载文件或程序集“System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139”或它的某一个依赖项。试图加载格式不正确

    引用sqlite的程序集时,有时会报如下异常:  "System.BadImageFormatException"类型的未经处理的异常在 PurchaseDevices.Acces ...

  2. P/Invoke出现错误 System.NullReferenceException”类型的未经处理的异常在 未知模块。 中发生 未将对象引用设置到对象的实例。

    问题 “System.NullReferenceException”类型的未经处理的异常在 未知模块. 中发生 未将对象引用设置到对象的实例. 解决方案 1.尝试 用管理员身份运行CMD,输入nets ...

  3. System.AccessViolationException”类型的未经处理的异常在 System.Data.dll 中发生。其它信息:尝试读取或写入受保护的内存。这通常指示其它内存已损坏。

    错误背景: 操作系统:编程环境:VS2013.  语言:VB.net:  数据库:SQLserver2008 做数据库连接时.发生的错误: 错误提示为: 说明:用VB.net连接SQLServer数据 ...

  4. 使用C#在VS中开发:未处理AccessViolationException “System.AccessViolationException”类型的未经处理的异常

    未处理AccessViolationException: “System.AccessViolationException”类型的未经处理的异常在System.Data.dll中发生 其他信息:尝试读 ...

  5. “System.FormatException”类型的未经处理的异常在 System.IdentityModel.dll 中发生 其他信息: 十六进制字符串格式无效。

    如果你的 WebService 客户端证书配置都没问题,唯独调用接口会出现这个错误 “System.FormatException”类型的未经处理的异常在 System.IdentityModel.d ...

  6. c#重命名文件,报错“System.NotSupportedException”类型的未经处理的异常在 mscorlib.dll 中发生”

    修改远程服务器的文件名,报错“System.NotSupportedException”类型的未经处理的异常在 mscorlib.dll 中发生”,“System.NotSupportedExcept ...

  7. “System.InvalidOperationException”类型的未经处理的异常在 ESRI.ArcGIS.AxControls.dll 中发生

    问题描述: 新手们进行ArcGIS ArcObject开发时经常会遇到各种十分古怪的问题,比如下面的这个问题: “System.InvalidOperationException”类型的未经处理的异常 ...

  8. EF异常:“System.InvalidOperationException”类型的未经处理的异常在 mscorlib.dll 中发生

     实体框架System.Data.Entity.SqlServer提供者类型”. SqlProviderServices EntityFramework. 的在应用程序配置文件注册状态"置疑 ...

  9. 使用过多的递归出现错误,“System.StackOverflowException”类型的未经处理的异常在 mscorlib.dll 中发生

    class Program { static void Main(string[] args) { sub(0); }     private static void sub(int count) { ...

随机推荐

  1. BZOJ 5004: 开锁魔法II 期望 + 组合

    Description 题面:www.lydsy.com/JudgeOnline/upload/task.pdf Input Output 一般概率题有两种套路: 满足条件的方案/总方案. 直接求概率 ...

  2. k8s的node节点,执行kubectl get XXX报错

    报错现象: [root@localhost ~]# kubectl get nodes The connection to the server localhost:8080 was refused ...

  3. (79)【按键】[独立按键] - 1: 单击,双击,三击以及N击

    此按键程序的实现的功能是单个独立按键的[单击],[长按],[双击],[三击]以及[多击].本文分为三个部分, 第一个部分是说[单击],[长按]的程序: 第二部分是讲[双击]: 第三部分是讲[三击],[ ...

  4. 1.Python编程基础

    1. 其实,程序指的就是一系列指令,用来告诉计算机做什么,而编写程序的关键在于,我们需要用计算机可以理解的语言来提供这些指令. 虽然借助 Siri(Apple).Google Now(Android) ...

  5. npm安装源修改为淘宝源

    npm安装源修改为淘宝源 标签(空格分隔): 编译 原:https://cnodejs.org/topic/4f9904f9407edba21468f31e npm安装源修改为淘宝源 镜像使用方法(三 ...

  6. Canvas 实现钟表

    <!DOCTYPE html> <html lang="en"> <head> <meta charset="UTF-8&quo ...

  7. shift、unshift、 push、pop用法

    shift()定义和用法 shift() 方法用于把数组的第一个元素从其中删除,并返回第一个元素的值. 语法:arrayObject.shift() 返回值:数组原来的第一个元素的值. 说明:如果数组 ...

  8. ACL 2019 分析

    ACL 2019 分析 word embedding 22篇! Towards Unsupervised Text Classification Leveraging Experts and Word ...

  9. Visual Studio Code - 插件

    Intellisense(代码提示.智能感应) Path Intellisense:路径别名(alias)代码提示 例如:在模块打包配置中配置@代替了src,可以使用下面的配置让@智能感应 " ...

  10. Spring 初识

    一.Spring是什么? 首先可以进入Spring官网 https://spring.io/ 看一下相关介绍. Spring为开发者提供了一站式的轻量级应用开发平台.简单来说,Spring为开发者提供 ...