Reputation: 21176
Does the ApplicationInsights.config need to sit in the output directory's (bin folder) root directory, or can i put it inside sub folders in the output directory (bin folder)
<Content Include="Service References\**" Exclude="Service References\Application Insights\ApplicationInsights.config" />
<Content Include="Service References\Application Insights\ApplicationInsights.config">
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
</Content>
I can't find information on whether that's allowed or not:
Upvotes: 2
Views: 597
Reputation: 38529
As you've seen, this is currently the case; It only looks in AppDomain.CurrentDomain.BaseDirectory
for ApplicationInsights.config
It's hard-coded for the dotnet framework implementation at least.
Interestingly, the netstandard version returns null for that method.
Upvotes: 1
Reputation: 21176
My colleague in ops has deployed the solution and apparently the ApplicationInsights.config is not picked up unless it's included in the root directory. Hopefully Microsoft will add that to their documentation... Or perhaps allow it to be configured in the future.
Seems odd that it just has to be in the root of the bin folder. *shrugs*
Upvotes: 2