C # file error

I get a weird error with my .resx files:

"Invalid Resx file. Invalid ResX input. Cannot find valid" resheader "tags for Reader type names and" ResX "type entries. C: \ Documents and Settings \ Users \ My Documents \ Visual Studio 2010 \ Projects \ dock \ WinForms \ Dock \ strings.resx "

I made a replacement of some files in the existing VS 2010 solution with some older ones from the VS 2008 solution, most of the files work fine, but I get this error and I don’t know how to fix it. If that matters, here is the source code for this file.

I am using NET WinForms 4.0, if that matters.

+4
source share
3 answers
<resheader name="resmimetype"> <value> text/microsoft-resx </value> </resheader> 

Extra empty space added. You need to remove it so that it looks like this:

  <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> 

You must also update the version numbers in the assembly links from 2.0.0.0 to 4.0.0.0. Copying .resx files like this is otherwise a good way to get into trouble. You'll easily get a Darn white screen when the code created by the developer tries to use the missing value in the .resx file.

+8
source

Ok, so what I did to solve your problem, add these lines to your file before / root:

  <resheader name="resmimetype"> <value>text/microsoft-resx</value> </resheader> <resheader name="version"> <value>1.3</value> </resheader> <resheader name="reader"> <value>System.Resources.ResXResourceReader, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> <resheader name="writer"> <value>System.Resources.ResXResourceWriter, System.Windows.Forms, Version=2.0.3500.0, Culture=neutral, PublicKeyToken=b77a5c561934e089</value> </resheader> 

I created a new VS2010 solution, added a new .resx file in the usual way and looked at the structure of the generated file. I found these lines, which VS apparently needed to compile your file accordingly.

I hope I helped :)

EDIT:

Unfortunately, I did not notice the existing tags in your file. In any case, it still solves your problem, and you can simply delete the old tags and save them.

+3
source

In my case, I loaded the control somewhere. All source files were in a folder, and the resx file was in a subfolder of App_LocalResources. Actually, I was not interested in anything in my part of the resx file, I think these are mostly automatic generated empty tags. So I just deleted the resx file. After deleting the resx file, the control compiled successfully.

0
source

Source: https://habr.com/ru/post/1384759/


All Articles