class Program
{
static void Main(string[] args)
{
Console.WriteLine(global::Name.Of<Foo>(arg => arg.Bar));
Console.ReadLine();
}
public class Foo
{
public string Bar { get; set; }
}
}
IntelliSense says that I am using following overload:
string Name.Of(Func<Foo,object> fieldOrProperty)
This gives me the following exception:
System.InvalidProgramException was unhandled
Message: An unhandled exception of type 'System.InvalidProgramException' occurred in mscorlib.dll
Additional information: Common Language Runtime detected an invalid program.
PEVerify gives me following output:
Microsoft (R) .NET Framework PE Verifier. Version 4.0.30319.33440
Copyright (c) Microsoft Corporation. All rights reserved.
[IL]: Error: [ConsoleApplication1.exe : ConsoleApplication1.Program::Main][offset 0x00000031] Stack must be empty on return from a void function.
1 Error(s) Verifying ConsoleApplication1.exe
I have following example code:
IntelliSense says that I am using following overload:
string Name.Of(Func<Foo,object> fieldOrProperty)
This gives me the following exception:
PEVerify gives me following output:
Following packages are used: