bfd24f36b3 | ||
---|---|---|
keys | ||
src/Microsoft.ApplicationInsights.AspNetCore | ||
test | ||
.gitattributes | ||
.gitignore | ||
ApplicationInsights.AspNetCore.sln | ||
CleanPackages.ps1 | ||
Common.targets | ||
LICENSE | ||
NuGet.config | ||
Readme.md | ||
RunTests.ps1 | ||
SetEnv.targets | ||
build.cmd | ||
dirs.proj | ||
global.json |
Readme.md
Microsoft Application Insights for ASP.NET 5 applications
This repository has a code for Application Insights monitoring of ASP.NET 5 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. Getting started guide shows how you can onboard your ASP.NET 5 web application to use Application Insights SDK.
Application Insights collects lots of out-of-the-box information like requests, exceptions and usage. It also allows to configure additional data collection. Configure guide demonstrates the most common tasks you may want to do.
Repository structure
root\
ApplicationInsights.AspNet.sln - Main Solution
src\
ApplicationInsights.AspNet - Application Insights package
test\
ApplicationInsights.AspNet.Tests - Unit tests
FunctionalTestUtils - test utilities for functional tests
Mvc6Framework45.FunctionalTests - functional tests for MVC application
WebApiShimFw46.FunctionalTests - functional tests for Web API application
PerfTest - performance test
Developing
Pre-requisites
- Visual Studio 2015.
- Node.js.
- Git.
- Source Code.
git clone https://github.com/Microsoft/ApplicationInsights-aspnetcore.git
Building
From Visual Studio 2015
devenv ApplicationInsights.AspNet.sln
From Visual Studio 2015 Developer Command Prompt.
msbuild ApplicationInsights.AspNet.sln
- If you get NPM package restore errors, make sure Node and NPM are added to PATH.
- If you get Bower pacakge restore errors, make sure Git is added to PATH.
- If you get Dnu package restore errors, make sure Dnx is installed or open the solution in Visual Studio 2015, which will take care of this.
Branches
- We follow the Git Flow model.
- master has the latest version released on NuGet.org.
- develop has the code for the next release.
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 test will do the following:
- Host the current project in In-Proc server.
- Initialize application insights telemetry channel.
- Initiate request to self hosted web application using HttpClient.
- Check data received in telemetry channel.
Those are modifications made for regular web application to make it work this way:
Add dependencies to project.json:
"FunctionalTestUtils": "1.0.0-*",
"xunit.runner.dnx": "2.1.0-rc1-*",
"xunit": "2.1.0-rc1-*"
and test command:
"test": "xunit.runner.dnx"
Add this initialization logic to Startup.cs:
services.AddFunctionalTestTelemetryChannel();
Running Tests Open a developer command prompt, navigate to project folder and run:
dnx . test