1

I have a simple ASP.Net application which consist of 2 projects:

  • ASP.Net Project
  • Class Library Project (contains the data access and make simple business validation)

When I compile the ASP.Net project, the compiler raise an error that a method in a class is not exist.

ex.: I have a class called User, this class has a method called AddUser, the compiler says that User doesn't have a definition to AddUser or there is no extension method called AddUser. However, when i point to the method calling in the page and press F12 (Go to definition) It goes to the method definition which indicates that the complier can see the method.

How could this happen?!!!! and how can I solve it?

2
  • 1
    Could you provide code samples and error message, please? Commented Aug 8, 2011 at 11:34
  • 3
    Ususally, when being inside an ASPX page, User refers to the User property. Try a full qualified namespace to your User class. Commented Aug 8, 2011 at 11:36

2 Answers 2

1

Try to compile only class library. After, compile your ASP.net project. I have the same problem, and I finally discovered that my compiled dll file was outdated.

Sign up to request clarification or add additional context in comments.

Comments

0

How did you add your reference to the class library - did you add a 'project' reference or did you browse directly to the DLL (the project reference is the one you want).

1 Comment

Yes Paddy I reference the project

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.