如何使用Process Monitor来解决UnauthorizedAccessException [英] How to use Process Monitor to Resolve an UnauthorizedAccessException

查看:97
本文介绍了如何使用Process Monitor来解决UnauthorizedAccessException的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在尝试从IIS7下的ASP.NET应用程序写入一个日志文件,但是不断得到以下例外:

  UnauthorizedAccessException对路径C:\Users\Brady\Exports的访问被拒绝。 

我建议您使用 Process Monitor 来帮助解决这个问题,但这是一个非常复杂的工具,我真的没有时间去探索它。请帮助我,并建议如何使用PM来确定哪个用户正在尝试访问文件夹等。

解决方案

当PM启动它会显示一个过滤器对话框。只需点击重置即可使用标准过滤功能。这将产生大量的消息,您只对其中很少的消息感兴趣。在进程名称下,选择一行与您要监视的进程。 Richtclick它并选择 include 。将报告的事件限制在您的应用程序中。在工具栏中,三个最右边的图标可以让您过滤源:注册表访问,文件系统访问和进程/线程事件。取消选择注册表和进程/线程,因为您只想监视文件访问。
在菜单中选择选项 - 选择列。在流程管理下,检查用户名



现在尝试重现错误。如果您仍然收到太多事件,可以限制路径(右键单击路径列,然后选择 exclude )。您可以通过单击Ctrl-L来微调筛选,界面应该是不言自明的。 (哦,只要记住在点击添加之前点击<确定 ,当你想创建一个新的过滤器规则...我几乎总是落在那个特定的陷阱上; - ) p>

I'm trying to write a log file from an ASP.NET application under IIS7, but keep getting the following exception:

UnauthorizedAccessException "Access to the path 'C:\Users\Brady\Exports' is denied."

I've been advised to use Process Monitor to help resolve this, but it's quite a complex tool, and I really don't have time to spend exploring it. Please can someone assist me and advise how to use PM to determine which user is trying to access the folder etc.

解决方案

When PM starts it displays a filter dialog. Just click 'Reset' to use the standard filtering. This will generate lots of messages, and you are only interested in very few of them. Under Process Name, select a line with the process you want to monitor. Richtclick it and choose include . That limits the reported events to the ones of your app. In the toolbar, the three rightmost icons let you filter the sources: Registry access, file system access and process/thread events. Unselect registry and process/threads, since you only want to monitor file access. In the menu choose Options - Select columns. Under Process Management, check User Name.

Now try to reproduce the error. If you are still getting too many events, you can limit the path (rightclick in the Path column and choose exclude ). You can fine tune your filtering by clicking Ctrl-L, the interface should be self explanatory. (Oh, just remember to click Add before clicking OK when you want to create a new filter rule... I almost always fall for that particular trap ;-)

这篇关于如何使用Process Monitor来解决UnauthorizedAccessException的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆