应用程序的 ANTS Profiler 具有 NInject 参考,给出“操作可能会破坏运行时的稳定性”
我正在尝试分析一个使用 Ninject 的应用程序。我正在使用 ANTS 探查器,当它到达线路时,
StandardKernel kernel = new StandardKernel();
探查器给我一个错误,指出“操作可能会破坏运行时的稳定性”。通过阅读 ANTS 论坛 和其他地方,它似乎是由于 NInject 中的安全设置。我不愿意改变它们,并且真的不知道如何有任何信心(我怀疑它与 NInject 创建对象的方式有关,这不是通过反射,因此不会在中等信任环境中运行,但那就是纯属猜测!)。有没有人在 Ninject 和 ANTS 中遇到过这个问题,如果有的话是如何解决的?
到目前为止,我唯一尝试过的就是确保一切都以管理员身份运行,但这没有任何区别。另外,当我不对其进行分析时,代码可以正常工作,并且如果 ANTS 的任何人正在阅读此内容,则如果我关闭行级计时,则代码可以正常工作,因此问题如上面链接的帖子中所述(但没有解决方案) ...解决方案似乎涉及更改 NInject 组件)。
I am trying to profile an application which uses Ninject. I am using ANTS profiler and when it hits the line
StandardKernel kernel = new StandardKernel();
the profiler is giving me the an error saying that the "Operation could destabilize the runtime". From reading around the ANTS forum and other places it seems to be due to the security settings in NInject. I am reluctante to change them and wouldn't really know how to with any confidence (I suspect its to do with how NInject creates objects, which is not through reflection, and so won't run in a medium trust environment, but that is pure speculation!). Has anyone come across this issue with Ninject and ANTS and if so how was it fixed?
The only thing I have tried so far is to ensure everything is run as administrator, but that doesn't make any difference. Also, the code works fine when I am not profiling it, and if anyone from ANTS is reading this, the code works if I turn off line level timings, so the issue is as decribed in the post linked above (but there was no solution...solution seems to involve changing the NInject assembly).
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
实际上我找到了一个允许我进行分析的解决方法。如果我删除 NInject dll 的 .pdb 文件并将 ANTS 选项设置为仅分析代码可用的位置,那么我就可以开始工作了。它并不理想,但作为一种解决方法,它可以完成工作。
Actually I found a workaround which allows me to profile. If I remove the .pdb file for the NInject dll and set the ANTS options to only profile where code is available then I am in business. Its not ideal, but as a work around it gets the job done.