c# - 为什么 HttpPlatformHandler 不创建日志文件?

标签 c# asp.net iis asp.net-core

我无法再使用 ASP.NET RC1 和 HttpPlatformHandler 创建日志文件。

这是事件日志中的警告:

The description for Event ID 1004 from source HttpPlatformHandler cannot be found. Either the component that raises this event is not installed on your local computer or the installation is corrupted. You can install or repair the component on the local computer.

If the event originated on another computer, the display information had to be saved with the event.

The following information was included with the event: 

Warning: Could not create stdoutLogFile , ErrorCode = -2147024843.

相关软件版本:

  • Microsoft Http 平台处理程序 1.2
  • window 服务器 2012 R12
  • ASP.NET 5 RC1 应用程序。

我已经为 stdoutLogFile 参数尝试了各种值。我正在使用来自 http://www.iis.net/learn/extensions/httpplatformhandler/httpplatformhandler-configuration-reference 的(糟糕的)文档

我试过:

  • \?c:\temp\wtlogs\
  • c:\temp\wtlogs\
  • 没有值(value)(尝试将其登录到位于 wwwroot 和 approot 旁边的“logs”目录)

网络配置:

<configuration>
  <system.webServer>
    <handlers>
      <add name="httpplatformhandler" path="*" verb="*" modules="httpPlatformHandler" resourceType="Unspecified" />
    </handlers>
    <httpPlatform processPath="..\approot\prod.cmd" arguments="" stdoutLogEnabled="true" stdoutLogFile="\\?c:\temp\wtlogs\" startupTimeLimit="3600" forwardWindowsAuthToken="false"></httpPlatform>
  </system.webServer>
</configuration>

我设置了权限: enter image description here

应用程序池是:

enter image description here

最佳答案

此配置在“c:\temp”文件夹中创建一个日志文件。 您必须先创建“c:\temp”文件夹。

 <aspNetCore processPath="dotnet" arguments=".\Api.dll" stdoutLogEnabled="true" stdoutLogFile="c:\temp\" forwardWindowsAuthToken="false" />

关于c# - 为什么 HttpPlatformHandler 不创建日志文件?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33901121/

相关文章:

c# - 隐式与显式接口(interface)实现

c# - Dotnet-core默认使用2.0框架ubuntu

asp.net - IIS 忘记虚拟目录权限 - 加载配置文件 : Failed to start monitoring changes 时出错

asp.net-mvc - 如何将 IIS 中的默认页面设置为 Controller ?

c# - IIS 我的网站文件夹已删除

c# - 创建 'system.net/defaultproxy' 配置部分中指定的 Web 代理时出错

C# 命令行参数和 ls

c# - ListItem的方法重载匹配,参数无效

asp.net - 强制 ASP.Net MVC Bundle 按特定顺序呈现 javascript 文件

c# - StringBuilder 中的 system.outofmemoryexception