- html - 出于某种原因,IE8 对我的 Sass 文件中继承的 html5 CSS 不友好?
- JMeter 在响应断言中使用 span 标签的问题
- html - 在 :hover and :active? 上具有不同效果的 CSS 动画
- html - 相对于居中的 html 内容固定的 CSS 重复背景?
我有一个 Web 应用程序(滥用)使用 System.Diagnostics Tracing。和往常一样,一切都很顺利,直到我们本周开始制作,我们的听众都没有受到影响。
经过一番研究,这显然是用户帐户权限问题。从 ApplicationPoolIdentity 更改为 LocalSystem 似乎可以解决问题。但是,在我们的生产环境中,将运行的用户更改为 LocalSystem 是不行的。我怀疑这与the security permission有关需要运行非托管代码。
还有其他方法可以使跟踪在 ApplicationPoolIdentity 下工作吗?或者(正如我们的系统管理员建议的那样)我们应该创建一个自定义帐户来运行该应用程序池吗?
最佳答案
您有什么证据表明您的 TraceListener 没有受到攻击?在我看来,他们更有可能受到攻击,但他们没有访问某些所需资源(例如文件)的权限。在这种情况下,解决方案可能很简单,只需授予您对相应磁盘文件夹的 ApplicationPoolIdentity 权限即可。
我建议您发布您正在使用的监听器的更多详细信息(例如 web.config 文件的 <system.diagnostics>
部分,以及您看到的确切错误。
I suspect it has something to do with the security permission needed to run unmanaged code.
您认为哪些跟踪监听器使用非托管代码?
We tried EventLogTraceListener and even TextWriterListener on a folder that the user should have permissions.
您需要explicitly give permissions to the application pool identity ,默认情况下没有权限。
将 TextWriterListener 使用的文件夹的读/写权限授予“IIS AppPool\DefaultAppPool”或您正在使用的任何应用程序池名称。
对于事件日志,非管理员通常没有创建事件源的权限,因此您应该在应用程序安装期间手动创建事件源,或者也可以使用现有的事件源(例如“.NET 运行时”)。
I think that it's not a specific listener that needs unmanaged code permissions, but the whole tracing functionality.
你在这里咆哮错误的树。运行非托管代码的权限是 Code Access Security
权限,不会受到应用程序运行的帐户的影响。而且你说在LocalSystem帐户下工作正常。
关于asp.net - System.Diagnostics.Trace 在 ApplicationPoolIdentity 下的 Web 应用程序中不起作用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/18793727/
是这样的代码: System.Diagnostics.StackFrame stackFrame = new System.Diagnostics.StackFrame(); System.Refle
我正在为 Azure 网站配置诊断和 IIS 日志。Azure 管理门户显示将应用程序诊断存储到 Azure 表存储的选项: 单击“管理表存储”时会弹出一个对话框以提供 Azure 表详细信息: Bl
我正在为 Azure 网站配置诊断和 IIS 日志。Azure 管理门户显示将应用程序诊断存储到 Azure 表存储的选项: 单击“管理表存储”时会弹出一个对话框以提供 Azure 表详细信息: Bl
我计划在我的一个项目中使用 PerformanceCounter。我只知道Microsoft.Diagnostics 。然而我偶然发现了一个相当新的库 Microsoft.Diagnostics.Ev
我正在尝试设置 .NET 跟踪。我可以通过 System.Diagnostics.Trace 进行基本跟踪,但由于复杂的原因,我必须通过 System.Diagnostics.TraceSource
前言 最新一直在忙着项目上的事情,很久没有写博客了,在这里对关注我的粉丝们说声抱歉,后面我可能更多的分享我们在微服务落地的过程中的一些经验。那么今天给大家讲一下在 .NET Core 2 中引入的
我不确定我是否理解 ETW 使用 System.Diagnostics.Tracing 和使用 System.Diagnostics.Trace 之间的主要区别。我知道使用它们我可以将事件转储到一些输
错误:未为<>和System.Diagnostics.Process类型定义运算符System.Diagnostics.Process。 功能错误 Public Shared Function Por
据我了解,System.Console 默认会写入 STDOUT,但是 System.Diagnostics.Trace 和 System.Diagnostics.Debug 呢? ?默认行为是什么,
启动应用程序时,我总是在“诊断工具”窗口中收到错误消息: The diagnostic tools failed unexpectedly. The Diagnostics Hub output in
我正在支持一个大型的旧应用程序。该代码使用 NLog 以及 Debug.WriteLine 和 Trace.WriteLine。我正在尝试将 Debug.WriteLine 和 Trace.Write
请求处理的正常时间范围是多少? 最佳答案 50 毫秒到 500 毫秒之间的任何时间都很好。 这当然只是服务器端。看看Yahoo's Best Practices for Speeding Up You
我已经克隆了 Typescript 存储库并正在查看代码,但它充满了这个错误: Cannot find name 'Diagnostics' 在看起来像这样的行上: Diagnostics._0_ex
我没有找到有关 Trace 和 TraceListener 如何跨多个域工作的信息。 Trace.WriteLine 的调用是跨多个域使用相同的实例,还是在每个域上创建自己的 Trace 类实例? 换
每次我在 Perl 中输入 use diagnostics 时,我都会收到一条错误消息说 couldn't find diagnostics data in /file name.etc... 有人可
为了解决通过不发送电子邮件的smtp服务器发送电子邮件的问题,建议我启用使用System.Diagnosis.TextWriterTraceListener进行日志记录以跟踪与smtp服务器的通信以跟
使用 perl 我几乎总是使用: use strict; use diagnostics; 我建议“使用诊断”而不是 use warnings; here我收到了一些负面反馈。所以,现在我在想: us
我正在研究使用log4net和System.Diagnostics.Trace进行日志记录之间的差异,并且我对观察到的性能差异感到好奇。 我创建了一个测试应用程序,以比较两种情况下这两种日志记录方法的
如何在PowerShell中将Y传递到由System.Diagnostic.Process启动的进程中? function Start-NewPlinkProcess( [string
这个问题不太可能对任何 future 的访客有帮助;它只与一个较小的地理区域、一个特定的时间点或一个非常狭窄的情况相关,通常不适用于全世界的互联网受众。如需帮助使此问题更广泛适用,visit the
我是一名优秀的程序员,十分优秀!