Skip to content
This repository has been archived by the owner on Jun 10, 2020. It is now read-only.

Commit

Permalink
Merge pull request #575 from Microsoft/develop
Browse files Browse the repository at this point in the history
Dev to Master for beta3 release
  • Loading branch information
cijothomas authored Dec 14, 2017
2 parents fe3be8d + 4a5dccf commit bde2dca
Show file tree
Hide file tree
Showing 21 changed files with 147 additions and 98 deletions.
18 changes: 18 additions & 0 deletions .github/ISSUE_TEMPLATE.md
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) :
12 changes: 12 additions & 0 deletions .github/PULL_REQUEST_TEMPLATE.md
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.
7 changes: 7 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,12 @@
# Changelog

## Version 2.2.0-beta3
- Updated Web/Base SDK version dependency to 2.5.0-beta2.
- This version of Base SDK referred contains fix to a bug in ServerTelemetryChannel which caused application to crash on non-windows platforms. Details on fix and workaround(https://github.com/Microsoft/ApplicationInsights-dotnet/issues/654) Original issue (https://github.com/Microsoft/ApplicationInsights-aspnetcore/issues/551)

## Version 2.2.0-beta2
- Same bits as beta1. Only change is that the symbols for the binaries are indexed in Microsoft symbol servers. Beta1 symbols will not be available.

## Version 2.2.0-beta1

- Project is upgraded to work with Visual Studio 2017. Also projects are modified to use csproj instead of project.json.
Expand Down
93 changes: 21 additions & 72 deletions Readme.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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:

Expand All @@ -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-*",
Expand All @@ -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.
12 changes: 12 additions & 0 deletions RunTests.cmd
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
15 changes: 0 additions & 15 deletions build.cmd

This file was deleted.

12 changes: 12 additions & 0 deletions buildDebug.cmd
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
12 changes: 12 additions & 0 deletions buildRelease.cmd
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
27 changes: 27 additions & 0 deletions findMsBuild.cmd
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%
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,10 @@ public static IServiceCollection AddApplicationInsightsTelemetry(this IServiceCo
excludedDomains.Add("localhost");
excludedDomains.Add("127.0.0.1");
var includedActivities = module.IncludeDiagnosticSourceActivities;
includedActivities.Add("Microsoft.Azure.EventHubs");
includedActivities.Add("Microsoft.Azure.ServiceBus");
return module;
});

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@
<Description>Application Insights for ASP.NET Core web applications. See https://azure.microsoft.com/documentation/articles/app-insights-asp-net-five/ for more information. Privacy statement: https://go.microsoft.com/fwlink/?LinkId=512156</Description>
<Copyright>Copyright © Microsoft. All Rights Reserved.</Copyright>
<AssemblyTitle>Application Insights for ASP.NET Core Web Applications</AssemblyTitle>
<VersionPrefix>2.2.0-beta2</VersionPrefix>
<VersionPrefix>2.2.0-beta3</VersionPrefix>
<Authors>Microsoft</Authors>
<TargetFrameworks>net451;net46;netstandard1.6</TargetFrameworks>
<DelaySign>true</DelaySign>
Expand All @@ -23,13 +23,14 @@
<RepositoryUrl>https://github.com/Microsoft/ApplicationInsights-aspnetcore.git</RepositoryUrl>
<NetStandardImplicitPackageVersion Condition=" '$(TargetFramework)' == 'netstandard1.6' ">1.6.1</NetStandardImplicitPackageVersion>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\src\$(MSBuildProjectName)</OutputPath>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)'=='' ">..\..\artifacts\obj\src\$(MSBuildProjectName)</IntermediateOutputPath>
</PropertyGroup>

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|AnyCPU'">
<DebugType>full</DebugType>
<DebugSymbols>true</DebugSymbols>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Desktop.Analyzers" Version="1.2.0-beta2">
<PrivateAssets>All</PrivateAssets>
Expand Down Expand Up @@ -70,16 +71,16 @@
<PackageReference Include="System.Threading.Tasks.Analyzers" Version="1.2.0-beta2">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.5.0-beta1" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.5.0-beta1" />
<PackageReference Include="Microsoft.ApplicationInsights.PerfCounterCollector" Version="2.5.0-beta1" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.5.0-beta1" />
<PackageReference Include="Microsoft.ApplicationInsights" Version="2.5.0-beta2" />
<PackageReference Include="Microsoft.ApplicationInsights.DependencyCollector" Version="2.5.0-beta2" />
<PackageReference Include="Microsoft.ApplicationInsights.PerfCounterCollector" Version="2.5.0-beta2" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.5.0-beta2" />
</ItemGroup>

<ItemGroup Condition=" '$(TargetFramework)' == 'net451' OR '$(TargetFramework)' == 'net46' ">
<PackageReference Include="System.Net.Http" Version="4.3.1" />
<PackageReference Include="Microsoft.ApplicationInsights.PerfCounterCollector" Version="2.5.0-beta1" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.5.0-beta1" />
<PackageReference Include="Microsoft.ApplicationInsights.PerfCounterCollector" Version="2.5.0-beta2" />
<PackageReference Include="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" Version="2.5.0-beta2" />
<Reference Include="System" />
<Reference Include="Microsoft.CSharp" />
</ItemGroup>
Expand Down
5 changes: 3 additions & 2 deletions test/ApplicationInsightsTypes/ApplicationInsightsTypes.csproj
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,17 @@

<PropertyGroup>
<VersionPrefix>1.0.2</VersionPrefix>
<TargetFrameworks>net461;netstandard2.0</TargetFrameworks>
<TargetFrameworks>net461;netstandard1.6</TargetFrameworks>
<DelaySign>true</DelaySign>
<PreserveCompilationContext>true</PreserveCompilationContext>
<AssemblyName>ApplicationInsightsTypes</AssemblyName>
<AssemblyOriginatorKeyFile>../../keys/35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
<SignAssembly>true</SignAssembly>
<PublicSign Condition=" '$(OS)' != 'Windows_NT' ">true</PublicSign>
<PackageId>ApplicationInsightsTypes</PackageId>
<NetStandardImplicitPackageVersion>2.0.0</NetStandardImplicitPackageVersion>
<NetStandardImplicitPackageVersion>1.6.1</NetStandardImplicitPackageVersion>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\test\$(MSBuildProjectName)</OutputPath>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)'=='' ">..\..\artifacts\obj\test\$(MSBuildProjectName)</IntermediateOutputPath>
</PropertyGroup>

<ItemGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
<GenerateRuntimeConfigurationFiles>true</GenerateRuntimeConfigurationFiles>
<RuntimeFrameworkVersion Condition=" '$(TargetFramework)' == 'netcoreapp1.0' ">1.1.1</RuntimeFrameworkVersion>
<OutputPath Condition="'$(OutputPath)'=='' ">..\..\artifacts\test\$(MSBuildProjectName)</OutputPath>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)'=='' ">..\..\artifacts\obj\test\$(MSBuildProjectName)</IntermediateOutputPath>
<DebugType>pdbonly</DebugType>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
Expand Down
Loading

0 comments on commit bde2dca

Please sign in to comment.