Link to home
Start Free TrialLog in
Avatar of drlewicki
drlewickiFlag for United States of America

asked on

does not implement interface member

This error is in this asp.net c# code that I don't normally see.

    [System.Runtime.CompilerServices.CompilerGlobalScopeAttribute()]
    public class admin_systems_and_versions_aspx : global::Admin, System.Web.IHttpHandler {
       
        private static bool @__initialized;

Error      3      'ASP.admin_systems_and_versions_aspx' does not implement interface member
'System.Web.IHttpHandler.IsReusable'      
c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\
teststatus2production\7e352623\d1efa770\App_Web_xslh3hfa.0.cs      157      

I tried removing the temporary asp.net files and that did not work.
Avatar of Steve Bink
Steve Bink
Flag of United States of America image

Did you implement the IsReusable property for your class?  

http://msdn.microsoft.com/en-us/library/system.web.ihttphandler_members.aspx
Avatar of drlewicki

ASKER

How? In what page?
The error message would suggest that you have a page called "Admin_Systems_and_Versions.aspx" that is marked as implementing the IHttpHandler interface, but doesn't implement the IsReusable method of the interface.
what is the solution?
ASKER CERTIFIED SOLUTION
Avatar of Carl Tawn
Carl Tawn
Flag of United Kingdom of Great Britain and Northern Ireland image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
It appears that you have defined a class like this:

public class admin_systems_and_versions_aspx :  global::Admin,  System.Web.IHttpHandler
         

this indicates that your class is implementing the interface
System.Web.IHttpHandler

and in order to implement that Interface, you MUST implement a method:

public void ProcessRequest(HttpContext context) {

}

and a property:

public bool IsReusable {
    get {
        return false;
    }
       

AW
An interface is only a contract between the ASP.NET engine and the developer.  The engine agrees to provide specific functionality to your application through this interface, and you agree to give it the specifics of how you want it to work.  Every interface is going to have some property or method you need to implement in your application's code.  In this case, there are only the two items referenced at the link I provided and demonstrated by Arthur_Wood.

Avatar of cmilescody
cmilescody

... here, when they say "implement", they are meaning:
    "define", "create", "write", "include", "specify"

... not what the English verb "implement" generally means:
    "perform", "put into effect", "carry out", "execute"

You don't ever have to execute the method, but in order to fulfill the Interface's contract, you must define the method to your class that implements an interface.

>>> ... here, when they say "implement"

Another great lesson in basic assumptions.  I've been using the language so long, I had not even thought that someone could misconstrue that concept.

In programming, the best definition I have seen for "implement" is "providing a practical means for accomplishing something".  An interface is merely a skeleton.  It does not actually include code to *do* anything, but instead provides the overall structure that must be followed in order to do a particular thing.  When you define a class as inheriting an interface, it is inheriting that general structure.  Still, there is no code...you need to provide the code for it.  Providing that code is referred to as "implementing", or an "implementation" of, the interface.

Think of it in the context of a car.  The car interface says you must have a steering wheel, an engine, and brakes.  The interface does not actually create those items - it only mandates their existence.  Each car manufacturer can choose to implement this interface in a variety of ways, but every car *must* have those properties.