Visual Studio creates invalid Resx files

旧巷老猫 提交于 2019-12-05 00:02:31

Visual Studio creates correct *.resx files. The problem is, tools that you are attempting to use were created for previous version of the specification. That's why your workaround works.

Please check if there are no newer versions or patches to localization tools you are using.

Sometimes in specific cases the windows forms designer crashes during validating the form with the *.resx files.

Controls where a DataSource was attached are affected from this behavior. In my case I got some DataSets as DataSource for Grids, Combos...

So I have opened the Designer and it't telling me it cannot open due a problem with a control named: blabla

after checking the designer-file I found out nothing is wrong with the control it's just the *.resx file pointing to a wrong source, because I refactored the DataSet. So the *.resx has not updated due this refactoring.

I opened the *.resx file and simply searched for the identifier of the control and found a Base64 encoded code. Deleting the value inside the block without deleting the surround tags will resolve the problem for this control as the windows forms designer will automatically refresh and readd the missing content to the *.resx file.

In the .resx, locate the first line of the base64 encoded string. The end should be "j00LjAuMC4w" (meaning .net 4.0). Try changing that to "j0yLjAuMC4w" (meaning .net 2.0). Worked for me. Thanks to Luis Mack at http://connect.microsoft.com/VisualStudio/feedback/details/532584/error-when-compiling-resx-file-seems-related-to-beta2-bug-5252020#

This error is presented when the compiler lost the reference of some object or when the you have changed a important property of this object, for example if you have a Grid on the form all setup (this means that you are using a DataSet as your data source to fulfill your grid), and you change the name of your DataSet VS lost this link, he will bring you this message.

i just deleted thease lines in my .RESX file

<assembly alias="System.Windows.Forms" name="System.Windows.Forms, Version=4.0.0.0, Culture=neutral, PublicKeyToken="" />
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!