Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7157913
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T12:58:20+00:00 2026-05-28T12:58:20+00:00

I am using LinqPad and in that I was looking at the IL code(compiler

  • 0

I am using LinqPad and in that I was looking at the IL code(compiler optimization switched on) generated for the following Interface & the class that implements the interface:

public interface IStockService
{
    [OperationContract]
    double GetPrice(string ticker);
}

public class StockService : IStockService
{
    public double GetPrice(string ticker)
    {
        return 93.45;
    }
}

IL Code :

IStockService.GetPrice:

StockService.GetPrice:
IL_0000:  ldc.r8      CD CC CC CC CC 5C 57 40 
IL_0009:  ret         

StockService..ctor:
IL_0000:  ldarg.0     
IL_0001:  call        System.Object..ctor
IL_0006:  ret         

Surprisingly I don’t see any IL code for the interface. Is this because of the way LinqPad works or the C# compiler treats the interfaces in a different manner?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-28T12:58:20+00:00Added an answer on May 28, 2026 at 12:58 pm

    IL is for method bodies. An interface does not contain any method bodies, thus no IL.

    A method body in this case (put simply) is any executable code. Nothing in an interface is executable since it is just a contract. It’s up to the implementor of the interface to provide an implementation, which will usually contain IL.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I'm testing some threading code, and using LinqPad I noticed that I'm able to
I ran into an interesting error with the following LiNQ query using LiNQPad and
I am using LINQPad to run the following query: var pds = (from p
I have the following query which works fine in SSMS. Im using LinqPad (
Is there anything wrong with using an implicit operator like the following: //linqpad c#
Using LINQPad, I am trying to test a few snippets with my own C#
I've just begun using LINQPad and so far I like it but most tutorials
Using ASP.NET MVC there are situations (such as form submission) that may require a
Using TortoiseSVN against VisualSVN I delete a source file that I should not have
I'm using LINQPad to learn LINQ and I've run into a stumbling block. The

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.