【问题标题】:Does the ApplicationInsights.config need to sit in the output directory's root directoryApplicationInsights.config 是否需要位于输出目录的根目录中
【发布时间】:2018-07-31 10:43:23
【问题描述】:

ApplicationInsights.config 是否需要放在输出目录(bin 文件夹)的根目录中,或者我可以将它放在输出目录(bin 文件夹)的子文件夹中

<Content Include="Service References\**" Exclude="Service References\Application Insights\ApplicationInsights.config" />
<Content Include="Service References\Application Insights\ApplicationInsights.config">
  <CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>

我找不到有关是否允许这样做的信息:

https://docs.microsoft.com/en-us/azure/application-insights/app-insights-configuration-with-applicationinsights-config

【问题讨论】:

    标签: azure-application-insights


    【解决方案1】:

    我的 ops 同事已经部署了解决方案,显然 ApplicationInsights.config 不会被拾取,除非它包含在根目录中。希望 Microsoft 将其添加到他们的文档中......或者可能允许在未来对其进行配置。

    它必须位于 bin 文件夹的根目录中,这似乎很奇怪。 *耸耸肩*

    【讨论】:

      【解决方案2】:

      如您所见,目前是这种情况;它只在AppDomain.CurrentDomain.BaseDirectory 中查找ApplicationInsights.config

      至少是 dotnet 框架实现的hard-coded

      有趣的是,该方法的 netstandard 版本 returns null

      【讨论】:

        猜你喜欢
        • 2015-04-29
        • 2011-05-10
        • 2023-03-02
        • 1970-01-01
        • 2015-04-19
        • 1970-01-01
        • 2014-02-15
        • 2015-01-11
        • 2011-11-22
        相关资源
        最近更新 更多