Skip to content
ASP.NET Core web applications monitoring
C# HTML PowerShell Other
Branch: develop
Clone or download
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Type Name Latest commit message Commit time
Failed to load latest commit information.
.github minor wordings change in github templates and readme etc. (#892) May 31, 2019
.vsts Add new package for .NET Core WorkerServices (Adds GenericHost suppor… Sep 12, 2019
Schema Fix spelling after merge (#943) Jul 22, 2019
keys Tilee/test signing (#689) May 16, 2018
src Bump to next beta1 (#1009) Oct 17, 2019
test Add new RoleName initializer for Azure Web App to accurately reflect … Oct 16, 2019
.gitattributes Update to RC2 along with the renaming of dependencies, Renaming To As… Mar 17, 2016
.gitignore Gitignore Dec 22, 2017
ApplicationInsights.AspNetCore.sln nupkg.props (#938) Sep 13, 2019 merge develop Oct 17, 2019
CleanPackages.ps1 Updating scripts and retaining old scripts May 6, 2016
CleanPackagesCore.ps1 Updating scripts and retaining old scripts May 6, 2016
Common.targets Remove roslyn and dotnetcore nuget sources Aug 15, 2015
GenerateReleaseMetadata.ps1 release metadata Apr 11, 2018
LICENSE Initial commit Mar 17, 2015
Microsoft-Security-Recommended.ruleset Added code analysis. Aug 15, 2016
NuGet.config Tilee/bump version 2.8 (#983) Sep 21, 2019
NuGet.exe add script to audit nupkg during build. (#766) Oct 8, 2018
NugetAudit.ps1 Fix Nuget Audit Jan 30, 2019
Nupkg.props nupkg.props (#938) Sep 13, 2019 Update Readme with new package: WorkerService (#981) Sep 16, 2019
RunTests.cmd Added intermediateoutput path to all projects without which 2.0 CLI h… Nov 21, 2017
RunTestsCore.ps1 Return to root solution dir after tests are executed (#406) Apr 26, 2017
SetEnv.targets Marked the analyzers for build only and not NuGet packaging. Rev'ed v… Sep 28, 2016
Signing.props new cert (#950) Jul 26, 2019
ThirdPartyNotices.txt Removing unused external test dependencies and adding third party notice Sep 1, 2016
build.ps1 Making properties automatic and changing the build definition to release May 9, 2016
buildDebug.cmd Added intermediateoutput path to all projects without which 2.0 CLI h… Nov 21, 2017
clean.cmd Modified clean.cmd Jul 14, 2017
dirs.proj Tilee/test signing (#689) May 16, 2018
disablestrongnamevalidation.ps1 Remove signing from test projects Feb 5, 2018
enablestrongnamevalidation.ps1 Remove signing from test projects Feb 5, 2018
findMsBuild.cmd latest dotnet cli sdk. fix local test run scripts Feb 5, 2018

NuGet packages

Windows: Build Status

Linux :Build Status

Microsoft Application Insights for ASP.NET Core applications

This repository has a code for Application Insights monitoring of ASP.NET Core applications. Read about contribution policies on Application Insights Home repository

Getting Started

Application Insights monitoring is a service that allows you to collect monitoring and diagnostics information about your application. The getting started guide shows how you can onboard your ASP.NET Core web application to use the Application Insights SDK.

Repository structure

    ApplicationInsights.AspNetCore.sln - Main Solution

        ApplicationInsights.AspNetCore - Application Insights package

        ApplicationInsights.AspNetCore.Tests - Unit tests
        FunctionalTestUtils - Test utilities for functional tests
        MVCFramework.FunctionalTests - functional tests for MVC application targeting NetCore1.1,NetCore2.0 and NET45
        WebApi.FunctionalTests - functional tests for Web API application targeting NetCore1.1,NetCore2.0 and NET45
		EmptyApp.FunctionalTests - functional tests for an Empty application targeting NetCore1.1,NetCore2.0 and NET45
        PerfTest - performance test


To successfully build the sources on your machine, make sure you've installed the following prerequisites:


Once you've installed the prerequisites execute buildDebug.cmd or buildRelease.cmd script in the repository root to build the project locally. You can also open the solution in Visual Studio and build the ApplicationInsights.AspNetCore.sln solution directly.


Execute the RunTests.cmd script in the repository root.

You can also open the solution in Visual Studio and run tests directly from Visual Studio Test Explorer. However, as the tests has multiple targets, Test Explorer only shows the first target from in .csproj. To debug/run tests from a particular TargetFramework with Visual Studio, only option is to re-arrange the such that the intended target comes first. This is a Visual Studio limitation and is likely removed in the future.

Running and writing tests

There are two sets of tests unit tests and functional tests. Please use unit tests for all features testing. The purpose of functional tests is just end-to-end validation of functionality on sample applications.

Functional tests Functional tests are regular web applications with unit tests integrated into them. Application can be compiled as a regular web application as well as set of tests. Typical functional tests will do the following:

  1. Host the current project in In-Proc server.
  2. Initialize application insights telemetry channel.
  3. Initiate request to self hosted web application using HttpClient.
  4. Check data received in telemetry channel.

The following are modifications made to a regular web application to make it work this way:

Add dependencies to .csproj:

"FunctionalTestUtils": "1.0.0-*",
"dotnet.test.xunit": "1.0.0-*",
"xunit": "2.1.0"

and test command:

"test": "xunit"

Add this initialization logic to Startup.cs:



This project has adopted the Microsoft Open Source Code of Conduct. For more information see the Code of Conduct FAQ or contact with any additional questions or comments.

You can’t perform that action at this time.