Get web application assembly name, regardless of current executing assembly

前端 未结 3 1184
傲寒
傲寒 2020-12-17 14:52

Is is possible to get the assembly name of an ASP.NET web application, from a referenced assembly??

Assembly.GetEntryAssembly worked fine in desktop and console apps

3条回答
  •  慢半拍i
    慢半拍i (楼主)
    2020-12-17 15:29

    You can use

    HttpContext.Current.ApplicationInstance.GetType().Assembly
    

提交回复
热议问题