'Class' does not contain a definition for 'Method' 'Class' does not contain a definition for 'Method' asp.net asp.net

'Class' does not contain a definition for 'Method'


There are three possibilities:

1) If you are referring old DLL then it cant be used. So you have refer new DLL

2) If you are using it in different namespace and trying to use the other namespace's dll then it wont refer this method.

3) You may need to rebuild the project

I think third option might be the cause for you. Please post more information in order to understand exact problem of yours.


Create class with namespace name might resovle your issue

namespace.Employee employee = new namespace.Employee(); employee.ExampleMethod();


I had the same problem. Turns out the project I was referencing did not get build.When I went to the build configuration manager in visual studio and enabled the reference project , the issue got resolved.