Solved

Compile Error

Posted on 2008-10-22
3
495 Views
Last Modified: 2013-11-07
I have created a class file that give me the following error:
Error      1      'MyIsysTest.HttpRuntime.HttpRuntime()' must declare a body because it is not marked abstract, extern, or partial.
The error is about this line:
public HttpRuntime();

I am not sure what is missing here.
using System;
using System.Configuration;
using System.Data.Common;
using System.Security;
using System.Web.Caching;
using System.Web.Compilation;
using System.Xml;
using System.Web;
 
namespace MyIsysTest
{
    public sealed class HttpRuntime
    {
        public HttpRuntime();
 
        // Summary:
        //     Gets the application identification of the application domain where the System.Web.HttpRuntime
        //     exists.
        //
        // Returns:
        //     The application identification of the application domain where the System.Web.HttpRuntime
        //     exists.
        public static string AppDomainAppId { get; private set; }
        //
        // Summary:
        //     Gets the physical drive path of the application directory for the application
        //     hosted in the current application domain.
        //
        // Returns:
        //     The physical drive path of the application directory for the application
        //     hosted in the current application domain.
        public static string AppDomainAppPath { get; private set; }
        //
        // Summary:
        //     Gets the virtual path of the directory that contains the application hosted
        //     in the current application domain.
        //
        // Returns:
        //     The virtual path of the directory that contains the application hosted in
        //     the current application domain.
        public static string AppDomainAppVirtualPath { get; private set; }
        //
        // Summary:
        //     Gets the application identification of the application domain where the System.Web.HttpRuntime
        //     exists.
        //
        // Returns:
        //     The unique application domain identifier.
        public static string AppDomainId { get; private set; }
        //
        // Summary:
        //     Gets the folder path for the ASP.NET client script files.
        //
        // Returns:
        //     The folder path for the ASP.NET client script files.
        //
        // Exceptions:
        //   System.Web.HttpException:
        //     ASP.NET is not installed.
        public static string AspClientScriptPhysicalPath { get; private set; }
        //
        // Summary:
        //     Gets the virtual path for the ASP.NET client script files.
        //
        // Returns:
        //     The virtual path for the ASP.NET client script files.
        public static string AspClientScriptVirtualPath { get; private set; }
        //
        // Summary:
        //     Gets the physical path of the directory where the ASP.NET executable files
        //     are installed.
        //
        // Returns:
        //     The physical path to the ASP.NET executable files.
        //
        // Exceptions:
        //   System.Web.HttpException:
        //     ASP.NET is not installed on this computer.
        public static string AspInstallDirectory { get; private set; }
        //
        // Summary:
        //     Gets the physical path to the /bin directory for the current application.
        //
        // Returns:
        //     The path to the current application's /bin directory.
        public static string BinDirectory { get; private set; }
        //
        // Summary:
        //     Gets the System.Web.Caching.Cache for the current application.
        //
        // Returns:
        //     The current System.Web.Caching.Cache.
        //
        // Exceptions:
        //   System.Web.HttpException:
        //     ASP.NET is not installed.
        public static Cache Cache { get; private set; }
        //
        // Summary:
        //     Gets the physical path to the directory where the common language runtime
        //     executable files are installed.
        //
        // Returns:
        //     The physical path to the common language runtime executable files.
        public static string ClrInstallDirectory { get; private set; }
        //
        // Summary:
        //     Gets the physical path to the directory where ASP.NET stores temporary files
        //     (generated sources, compiled assemblies, and so on) for the current application.
        //
        // Returns:
        //     The physical path to the application's temporary file storage directory.
        public static string CodegenDir { get; private set; }
        //
        // Summary:
        //     Gets a value that indicates whether the application is mapped to a universal
        //     naming convention (UNC) share.
        //
        // Returns:
        //     true if the application is mapped to a UNC share; otherwise, false.
        public static bool IsOnUNCShare { get; private set; }
        //
        // Summary:
        //     Gets the physical path to the directory where the Machine.config file for
        //     the current application is located.
        //
        // Returns:
        //     The physical path to the Machine.config file for the current application.
        public static string MachineConfigurationDirectory { get; private set; }
 
        // Summary:
        //     Removes all items from the cache.
        public static void Close();
        //
        // Summary:
        //     Returns the set of permissions associated with code groups.
        //
        // Returns:
        //     A System.Security.NamedPermissionSet object containing the names and descriptions
        //     of permissions, or null if none exists.
        public static NamedPermissionSet GetNamedPermissionSet();
        //
        // Summary:
        //     Drives all ASP.NET Web processing execution.
        //
        // Parameters:
        //   wr:
        //     An System.Web.HttpWorkerRequest for the current application.
        //
        // Exceptions:
        //   System.ArgumentNullException:
        //     The wr parameter is null.
        public static void ProcessRequest(HttpWorkerRequest wr);
        //
        // Summary:
        //     Terminates the current application. The application restarts the next time
        //     a request is received for it.
        public static void UnloadAppDomain();
    }
}

Open in new window

0
Comment
Question by:MoniMatthews
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
3 Comments
 
LVL 1

Accepted Solution

by:
MichaelVlasov earned 500 total points
ID: 22781455
You must implement a body for constructor (and for all methods):

public HttpRuntime()
{
  // some initialization code here
}

As I see in your sample, you missing body for all methods (not only constructor).
0
 
LVL 13

Expert Comment

by:TechTiger007
ID: 22781493
if you are planning to declare the methods are abstract then you have to declare them abstract other wise provide a body for the methods

public HttpRuntime();
should be changed to
public HttpRuntime()
{
}

do the same for other methods also


0
 

Author Closing Comment

by:MoniMatthews
ID: 31508970
Thank you for this fix.
0

Featured Post

Enroll in June's Course of the Month

June's Course of the Month is now available! Every 10 seconds, a consumer gets hit with ransomware. Refresh your knowledge of ransomware best practices by enrolling in this month's complimentary course for Premium Members, Team Accounts, and Qualified Experts.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In my previous two articles we discussed Binary Serialization (http://www.experts-exchange.com/A_4362.html) and XML Serialization (http://www.experts-exchange.com/A_4425.html). In this article we will try to know more about SOAP (Simple Object Acces…
This document covers how to connect to SQL Server and browse its contents.  It is meant for those new to Visual Studio and/or working with Microsoft SQL Server.  It is not a guide to building SQL Server database connections in your code.  This is mo…
This is Part 3 in a 3-part series on Experts Exchange to discuss error handling in VBA code written for Excel. Part 1 of this series discussed basic error handling code using VBA. http://www.experts-exchange.com/videos/1478/Excel-Error-Handlin…
Michael from AdRem Software outlines event notifications and Automatic Corrective Actions in network monitoring. Automatic Corrective Actions are scripts, which can automatically run upon discovery of a certain undesirable condition in your network.…

734 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question