I want to know if my code can and is Inlined or not. I have found a way to do this, which is:
Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);
But i am not sure how it´s supposed to tell me. If i use it on this:
[MethodImpl(MethodImplOptions.AggressiveInlining)]
internal static ImageCodecInfo GetEncoderInfo(ImageFormat format)
{
Console.WriteLine(System.Reflection.MethodBase.GetCurrentMethod().Name);
return ImageCodecInfo.GetImageEncoders().ToList().Find(delegate(ImageCodecInfo codec)
{
return codec.FormatID == format.Guid;
});
}
What is the Console suppose to write if it´s inlined? From my understanding, it´s supposed to write the name of the caller, for example:
Private void Caller()
{
ImageCodecInfo GetEncoderInfo(bmpFormat)
}
Console will then write Caller.
Is this correct? If so, then nothing i have tried it on is inlined.