C#WPF应用程序因System.FormatException崩溃-损坏的.resources文件 [英] C# WPF app crashes with System.FormatException - Corrupt .resources file

查看:233
本文介绍了C#WPF应用程序因System.FormatException崩溃-损坏的.resources文件的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经从现任员工那里继承了C#.net WPF应用程序,并且在运行该应用程序时遇到了一些困难.一切正常,没有任何错误或警告,但在GUI出现之前,我得到一个错误:

I've inherited a C# .net WPF application from a now ex-employee and am having some difficulties running the application. It all builds fine without a single error or warning, but before the GUI appears I get an error:

mscorlib.dll中发生了'System.FormatException'类型的未处理异常

An unhandled exception of type 'System.FormatException' occurred in mscorlib.dll

其他信息:损坏的.resources文件.索引'156'的名称位置不在名称部分'0xab02'之外.

Additional information: Corrupt .resources file. Name position for index '156' is outside of name section '0xab02'.

关于如何识别文件是.resources文件和/或如何重新创建文件的任何建议(我尝试将所有文​​件都保留下来没有影响).

Any suggestions on how to identify which .resources file it is and/or how to re-create them (I've tried rubuilding all which made no difference).

推荐答案

好的,因此结果表明,尽管将Visual Studio设置为使用.net框架的v3.5,但仍需要单独安装v3.5的.net框架.框架-似乎我只安装了v2.让这成为所有遇到相同问题的人的教训!

Okay, so it turned out that although Visual Studio was set up to use v3.5 of the .net framework you need to seperately install v3.5 of the framework - it seems I only had v2 installed. Let this be a lesson for anyone else struggling with the same problems!

这篇关于C#WPF应用程序因System.FormatException崩溃-损坏的.resources文件的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆