Ask Your Question
3

What does the error message "cs0120: An object reference is required for the non-static field, method, or property in ASP.Net Core MVC" mean?

asked 2023-05-28 03:56:16 +0000

lalupa gravatar image

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2023-05-28 03:57:01 +0000

plato gravatar image

The error message "cs0120: An object reference is required for the non-static field, method, or property in ASP.Net Core MVC" means that a non-static field, method, or property is being accessed in a static context. This error occurs when an attempt is made to access an instance member of a class without first instantiating an object of that class. In ASP.Net Core MVC, this error can occur when a non-static method or property is accessed from a static method or property, or when a non-static field is used in a static context. To resolve this error, you should ensure that an object reference is created before accessing the non-static member.

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account. This space is reserved only for answers. If you would like to engage in a discussion, please instead post a comment under the question or an answer that you would like to discuss

Add Answer


Question Tools

Stats

Asked: 2023-05-28 03:56:16 +0000

Seen: 1 times

Last updated: May 28 '23