我已经编写并构建了这个应用程序:
namespace Test
{
class Program
{
static void Main(string[] args)
{
var myClass = new MyClass();
foreach (var item in myClass.CountFrom(1, 4))
{
Console.WriteLine(item);
}
Console.Read();
}
}
public class MyClass
{
public IEnumerable<int> CountFrom(int start, int limit)
{
for (int i = start; i <= limit; i++)
{
yield return i;
}
}
}
}
当我在 ILSpy 中查看代码时,基于 bin/Debug 文件夹中的 .exe,它没有显示我希望看到的状态机代码:
我怎样才能让它显示编译器生成的代码?