Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings
This repository was archived by the owner on Jun 10, 2020. It is now read-only.

ASP.NET Core web applications monitoring

NotificationsYou must be signed in to change notification settings

microsoft/ApplicationInsights-aspnetcore

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Please pardon our progress...We are currently in the process of consolidating our github repos.Seemicrosoft/ApplicationInsights-dotnet#1214

NuGet packages

Windows:Build Status

Linux :Build Status

Microsoft Application Insights for ASP.NET Core applications

This repository has a code forApplication Insights monitoring ofASP.NET Core applications. Read about contribution policies on Application Insights Homerepository

Getting Started

Application Insights monitoring is a service that allows you to collect monitoring and diagnostics information about your application. Thegetting 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 NET45EmptyApp.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 executebuildDebug.cmd orbuildRelease.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 theRunTests.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 targetfrom 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 testsFunctional 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 theMicrosoft Open Source Code of Conduct. For more information see theCode of Conduct FAQ or contactopencode@microsoft.com with any additional questions or comments.


[8]ページ先頭

©2009-2025 Movatter.jp