简体   繁体   English

将资源文件转换为resx-无法序列化

[英]Converting resources file to resx - not serializable

I have a task where I'm reconstructing some source we lost for many projects. 我有一项任务是要重建许多项目中丢失的资源。 For the most, it's gone just fine, but of course on the very last project, I ran into an error that I cannot find any solution to. 在大多数情况下,它都进行得很好,但是在最后一个项目中,我当然遇到了一个错误,我找不到任何解决方案。

I used Reflector 8.1 to decompile the DLL which gives me all the source and bunch of .resources files. 我使用Reflector 8.1来反编译DLL,该DLL给了我所有的源文件和.resources文件。 I've been using the resgen program to convert them back into .resx files for inclusion in the project. 我一直在使用resgen程序将它们转换回.resx文件,以包含在项目中。 One file is giving me grief though. 一个文件虽然给我悲伤。 Please help. 请帮忙。

>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 error(s). 2个错误。

Try this: 尝试这个:

  1. open the dll in Reflector 在Reflector中打开dll
  2. find the resource you are having problems with in the Resources folder of that assembly 在该程序集的“资源”文件夹中找到遇到问题的资源
  3. right-click on it -> Open with -> Visual Studio 2010 or 2012 右键单击它->打开方式-> Visual Studio 2010或2012

That should open it as a resx in visual studio 那应该在Visual Studio中将其作为resx打开

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM