Is there an equivalent of Application_Start for a class library in c#

后端 未结 4 2042
陌清茗
陌清茗 2020-12-30 02:29

I would like to execute certain code in a class library when it is instantiated from another assembly. Is there an entry point or bootstrap for a class library? I thought t

4条回答
  •  抹茶落季
    2020-12-30 03:13

    A library as it is, has not an starting point. When you are instancing a class of a library the first instruction you call is the constructor of the class (new) and its base constructors if they are on the constructor definition.

提交回复
热议问题