【问题标题】:Where does IIS Express write log files for VS2017 / .NET Core?IIS Express 在哪里写入 VS2017 / .NET Core 的日志文件?
【发布时间】:2019-05-12 15:52:06
【问题描述】:

我有一个由 IIS Express 托管的 .NET Core 2.2 Web API 项目,并试图为一些失败的请求查找 w3c 日志文件。

我的解决方案级别 .vs\config\applicationhost.config 具有以下内容:

<siteDefaults> <logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" /> <traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" /> </siteDefaults>

如果我尝试浏览到 %IIS_USER_HOME%,我会收到错误对话框,提示 Windows 找不到“%IIS_USER_HOME%”。如何找到这个文件夹?

VS2017 视窗 10 .NET Core 2.2

【问题讨论】:

  • %IIS_USER_HOME% 转换为 `%USERPROFILE%\Documents\IISExpress`

标签: asp.net-core-webapi iis-express


【解决方案1】:

从评论中复制。

applicationHost.config 文件的前几行实际上表示了值,

<!--
    IIS configuration sections.
    For schema documentation, see
    %IIS_BIN%\config\schema\IIS_schema.xml.

    Please make a backup of this file before making any changes to it.
    NOTE: The following environment variables are available to be used
          within this file and are understood by the IIS Express.
          %IIS_USER_HOME% - The IIS Express home directory for the user
          %IIS_SITES_HOME% - The default home directory for sites
          %IIS_BIN% - The location of the IIS Express binaries
          %SYSTEMDRIVE% - The drive letter of %IIS_BIN%
-->

所以%IIS_USER_HOME% 的实际值为%USERPROFILE%\Documents\IISExpress

【讨论】:

猜你喜欢
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 1970-01-01
  • 2023-03-15
  • 1970-01-01
  • 1970-01-01
相关资源
最近更新 更多