c# - 将资源文件转换为 resx - 不可序列化

标签 c# resx invalidoperationexception reflector resgen

我有一项任务是重建我们在许多项目中丢失的一些源代码。大多数情况下,一切顺利,但当然在最后一个项目中,我遇到了一个错误,我找不到任何解决方案。

我使用 Reflector 8.1 反编译 DLL,它为我提供了所有源代码和一堆 .resources 文件。我一直在使用 resgen 程序将它们转换回 .resx 文件以包含在项目中。不过,一个文件让我很伤心。请帮忙。

>resgen foo.resources foo.resx
Read in 106 resources from "foo.resources"
ResGen : error RG0000: Error while writing the output file "Resources.resx"
ResGen : error RG0000: Specific exception: "InvalidOperationException"  Message: "Item        named 'IncomingRing' of type 'System.IO.PinnedBufferMemoryStream' cannot
be added to the resource file because it is not serializable."

2 个错误。

最佳答案

试试这个:

  1. 在Reflector中打开dll
  2. 在该程序集的 Resources 文件夹中找到您遇到问题的资源
  3. 右键单击它 -> 打开方式 -> Visual Studio 2010 或 2012

这应该在 visual studio 中将其作为 resx 打开

关于c# - 将资源文件转换为 resx - 不可序列化,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17203598/

相关文章:

c# - 如何防止生成验证属性?

c# - 对象内的链接是否被视为反模式?

c# - MVC中划分资源文件的最佳实践

selenium-webdriver - 将 Chrome 浏览器更新到最新版本后无法连接到渲染器

c# - ConnectionString 属性尚未初始化错误

c# - "Expression not supported"调试 lambda 表达式时

c# - 如何在 Sitecore 中的 Sitecore.Context.Item.Database 项上设置数据库详细信息

c# - 从后面的代码创建到 Resources.resx 中字符串的绑定(bind)

asp.net - 页面当前使用的.resx文件

c# - 为什么此音频不能在Windows Phone 7中播放?