SecurityException: ECall methods must be packaged into a system module

六月ゝ 毕业季﹏ 提交于 2019-11-29 05:24:55
Matt Jordan

You may want to check the compiler directives as a possible option. Unlike using a run-time "if", this will determine whether the call is included in the compiled code at all, rather than always compiling it into the code and trying to determine whether to call it at run-time (which is too late, based on your analysis).

Your use-case seems like a testing/validation scenario, which means that you don't need it compiled into the code except when the internal call will actually be made.

Note that if your use-case involves a non-.NET runtime, you should provide more information since that could drastically change the correct answer.

Add attribute [ComImport] to your class declaration

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!