问题现象:
打包后的程序调用 Log4Net 写日志失败,运行报错:

base = "System.MissingMethodException: Default constructor not found for type log4net.Repository.Hierarchy.Hierarchy\r\n
at System.RuntimeType.CreateInstanceMono (System.Boolean nonPublic, System.Boolean wrapExceptions) [0x00076] in <4899add98f17447bac12e1861ae2d...

 

解决方案:

项目设置中的 Managed Stripping Level 改为 Disabled 即可(之前是 Low)

 

posted on 2023-06-16 11:20  青叶煮酒  阅读(480)  评论(0编辑  收藏  举报