.net - System.ArgumentNullException in ResourceManager.GetString internals -


my code:

system.resources.resourcemanager resourcemanager = getresourcemanager(); string str = resourcemanager.getstring("delete", new cultureinfo(1033)); 

in current project compiled under .net 2.0 works excepted. variable str contains resource string lcid 1033 - delete, ok.

we upgrading .net 4.0, recompiled project under target framework .net 4.0. compiled .net 4.0 assemblies, throws exception system.argumentnullexception message value cannot null..stack trace:

   @ system.threading.monitor.enter(object obj)    @ system.resources.resourcemanager.internalgetresourceset(cultureinfo requestedculture, boolean createifnotexists, boolean tryparents, stackcrawlmark& stackmark)    @ system.resources.resourcemanager.internalgetresourceset(cultureinfo culture, boolean createifnotexists, boolean tryparents)    @ system.resources.resourcemanager.getstring(string name, cultureinfo culture) 

interesting here stacktrace, points internal framework method in resourcemanager.internalgetresourceset causes call monitor.enter null object. call method getstring not null parameters getstring("delete", new cultureinfo(1033)).

this bug seems similar system.argumentnullexception in system.threading.monitor.enter. maybe bug in monitor.enter, or else?

update: when in debugger @ object resourcemanager.resourcesets.items[2].value.table["delete"] contains string value "delete". property items[2] here pointing lcid 1033. means resource manager contains localized string resource key delete in language 1033. knows can error?

i think should declare , use own dictionary storage since resourcesets marked obsolete under .net 4.0


Comments

Popular posts from this blog

asp.net - repeatedly call AddImageUrl(url) to assemble pdf document -

java - Android recognize cell phone with keyboard or not? -

iphone - How would you achieve a LED Scrolling effect? -