Solved

Compile Error

Posted on 2008-10-22
3
490 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
3 Comments
 
LVL 1

Accepted Solution

by:
MichaelVlasov earned 500 total points
Comment Utility
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
Comment Utility
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
Comment Utility
Thank you for this fix.
0

Featured Post

How your wiki can always stay up-to-date

Quip doubles as a “living” wiki and a project management tool that evolves with your organization. As you finish projects in Quip, the work remains, easily accessible to all team members, new and old.
- Increase transparency
- Onboard new hires faster
- Access from mobile/offline

Join & Write a Comment

Today I had a very interesting conundrum that had to get solved quickly. Needless to say, it wasn't resolved quickly because when we needed it we were very rushed, but as soon as the conference call was over and I took a step back I saw the correct …
A theme is a collection of property settings that allow you to define the look of pages and controls, and then apply the look consistently across pages in an application. Themes can be made up of a set of elements: skins, style sheets, images, and o…
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…
In this seventh video of the Xpdf series, we discuss and demonstrate the PDFfonts utility, which lists all the fonts used in a PDF file. It does this via a command line interface, making it suitable for use in programs, scripts, batch files — any pl…

772 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

Need Help in Real-Time?

Connect with top rated Experts

10 Experts available now in Live!

Get 1:1 Help Now