resx

How can I resolve the “Invalid Resx file…Cannot find valid ”resheader“ tags for the ResX reader and writer type names.” compiler error?

烂漫一生 提交于 2019-11-29 15:39:27
I'm getting a dozen "Invalid Resx file. ResX input is not valid. Cannot find valid "resheader" tags for the ResX reader and writer type names." err msgs on trying to compile. I had this problem before, as can be seen here . This time, though, it manifests itself a little differently. First, here is what I did: I selected the context menu item "Undo Pending Changes" on several files in a project. For each of them, their related *.resx file apparently got corrupted. 2-clicking the first err msg in the Error List takes me here in the .resx file: <resheader name="resmimetype"> <value>text

DataAnnotations and Resources don't play nicely

左心房为你撑大大i 提交于 2019-11-29 06:38:05
I'm using dataannotations in an MVC2 app and am a little discouraged when trying to use RESX file resources for error messages. I've tried the following but keep getting the exception "An attribute argument must be a constant expression, typeof expression or array creation expression of an attribute parameter type" [Required(ErrorMessage = Resources.ErrorMessages.Required)] [Required(ErrorMessageResourceName = Resources.ErrorMessages.Required, ErrorMessageResourceType = typeof(Resources.ErrorMessages)] I keep getting that error message unless I replace ErrorMessageResourceName with "Required"

Create designer.cs file from ResXRersourcewriter generated resource file

拈花ヽ惹草 提交于 2019-11-29 06:17:25
问题 I got a programm that generates .resx resource files. Those resource files are used in other projects, that isnt in the same solution as the project that generates the resource files. I wonder now, if its possible to generate a designer.cs file from the resource file, so that you can access the resources directly without using the resxresourcereader. 回答1: Open the resx file and on its toolbar there's an Access Modifier menu. Set this to Public . This will generate a *.Designer.cs file. 回答2:

Should Resources.Designer.cs be under source control?

岁酱吖の 提交于 2019-11-29 02:53:05
I have Resources.resx, which is used to generate Resources.designer.cs. Should Resources.designer.cs be checked in, or can I rely on Visual Studio generating it when required? My preference is: If it's modified by the build system, ensure the build process will create it and don't check it in. For autogenerated files like 'designer', I check them in. They only get modified when other components get changed (by me). It's generated by VS and not modified by the build system. I ran across your post for a problem I am experiencing, not quite the same, but it helped me find a temporary solution.

Are there any performance issues or caveats with resource (.resx) files?

纵饮孤独 提交于 2019-11-29 01:28:52
Resource files seem great for localization of labels and messages, but are they perfect? For example: Is there a better solution if there is a huge amount of resources? Like 100,000 strings in a .resx file? (Theoretically, I do not actually have this problem) Is this a good method for storing the other types of data, such as images, icons, audio files, regular files, etc.? Is it a best practice to store your .resx files in a stand-alone project for easier updates/compiling? Are there any other issues that you have run into when using .resx files? 1. Is there a better solution if there is a

.resx vs database vs custom solution for providing Localization/Globalization

北城余情 提交于 2019-11-28 19:09:42
At my office, we have had a long-standing debate about Localization/Globalization and how to handle it. One side pushes for the Resource (.resx) file route built in to ASP.NET, one side pushes for a database driven solution. A third group believes in rolling a custom solution. Of course, each method has its own unique benefits and disadvantages - and we've discussed it over and over, without ever coming to a real consensus. So, I pose it to the community: in your experience, which method provides the best mix of the following as the application grows: Maintainability Extensibility Performance

Localization in WPF

余生长醉 提交于 2019-11-28 18:38:00
I am starting a new application in WPF and I am curious how to handle Localization? In WinForms you can use resx strings for the UI text, how is this done in WPF? Is there a special binding syntax for binding to resx resources or is there a different way of doing this? Thanks! Madeleine Check out WPF Globalization and Localization Overview . The article explains nicely how localization in WPF works. you can use a MarkupExtension to do localization with dynamic language switching. Here is an interesting article about this: http://www.wpftutorial.net/LocalizeMarkupExtension.html I found very

Global resource vs. Local resource in ASP.NET

回眸只為那壹抹淺笑 提交于 2019-11-28 18:36:05
We use resx files to localize our web applications. We usually create local resx files (that map to a specific page) when only one page uses a certain phrase, and a global resx file when more than one page needs the phrase. But the good thing about global resx files is that they are a class, and you can call the phrases like you call properties of a class: Resource.UI.iNotFound So I was thinking - why have local resx files at all? why not use one global resx file for the whole application, and that way avoid runtime errors from calling non-existent phrases? I'm sure there's a good answer for

“Run Custom Tool” for resx files in MVC2 project (from an external application/script)

冷暖自知 提交于 2019-11-28 12:42:01
I am trying to get the localization for my MVC project working with our existing infrastructure for editing string resources. We store all our resource string in database tables and have a front end web UI to edit them with, and an export application which generated the .resx files. This all works great, but I am having a little difficulty with a new project using MVC2 and VS2010. I have asked another question on this, the answer to which almost got me there, but not quite. I have now changed the resources to be in a Resources folder (instead of App_GlobalResources), as recommended by a number

Why am I getting App_GlobalResources assembly generated? (Error = CS0433)

别来无恙 提交于 2019-11-28 10:00:49
问题 I'm working on a ASP.NET MVC2 project, for which I have configured the localisation as follows ... I have a separate Resources assembly, containing all my resx files. The settings for each resx file are... Build Action = Embedded Resource Copy to Output Directory = Do not copy Custom Tool = PublicResXFileCodeGenerator Custom Tool Namespace = Resources I have a tool which exports the strings from a database into the resx files and calls the resgen.exe tool to recreate the designer.cs file.