Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 5961459
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 22, 20262026-05-22T18:58:04+00:00 2026-05-22T18:58:04+00:00

My code: System.Resources.ResourceManager resourceManager = GetResourceManager(); string str = resourceManager.GetString(delete, new CultureInfo(1033)); In current

  • 0

My code:

System.Resources.ResourceManager resourceManager = GetResourceManager();
string str = resourceManager.GetString("delete", new CultureInfo(1033));

In current project compiled under .NET 2.0 everything works as excepted. Variable str contains resource string for LCID 1033 – Delete, this is ok.

We are now upgrading to .NET 4.0, recompiled project under target framework .NET 4.0.
Now compiled as .NET 4.0 assemblies, it throws exception System.ArgumentNullException with message Value cannot be null..Stack trace:

   at System.Threading.Monitor.Enter(Object obj)
   at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo requestedCulture, Boolean createIfNotExists, Boolean tryParents, StackCrawlMark& stackMark)
   at System.Resources.ResourceManager.InternalGetResourceSet(CultureInfo culture, Boolean createIfNotExists, Boolean tryParents)
   at System.Resources.ResourceManager.GetString(String name, CultureInfo culture)

Interesting here is stacktrace, where it points to internal framework method in ResourceManager.InternalGetResourceSet which causes to call Monitor.Enter with null object. But i call method GetString with not null parameters GetString(“delete”, new CultureInfo(1033)).

This bug seems to be similar to System.ArgumentNullException in System.Threading.Monitor.Enter. Maybe some bug in Monitor.Enter, or something else?

Update:
When i look in debugger at object resourceManager.ResourceSets.Items[2].Value.Table["delete"] then it contains string value “Delete”. property Items[2] here pointing to LCID 1033. This means that resource manager already contains localized string for resource key delete in language 1033. Does anybody knows where can be error?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-22T18:58:05+00:00Added an answer on May 22, 2026 at 6:58 pm

    I also think that you should declare and use your own dictionary for storage since ResourceSets is marked as Obsolete under .NET 4.0

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

C# CODE : [global::System.ComponentModel.EditorBrowsableAttribute(global::System.ComponentModel.EditorBrowsableState.Advanced)] internal static global::System.Resources.ResourceManager ResourceManager { get { if (object.ReferenceEquals(resourceMan, null))
I have this code :- using (System.Security.Cryptography.SHA256 sha2 = new System.Security.Cryptography.SHA256Managed()) { .. }
I have the following code: if (System.IO.File.Exists(htmlLocation)) { vEarthBrowser.ObjectForScripting = this; vEarthBrowser.Url = new
i am currently using this line of code resourceManager = new ResourceManager(Namespace.class, GetType().Assembly); to
My code is very big, and it consumes many resources from the system -
http://msdn.microsoft.com/en-us/library/system.resources.resxresourcewriter.aspx In this link and others like it, I see code to write in
Currently I access my resource .resx file like this: ResourceManager manager = new ResourceManager(Resources.Messages,
So here is the simple code: [System.ComponentModel.DefaultValue(true)] public bool AnyValue { get; set; }
The following code using System.Threading; class Test { volatile int counter = 0; public
I have the following code: using System; using System.Linq; using System.Linq.Expressions; public class Program

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.