Reputation: 1706
I'm not very familiar with localization in general and I'm brand new to Microsoft Enterprise Library. How do I create a localized resource and use it in Exception Management?
I've set up a replace handler to throw a friendly error message when exceptions get processed by my policy and there are fields there for specifying Message Resource Name and Message Resource Type. I have no idea what goes in these fields. I can find no examples whatsoever.
Upvotes: 0
Views: 609
Reputation: 151
You don't have to edit the Designer file manually; in fact, you shouldn't.
I'm using VS 2010 and C#, but the concepts should be the same for VS 2012 and VB.
The following link was very helpful to me, in addition to your answer, to figuring this out:
http://odetocode.com/blogs/scott/archive/2009/07/16/resource-files-and-asp-net-mvc-projects.aspx
(You can ignore his warnings about App_GlobalResources -- that's where I have my Exceptions.resx file and this works for me.)
Upvotes: 1
Reputation: 1706
I figured this out.
You add standard resources in .resx files just like any other localization. My problem was that when I went to add the Resource Type and Resource Name to my Replace Handler in Enterprise Library's Configuration interface, the assembly did not contain any Types to add.
The problem is two things. When you create a .resx in Visual Studio 2012 using VB.Net, it uses My.Resources as the Namespace. It could be My.[FolderName], I don't know. The other problem is that it creates the class as Friend, not Public.
I had to change the Namespace in properties and manually change Friend to Public in the .vb file. It changes back whenever I add a new resource because it regenerates the code, but at least now I can make it work.
Upvotes: 0