Thursday, April 16, 2009

Could not find any resources appropriate for the specified culture or the neutral culture.

Could not find any resources appropriate for the specified culture or the neutral culture. Make sure "XXXYYY.en-US.resources" was correctly embedded or linked into assembly "AAABBB" at compile time, or that all the satellite assemblies required are loadable and fully signed.

I wasted a lot of time to find out the reason behind this error. This was coming up when I was trying to use culture specific satellite DLL.

After search the complete web I found the following answer:

It is not because the resource manager didn't find the satellite assembly but because the embedded .resources file in the satellite assembly doesn't have a full
name. In this case, the full name is "MyLib.Resources.es-MX.resources", but
the .resources file's name is "Resources.es-MX.resources".

When you use the resgen tool to convert .resx file to common language runtime binary .resources file, you should add the namespace name of your project in the front of the converted .resources file. The following is a sample.

resgen Resources.es-MX.resx MyLib.Resources.es-MX.resources

Thus, the .resources file has a full name. Then you use AL.exe tool to bundle the .resource file into a satellite assembly and place this satellite assembly to the es-MX subdirectory of the application's bin/debug folder.

Run the application again and you should see the correct result.


Thanks to Linda Liu [MSFT] for the answer...
source : http://www.devnewsgroups.net/group/microsoft.public.dotnet.framework/topic55934.aspx


vaibhav Chugh

Wednesday, April 8, 2009

Remove flicker in listbox C#

I read over 100 articles on the web just one was able to help me and that too was ignored by others in the discussion.

Well, if you are adding less number of items to a listbox then
listbox1.beginupdate()
listbox1.add(item);
listbox1.endupdate();

should work for you just fine. There shall be no flicker.
using doublebuffered user control / form may also solve the problem. In some cases

this.SetStyle(ControlStyles.UserPaint  ControlStyles.OptimizedDoubleBuffer 
ControlStyles.AllPaintingInWmPaint ControlStyles.SupportsTransparentBackColor,
true);
may also work.

but in my case the data was coming at a very high speed and high quantity and I had to display this large amount of data in an owner drawn list box.

this.SuspendLayout();
foreach (DataItem ditem in ditems)
{
listbox1.Items.Add(ditem);
}
this.ResumeLayout();


the above code helped me in getting a pretty smooth layout.

hope it helps
Vaibhav Chugh