resx

App domain restarts when .resx file changes. Any way to avoid this?

喜欢而已 提交于 2019-11-30 15:52:52
I have an ASP.NET app with many .resx (resource) files used for localized user controls and pages. We would like these files to be editable on-the-fly. However, we have noticed that editing these files on the web server causes the app domain to reload, which causes the server to slow down for about a minute while the app domain restarts. Is there any way to permit editing of these files without causing the app domain to restart? There are several flavors of this question on Stackoverflow; to repeat the answer, yes, it's definitely possible. Like much of .NET, resource providers are extendable.

MVC Localization of Default Model Binder

早过忘川 提交于 2019-11-30 14:36:32
I am currently trying to figure out how to localize the error messages generated by MVC. Let me use the default model binder as an example, so I can explain the problem. Assuming I have a form, where a user enters thier age. The user then enters "ten" in to the form, but instead of getting the expected error of "Age must be beween 18 and 25." the message "The value 'ten' is not valid for Age." is displayed. The entity's age property is defined below: [Range(18, 25, ErrorMessageResourceType = typeof (Errors), ErrorMessageResourceName = "Age", ErrorMessage = "Range_ErrorMessage")] public int Age

Resources (resx) maintenance in big projects

旧巷老猫 提交于 2019-11-30 14:15:59
问题 In a big project where you have lots of resources (resx) what would be the right approaches and/or tools of translation in order to save time, at the same time keep everything in order and leave nothing behind. More precisely, how to find (as far as translations are concerned) what has been modified (adds and removes are easy) of an entire .NET application from a previous version to another? Would resx technology help you there? How? 回答1: I wrote some about it in this answer: Are resx files

Visual Studio's Access Modifier drop down option is disabled for resource file [closed]

ε祈祈猫儿з 提交于 2019-11-30 11:00:19
Not sure why Access Modifier drop down is disabled for a Resource file. alt text http://img683.imageshack.us/img683/9157/accessmodifier.png Here are file properties: alt text http://img199.imageshack.us/img199/3930/resxprop.png If possible, change your Custom Tool back to the default "ResXFileCodeGenerator". I tried changing a default web app project to use "GlobalResourceProxyGenerator" and it caused the Access Modifier drop down to disable. diepnguyenv Right click on your file resource, choose Properties ( Alt+Enter ) Change Build Action to Embedded Resource Change Custom Tool to

Resources (resx) maintenance in big projects

好久不见. 提交于 2019-11-30 09:36:01
In a big project where you have lots of resources (resx) what would be the right approaches and/or tools of translation in order to save time, at the same time keep everything in order and leave nothing behind. More precisely, how to find (as far as translations are concerned) what has been modified (adds and removes are easy) of an entire .NET application from a previous version to another? Would resx technology help you there? How? Stefan Steinegger I wrote some about it in this answer: Are resx files suitable for Internationalization? Summary: You should use a localization tool. It notices

Visual Studio : can't find “resource file” in list of items to add to project

丶灬走出姿态 提交于 2019-11-30 07:53:38
I'm on VS Community 2017 RC. I'd like to add a resource file (.resx) to my project but this item type is not listed in the items Have I missed something ? Do I need to install anything on top of my Visual Studio to be able to manage resource files ? Slime recipe At the top right corner you have a searchbox, try typing it there and see if it finds anything. If it doesn't, select a text file in the new item dialog and change its extension to resx It should now open the new file with the resources designer. Now open the properties pane for that file (right click it in the solution explorer) and

Programmatically generate Designer.cs for resx file (ResXResourceWriter/ResXResourceReader)

半城伤御伤魂 提交于 2019-11-30 06:54:35
I'm creating/updating resx files in TFS using ResXResourceWriter/ResXResourceReader which doesnt generate the .Designer.cs file. I saw that Resgen creates the .Designer.cs. How can i call that programmatically to generate the .Designer.cs at a certain TFS file path? Is it something like this? ProcessStartInfo startInfo = new ProcessStartInfo(@"C:\Program Files\Microsoft.NET\SDK\v2.0 64bit\Bin\ResGen.exe"); startInfo.WindowStyle = ProcessWindowStyle.Minimized; startInfo.Arguments = "ResourceName.resx /publicClass /str:cs, Namespace, ResourceName, ResourceName.Designer.cs"; Process.Start

Create designer.cs file from ResXRersourcewriter generated resource file

天大地大妈咪最大 提交于 2019-11-30 06:33:37
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. Paul Fleming 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. If the file is added to a Visual Studio Project you have to set the Custom Tool property of the .resx

Sharing asp.net resource files between web applications

醉酒当歌 提交于 2019-11-30 03:54:25
I have multiple projects that need to share resource files (.resx) Suggestions have been made to move resource files to a separate assembly and have web projects reference it. Is there an example of how to do this? Do I create a new Class Library project and move App_GlobalResource folder inside of that? I don't think that will work because code classes that are generated for resource files are marked as 'internal' which means that they can not be accessed outside of this assembly. In the properties window of Visual Studio, you should be able to set the access modifier of the resource file to

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

余生颓废 提交于 2019-11-29 16:15:06
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. This all worked great, even when I changed the language settings of my browser and refreshed the page. It