2

In the new ASP.NET 5 (vNext) The call to get the current method name seems to have been removed.

The code below shows the call i was hoping to make:

string methodName = System.Reflection.MethodBase.GetCurrentMethod().Name;

However the call to GetCurrentMethod() will cause a compiler error.

CS0117 'MethodBase' does not contain a definition for 'GetCurrentMethod'

I am using DNX Core 5.0.

I have checked the GitHub issues for .NET Core here but have found no mention of the method.

Has this been removed on purpose?

What should i use instead?

Erik Funkenbusch
  • 92,674
  • 28
  • 195
  • 291
Ben M
  • 81
  • 3
  • Don't have have any vNext version installed. But from the [sources](https://github.com/dotnet/coreclr/blob/4cf8a6b082d9bb1789facd996d8265d3908757b2/src/mscorlib/src/System/Reflection/MethodBase.cs) it looks it should be there. – Christian.K Sep 14 '15 at 17:19
  • @Christian.K It seems that it is there for DNX Core 4.6 but is not there for DNX Core 5.0, as to why i'm not sure yet. Im not sure how they map as the method in question is not present in [corefx](https://github.com/dotnet/corefx/blob/master/src/System.Reflection/ref/System.Reflection.cs) but is present in [coreclr](https://github.com/dotnet/coreclr/blob/4cf8a6b082d9bb1789facd996d8265d3908757b2/src/mscorlib/src/System/Reflection/MethodBase.cs) – Ben M Sep 15 '15 at 07:42

0 Answers0