ApplicationInsights-dotnet/NETCORE
Timothy Mothra dc1df8341d
consolidate changelog (#1302)
* consolidate changelog

* link to other

* fix merge conflict
2019-11-14 12:44:57 -08:00
..
.github Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
.vsts Tilee/everything (#1275) 2019-11-07 13:22:11 -08:00
Schema Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
keys Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
src Tilee/everything (#1275) 2019-11-07 13:22:11 -08:00
test Tilee/everything (#1275) 2019-11-07 13:22:11 -08:00
ApplicationInsights.AspNetCore.sln Tilee/reorg props (#1295) 2019-11-11 14:44:42 -08:00
CleanPackages.ps1 Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
CleanPackagesCore.ps1 Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
Common.targets Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
Directory.Build.props Tilee/reorg props (#1295) 2019-11-11 14:44:42 -08:00
LICENSE Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
NuGet.config Tilee/everything (#1275) 2019-11-07 13:22:11 -08:00
Product.props Tilee/reorg props (#1295) 2019-11-11 14:44:42 -08:00
Readme.md Update README.md (#1265) 2019-10-25 14:27:54 -07:00
RunTests.cmd Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
RunTestsCore.ps1 Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
Signing.props Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
SourceRoot.marker Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
ThirdPartyNotices.txt Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
build.ps1 Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
buildDebug.cmd Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
buildRelease.cmd Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
clean.cmd Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00
findMsBuild.cmd Migrate AspNetCoreSDK to Base repo (#1264) 2019-10-25 13:28:57 -07:00

Readme.md

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

root\
    ApplicationInsights.AspNetCore.sln - Main Solution

    src\
        ApplicationInsights.AspNetCore - Application Insights package

    test\
        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

Developing

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

Building

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.

Testing/Debugging

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:

services.AddFunctionalTestTelemetryChannel();

Branches

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