title: Do we really need ApplicationInsights.config file in C#.NET project?
body: <p>To log a piece of information like errors, information, warnings and many more we used log4NET library and logging in a local file. But our new requirement, Along with file we need to log this information into Azure Application Insights.</p>
  <p>We are working with .NET C# Library,</p>
  <p>Is really required ApplicationInsights.config file with .NET C# Project? If not what is the best approach to solving this problem.</p>
  <p>Is caching applicationInsights.config instrumentKey? if yes then what will be the solution?</p>
  <p>Scenario 1: Tried without adding ApplicationInsights.config file
  Output: Log4Net logs are not adding in Azure Application Insights</p>
  <p>Scenario 2: Tried with adding ApplicationInsights.config file
  Output: Log4Net logs are coming</p>
  <p>Scenario 3: When I add Nuget API for ApplicationInsights.Log4NetAppender, It creates log4Net section and includes AIAppender. We have separate log4Net.config and it has only File Appender. We want to use only log4Net.config and remove log4net section from App.Config file.
  Output: I removed log4Net section from App.Config and added it in log4Net.config and tested but logs are not adding in Application Insights.</p>
  <p>Scenario 4: Implemented TelemetryClient through C# code with ApplicationInsights.config logs are coming in Application Insights</p>
  <pre><code>TelemetryClient telemetryClient = new TelemetryClient();
  telemetryClient.InstrumentKey =&lt;Your Instrument Key&gt;;
  
  // To test
  telemetryClient.TrackTrace(&quot;Test through code&quot;);
  </code></pre>