zoukankan      html  css  js  c++  java
  • 生成CIL的问题

    private void testILMethod()
    {
        InventCountPlanLine     planLine;
        ;
        update_recordSet planLine 
        setting CountCuttingTimes = -planLine.CountCuttingTimesDiff;
    }

    上面的代码生成CIL的时候会有如下错误:

    Finished pass 1 at 2016/5/28 20:07:22

    Finished pass 2 at 2016/5/28 20:07:23

    Error 1. Class: Class1, Method: testILMethod, Exception: System.NotSupportedException: Line Number 5 - Error during dispatch of Expr. ---> System.NotSupportedException: Error during dispatch of Expr. ---> System.Reflection.TargetInvocationException: 调用的目标发生了异常。 ---> System.NotSupportedException: Error during dispatch of SymWhere. ---> System.Reflection.TargetInvocationException: 调用的目标发生了异常。 ---> System.ArgumentOutOfRangeException: 索引超出范围。必须为非负值并小于集合大小。

    改成

    private void testILMethod()
    {
        InventCountPlanLine     planLine;
        ;
        update_recordSet planLine 
        setting CountCuttingTimes = planLine.CountCuttingTimesDiff * (-1);
    }

    就OK了

    搞不懂生成CIL的时候有什么限制导致的。

  • 相关阅读:
    Windows内核对象
    FreeWriting_1
    FreeWriting_2
    【整理】技术文章集锦
    【转】英语吵架一百句
    像 IDE 一样使用 vim
    统治世界的十大算法
    AnimationSet动画集合类的使用
    帮你解答adb是什么,adb有什么用
    SharedPreferences的简单使用
  • 原文地址:https://www.cnblogs.com/Farseer1215/p/5538229.html
Copyright © 2011-2022 走看看