This repository has been archived by the owner on Jun 10, 2020. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 123
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #575 from Microsoft/develop
Dev to Master for beta3 release
- Loading branch information
Showing
21 changed files
with
147 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
If you are reporting bug/issue, please provide detailed Repro instructions. | ||
|
||
## Repro Steps | ||
1. | ||
2. | ||
|
||
## Actual Behavior | ||
|
||
|
||
## Expected Behavior | ||
|
||
|
||
## Version Info | ||
SDK Version : | ||
.NET Version : | ||
How Application was onboarded with SDK(VisualStudio/StatusMonitor/Azure Extension) : | ||
OS : | ||
Hosting Info (IIS/Azure WebApps/ etc) : |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
Fix issue # . | ||
|
||
Short description of the fix: | ||
|
||
- [ ] I ran all tests locally. [Following contributer's guide] (https://github.com/Microsoft/ApplicationInsights-aspnetcore/blob/develop/Readme.md) | ||
- [ ] CHANGELOG.md updated with one line description of the fix, and a link to the original issue. | ||
|
||
|
||
For significant contributions please make sure you have completed the following items: | ||
|
||
- [ ] Changes in public surface reviewed | ||
- [ ] The PR will trigger build, unit test, and functional tests automatically. If your PR was submitted from a fork - mention one of committers to initiate the build for you. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -3,16 +3,12 @@ Microsoft Application Insights for ASP.NET Core applications | |
|
||
This repository has a code for [Application Insights monitoring](http://azure.microsoft.com/en-us/services/application-insights/) of [ASP.NET Core](https://github.com/aspnet/home) applications. Read about contribution policies on Application Insights Home [repository](https://github.com/microsoft/ApplicationInsights-home) | ||
|
||
Recent updates | ||
-------------- | ||
**Microsoft.ApplicationInsights.AspNet** was renamed to **Microsoft.ApplicationInsights.AspNetCore**. We have updated the SDK to use the stable 1.0.0 release of the .NET Core CLI runtime environment. Please note that this version is not compatible with RC1 bits of DNX environment. Furthermore, metrics stream is enabled by default in .NET Framework of ASP.NET Core. | ||
|
||
Getting Started | ||
--------------- | ||
|
||
[Application Insights monitoring](http://azure.microsoft.com/en-us/services/application-insights/) is a service that allows you to collect monitoring and diagnostics information about your application. The [getting started](https://github.com/Microsoft/ApplicationInsights-aspnet5/wiki/Getting-Started) guide shows how you can onboard your ASP.NET Core web application to use the Application Insights SDK. | ||
|
||
Application Insights collects a lot of information out-of-the-box such as requests, exceptions, and usage. It also allows you to configure additional data collection. The [configure](https://github.com/Microsoft/ApplicationInsights-aspnet5/wiki/Configure) guide demonstrates the most common tasks you may want to do. | ||
Application Insights collects a lot of information out-of-the-box such as requests, dependencies, exceptions, and usage. It also allows you to configure additional data collection. The [configure](https://github.com/Microsoft/ApplicationInsights-aspnet5/wiki/Configure) guide demonstrates the most common tasks you may want to do. | ||
|
||
|
||
Repository structure | ||
|
@@ -27,65 +23,36 @@ root\ | |
test\ | ||
ApplicationInsights.AspNetCore.Tests - Unit tests | ||
FunctionalTestUtils - test utilities for functional tests | ||
MVCFramework45.FunctionalTests - functional tests for MVC application | ||
WebApiShimFw46.FunctionalTests - functional tests for Web API application | ||
FunctionalTestUtils - Test utilities for functional tests | ||
MVCFramework.FunctionalTests - functional tests for MVC application targetting NetCore1.1,NetCore2.0 and NET45 | ||
WebApi.FunctionalTests - functional tests for Web API application targetting NetCore1.1,NetCore2.0 and NET45 | ||
EmptyApp.FunctionalTests - functional tests for an Empty application targetting NetCore1.1,NetCore2.0 and NET45 | ||
PerfTest - performance test | ||
``` | ||
|
||
Developing | ||
---------- | ||
|
||
**Note: The current version (Microsoft.ApplicationInsights.AspNetCore: 1.0.0) is no longer compatible with DNX runtime and ASP.NET 5 RC1 bits. Please visit [Migration to ASP.NET Core](https://docs.asp.net/en/latest/migration/index.html) to upgrade the application to ASP.NET Core 1.0.0.** | ||
|
||
## Pre-requisites | ||
- [Visual Studio 2015 Update 3](https://www.visualstudio.com/en-us/downloads/visual-studio-2015-downloads-vs.aspx). | ||
- [Visual Studio 2015 CLI Tools](https://go.microsoft.com/fwlink/?LinkId=817245). | ||
- [.NET Core CLI](https://www.microsoft.com/net/download). | ||
- [Node.js](https://nodejs.org/download). | ||
- [Git](http://git-scm.com/download). | ||
- Source Code. | ||
|
||
``` | ||
git clone https://github.com/Microsoft/ApplicationInsights-aspnetcore.git | ||
``` | ||
To successfully build the sources on your machine, make sure you've installed the following prerequisites: | ||
* Visual Studio 2017 Community or Enterprise. Please make sure to install all the latest updates to Visual Studio | ||
* .NET 4.6 | ||
* .NET Core 2.0 | ||
|
||
## Building | ||
From Visual Studio 2015 | ||
``` | ||
devenv ApplicationInsights.AspNetCore.sln | ||
``` | ||
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. | ||
|
||
From Visual Studio 2015 Developer Command Prompt: Navigate to the source project folder and use the following commands to build the project: | ||
## Testing/Debugging | ||
Execute the ```runAllTests.cmd``` script in the repository root. | ||
|
||
``` | ||
dotnet restore &REM Restores the dependency packages | ||
dotnet build &REM Builds the project | ||
``` | ||
- If you get NPM package restore errors, make sure Node and NPM are added to PATH. | ||
- If you get Bower package restore errors, make sure Git is added to PATH. | ||
- If you get dotnet package restore errors, make sure [.NET Core CLI is installed](https://github.com/dotnet/cli/blob/rel/1.0.0/Documentation/cli-installation-scenarios.md) and the nuget feeds are up to date. | ||
- In case of **.NET Core** applications, if you run into restore errors with respect to application insights dependency, please add ```"dnxcore50"``` and ```"portable-net45+win8" ``` to the imports list (if it does not exist), under ```frameworks``` section of ```project.json```, as described below. Please visit [Migrating from DNX](http://dotnet.github.io/docs/core-concepts/dnx-migration.html) for more details. | ||
``` json | ||
{ | ||
"frameworks": { | ||
"netcoreapp1.0": { | ||
"imports": ["dnxcore50", "portable-net45+win8"] | ||
} | ||
} | ||
} | ||
``` | ||
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 <TargetFrameworks> in .csproj. To debug/run tests from a particular TargetFramework with Visual Studio, only option is to re-arrange the <TargetFrameworks> | ||
such that the intented target comes first. This is a Visual Studio limitation and is likely removed in the future. | ||
|
||
## Branches | ||
- We follow the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model) model. | ||
- [master](https://github.com/Microsoft/ApplicationInsights-aspnetcore/tree/master) has the _latest_ version released on [NuGet.org](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore). | ||
- [develop](https://github.com/Microsoft/ApplicationInsights-aspnetcore/tree/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 tests will do the following: | ||
|
||
|
@@ -96,8 +63,7 @@ Functional tests are regular web applications with unit tests integrated into th | |
|
||
The following are modifications made to a regular web application to make it work this way: | ||
|
||
Add dependencies to project.json: | ||
|
||
Add dependencies to .csproj: | ||
|
||
``` | ||
"FunctionalTestUtils": "1.0.0-*", | ||
|
@@ -117,27 +83,10 @@ Add this initialization logic to Startup.cs: | |
services.AddFunctionalTestTelemetryChannel(); | ||
``` | ||
|
||
*Running Tests* | ||
You can run unit tests using Visual Studio. | ||
|
||
You can run unit tests using .NET CLI from command line. The prerequisite to this is that you should make sure you have the latest version of .NET CLI. You can check the available runtime using the following command: | ||
``` | ||
dotnet --version | ||
``` | ||
|
||
If you are seeing that ```dotnet``` is not available (or defined), install .NET CLI: [.NET Core + CLI tools (SDK)](https://github.com/dotnet/cli). | ||
|
||
After that you can open a developer command prompt, navigate to each test folder and run: | ||
``` | ||
dotnet restore &REM Restores the dependency packages | ||
dotnet build &REM Builds the test project | ||
dotnet test &REM Runs the tests within the test project | ||
``` | ||
|
||
You can also run all tests using the following Powershell from root directory. | ||
|
||
``` | ||
powershell .\RunTestsCore.ps1 | ||
``` | ||
## Branches | ||
- We follow the [Git Flow](http://nvie.com/posts/a-successful-git-branching-model) model. | ||
- [master](https://github.com/Microsoft/ApplicationInsights-aspnetcore/tree/master) has the _latest_ version released on [NuGet.org](https://www.nuget.org/packages/Microsoft.ApplicationInsights.AspNetCore). | ||
- [develop](https://github.com/Microsoft/ApplicationInsights-aspnetcore/tree/develop) has the code for the _next_ release. | ||
|
||
This project has adopted the [Microsoft Open Source Code of Conduct](https://opensource.microsoft.com/codeofconduct/). For more information see the [Code of Conduct FAQ](https://opensource.microsoft.com/codeofconduct/faq/) or contact [[email protected]](mailto:[email protected]) with any additional questions or comments. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@echo off | ||
|
||
IF NOT DEFINED MSBUILD CALL findMsBuild.cmd | ||
|
||
SET ToolsVersion=15.0 | ||
SET ProjectName=Msbuild.All | ||
SET Configuration=Debug | ||
SET Platform="Any CPU" | ||
|
||
"%MSBUILD%" dirs.proj /nologo /m:1 /fl /toolsversion:%ToolsVersion% /flp:logfile=%ProjectName%.%Platform%.log;v=d /flp1:logfile=%ProjectName%.%Platform%.wrn;warningsonly /flp2:logfile=%ProjectName%.%Platform%.err;errorsonly /p:Configuration=%Configuration% /p:Platform=%Platform% /p:RunCodeAnalysis="False" /flp3:logfile=%ProjectName%.%Platform%.prf;performancesummary /flp4:logfile=%ProjectName%.%Platform%.exec.log;showcommandline /p:BuildSingleFilePackage=true /p:IsOfficialBuild=%IsOfficialBuild% /p:RunTests=True | ||
|
||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@echo off | ||
|
||
IF NOT DEFINED MSBUILD CALL findMsBuild.cmd | ||
|
||
SET ToolsVersion=15.0 | ||
SET ProjectName=Msbuild.All | ||
SET Configuration=Debug | ||
SET Platform="Any CPU" | ||
|
||
"%MSBUILD%" dirs.proj /nologo /m:1 /fl /toolsversion:%ToolsVersion% /flp:logfile=%ProjectName%.%Platform%.log;v=d /flp1:logfile=%ProjectName%.%Platform%.wrn;warningsonly /flp2:logfile=%ProjectName%.%Platform%.err;errorsonly /p:Configuration=%Configuration% /p:Platform=%Platform% /p:RunCodeAnalysis="False" /flp3:logfile=%ProjectName%.%Platform%.prf;performancesummary /flp4:logfile=%ProjectName%.%Platform%.exec.log;showcommandline /p:BuildSingleFilePackage=true /p:IsOfficialBuild=%IsOfficialBuild% /p:RunTests=False | ||
|
||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,12 @@ | ||
@echo off | ||
|
||
IF NOT DEFINED MSBUILD CALL findMsBuild.cmd | ||
|
||
SET ToolsVersion=15.0 | ||
SET ProjectName=Msbuild.All | ||
SET Configuration=Release | ||
SET Platform="Any CPU" | ||
|
||
"%MSBUILD%" dirs.proj /nologo /m:1 /fl /toolsversion:%ToolsVersion% /flp:logfile=%ProjectName%.%Platform%.log;v=d /flp1:logfile=%ProjectName%.%Platform%.wrn;warningsonly /flp2:logfile=%ProjectName%.%Platform%.err;errorsonly /p:Configuration=%Configuration% /p:Platform=%Platform% /p:RunCodeAnalysis="False" /flp3:logfile=%ProjectName%.%Platform%.prf;performancesummary /flp4:logfile=%ProjectName%.%Platform%.exec.log;showcommandline /p:BuildSingleFilePackage=true /p:IsOfficialBuild=%IsOfficialBuild% /p:RunTests=False | ||
|
||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,27 @@ | ||
@echo off | ||
|
||
IF NOT DEFINED VSVERSION SET VSVERSION=15.0 | ||
|
||
IF DEFINED MSBUILD ( | ||
IF EXIST "%MSBUILD%" GOTO :eof | ||
) | ||
|
||
SET VSWHERE=..\packages\vswhere\tools\vswhere.exe | ||
IF NOT EXIST "%VSWHERE%" nuget.exe install vswhere -NonInteractive -ExcludeVersion -Source https://www.nuget.org/api/v2 > nul | ||
|
||
FOR /f "usebackq tokens=*" %%i in (`"%VSWHERE%" -version %VSVERSION% -products * -requires Microsoft.Component.MSBuild -property installationPath`) DO ( | ||
SET MSBUILD=%%i\MSBuild\%VSVERSION%\Bin\MSBuild.exe | ||
) | ||
|
||
IF NOT DEFINED MSBUILD ( | ||
ECHO Could not find MSBuild %VSVERSION%. Please SET MSBUILD=^<path-to-MSBuild.exe^> and try again. | ||
GOTO :eof | ||
) | ||
|
||
IF NOT EXIST "%MSBUILD%" ( | ||
ECHO vswhere.exe claims that MSBuild is at !MSBUILD! but it does not exist. | ||
ECHO Please SET MSBUILD=^<path-to-MSBuild.exe^> and try again. | ||
GOTO :eof | ||
) | ||
|
||
ECHO Using MSBuild from %MSBUILD% |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.