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

  • SEARCH
  • Home
  • 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 8254785
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 8, 20262026-06-08T01:18:33+00:00 2026-06-08T01:18:33+00:00

Possible Duplicate: C#.NET – Why do members of a static class need to be

  • 0

Possible Duplicate:
C#.NET – Why do members of a static class need to be declared as static? Why isn't it just implicit?

I am getting an interesting error, in that when I call a method (which I don’t explicitly declare as static) from within a statically declared class, I get a message saying

An object reference is required for the non-static field, method, or property ‘MangoTree.Twitter.OAuthClient.PerformRequest(System.Collections.Generic.Dictionary, string, string, string, MangoTree.Twitter.OAuthClient.RequestType)’

When I explicitly declare the method as static, the error goes away, and I can remove the static modifier from the class declaration and the error stays away. What’s confusing me is that I was under the impression that when I declared the class as static, everything within the class should automatically be static as well, without me having to explicitly declare it so.

  • 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-06-08T01:18:35+00:00Added an answer on June 8, 2026 at 1:18 am

    What’s confusing me is that I was under the impression that when I declared the class as static, everything within the class should automatically be static as well

    All members of a static class must indeed be static, but it is not happening automatically: you must explicitly declare all the members static. The purpose of declaring a class static is to let the compiler perform a check that all members are static, and to prevent any attempt at creating an instance of your static class.

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

Sidebar

Related Questions

Possible Duplicate: .NET: Determine the type of this class in its static method How
Possible Duplicate: .NET: Determine the type of this class in its static method Hello
Possible Duplicate: Protect .NET code from reverse engineering? we just develop a application with
Possible Duplicate: Asp.net how to correct the error I'm designing my web page using
Possible Duplicate: .NET 3.5 chart controls exception: Error executing child request for ChartImg.axd I'm
Possible Duplicate: Lucene.Net and SQL Server I need to storage and index files, like
Possible Duplicate: ASP.NET Application state vs a Static object I am using the static
Possible Duplicate: .Net Obfuscation Alternative for Obfuscation in the .NET world Just a few
Possible Duplicate: Duplicate keys in .NET dictionaries? I need to create a Collection<string,object> ,
Possible Duplicate: ASP.NET “special” tags I hope this isn't too much of a newbie

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.