Assembly.GetExecutingAssembly()是什么意思?
Application["CONFIG.sugar_version"]是不是取应用程序的版本号的?

解决方案 »

  1.   

    获取包含当前执行的代码的程序集,简单可以理解为调用Assembly.GetExecutingAssembly()方法的程序集。
      

  2.   

    获取包含当前执行的代码的程序集。若要获取包含调用当前所执行代码的方法的程序集,请使用 GetCallingAssembly。
    示例
    下面的示例获取当前运行代码的程序集。Assembly SampleAssembly;
    // Instantiate a target object.
    Int32 Integer1 = new Int32();
    Type Type1;
    // Set the Type instance to the target class type.
    Type1 = Integer1.GetType();
    // Instantiate an Assembly class to the assembly housing the Integer type.  
    SampleAssembly = Assembly.GetAssembly(Integer1.GetType());
    // Display the name of the assembly currently executing
    Console.WriteLine("GetExecutingAssembly=" + Assembly.GetExecutingAssembly().FullName);