1
0
Форкнуть 0
ASP.NET Core web applications monitoring
Перейти к файлу
Cijo Thomas 49fd6dddab
Add new package for .NET Core WorkerServices (Adds GenericHost support) (#975)
2019-09-12 12:53:39 -07:00
.github minor wordings change in github templates and readme etc. (#892) 2019-05-31 11:36:59 -07:00
.vsts Add new package for .NET Core WorkerServices (Adds GenericHost support) (#975) 2019-09-12 12:53:39 -07:00
Schema Fix spelling after merge (#943) 2019-07-22 16:45:04 -07:00
keys Tilee/test signing (#689) 2018-05-16 13:31:48 -07:00
src Add new package for .NET Core WorkerServices (Adds GenericHost support) (#975) 2019-09-12 12:53:39 -07:00
test Add new package for .NET Core WorkerServices (Adds GenericHost support) (#975) 2019-09-12 12:53:39 -07:00
.gitattributes Update to RC2 along with the renaming of dependencies, Renaming To AspNetCore and Change the runtime to CLI 2016-03-17 13:21:03 -07:00
.gitignore Gitignore 2017-12-22 13:57:10 -08:00
ApplicationInsights.AspNetCore.sln Add new package for .NET Core WorkerServices (Adds GenericHost support) (#975) 2019-09-12 12:53:39 -07:00
CHANGELOG.md Add new package for .NET Core WorkerServices (Adds GenericHost support) (#975) 2019-09-12 12:53:39 -07:00
CleanPackages.ps1 Updating scripts and retaining old scripts 2016-05-06 11:30:54 -07:00
CleanPackagesCore.ps1 Updating scripts and retaining old scripts 2016-05-06 11:30:54 -07:00
Common.targets removed additional white spaces 2015-07-06 09:15:38 -07:00
GenerateReleaseMetadata.ps1 release metadata 2018-04-11 14:29:45 -07:00
LICENSE Initial commit 2015-03-17 12:39:40 -07:00
Microsoft-Security-Recommended.ruleset Added code analysis. 2016-08-15 10:14:40 -07:00
NuGet.config Fix duplicated request telemetry when multiple hosts run in the same process (#787) 2018-12-03 16:57:37 -08:00
NuGet.exe add script to audit nupkg during build. (#766) 2018-10-08 16:39:32 -07:00
NugetAudit.ps1 Fix Nuget Audit 2019-01-29 17:53:22 -08:00
Readme.md minor wordings change in github templates and readme etc. (#892) 2019-05-31 11:36:59 -07:00
RunTests.cmd Added intermediateoutput path to all projects without which 2.0 CLI had issues building. Also aded scripts to run builds and tests. 2017-11-21 13:28:12 -08:00
RunTestsCore.ps1 Return to root solution dir after tests are executed (#406) 2017-04-26 00:52:31 -07:00
SetEnv.targets Marked the analyzers for build only and not NuGet packaging. Rev'ed versioning. 2016-09-28 16:10:26 -07:00
Signing.props new cert (#950) 2019-07-26 13:13:25 -07:00
ThirdPartyNotices.txt Removing unused external test dependencies and adding third party notice 2016-09-01 16:59:07 -07:00
build.ps1 Making properties automatic and changing the build definition to release 2016-05-09 12:30:44 -07:00
buildDebug.cmd Added intermediateoutput path to all projects without which 2.0 CLI had issues building. Also aded scripts to run builds and tests. 2017-11-21 13:28:12 -08:00
buildRelease.cmd Added intermediateoutput path to all projects without which 2.0 CLI had issues building. Also aded scripts to run builds and tests. 2017-11-21 13:28:12 -08:00
clean.cmd Modified clean.cmd 2017-07-13 17:35:53 -07:00
dirs.proj Tilee/test signing (#689) 2018-05-16 13:31:48 -07:00
disablestrongnamevalidation.ps1 Remove signing from test projects 2018-02-05 11:38:57 -08:00
enablestrongnamevalidation.ps1 Remove signing from test projects 2018-02-05 11:38:57 -08:00
findMsBuild.cmd latest dotnet cli sdk. fix local test run scripts 2018-02-05 13:39:43 -08: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.