Microsoft Application Insights for .NET Web Applications
Switch branches/tags
Clone or download
MS-TimothyMothra Merge pull request #1051 from Microsoft/tilee/normalize_projects
normalize projects and (almost) fix signing
Latest commit d16b81d Oct 22, 2018
Permalink
Failed to load latest commit information.
.github Contributing.md updated with feedback from various sources. Feb 2, 2018
Keys Committing source code Jan 19, 2016
SDL sdl script revision (#789) Jan 12, 2018
Schema Remove references to FW 4.0 (#693) Sep 25, 2017
Src fxcop fix Oct 19, 2018
Test bump version 2.8.1 in DEVELOP Oct 19, 2018
.gitattributes Committing source code Jan 19, 2016
.gitignore Populate DependencyTelemetry with Operation Data for Initializers (#897) Jun 5, 2018
AddXmlLanguage.targets convert HostingStartup to PackageReference (#1007) Sep 25, 2018
ApplicationInsightsSDKRules.ruleset fix fxcop warnings (#999) Sep 13, 2018
CHANGELOG.md Add WEBSITE_RESOURCE_GROUP to hearbeat properties (#1047) Oct 16, 2018
CONTRIBUTING.md Minor adjustments to contributing Feb 14, 2018
CodeCov.ps1 Removed netcore completely from code coverage Jun 14, 2017
Common.props move build logs to Product.props Oct 18, 2018
Common.targets Added common.targets to all projects and added injection of language … Sep 7, 2016
DevDivRuleSet.ruleset Sergkanz/to2017 (#410) Apr 6, 2017
Directory.Build.props project cleanup (#1035) Oct 8, 2018
DownloadSM.ps1 Changed sm script to take param Jun 22, 2016
EnlistmentRoot.marker Committing source code Jan 19, 2016
GenerateReleaseMetadata.ps1 release metadata (#884) Apr 11, 2018
GlobalStaticVersion.props bump version 2.8.1 in DEVELOP Oct 19, 2018
LICENSE Sergkanz/to2017 (#410) Apr 6, 2017
LibraryInstrumentationGuidance.md Library instrumentation guidance (#768) Apr 18, 2018
Microsoft-Security-Recommended.ruleset Sergkanz/to2017 (#410) Apr 6, 2017
NetCore.props bump version 2.7.1 (#963) Aug 1, 2018
NuGet.config Handle 0-length content responses with HTTP desktop hook (#770) Dec 28, 2017
NuGet.exe add script to audit nupkg during build (#1034) Oct 9, 2018
NuGet.targets Sergkanz/to2017 (#410) Apr 6, 2017
NugetAudit.ps1 add script to audit nupkg during build (#1034) Oct 9, 2018
Nupkg.props upgrade to 2.8.0 Oct 11, 2018
Policheck_Template.xml Changes necessary to fix signed builds Jan 25, 2016
README.md Minor fix on #49 Jun 3, 2018
Signing.props bump version 2.7.1 (#963) Aug 1, 2018
Test.props bump version 2.7.1 (#963) Aug 1, 2018
ThirdPartyNotices.txt Removing windows azure thir party notices Sep 9, 2016
VSOPushNugetPackages.cmd Removed symbol publishing from nuget script Jan 27, 2016
buildDebug.cmd Minor changes. Jan 12, 2018
buildDebugFull.cmd Minor changes. Jan 12, 2018
buildRelease.cmd Minor changes. Jan 12, 2018
buildReleaseFull.cmd Minor changes. Jan 12, 2018
clean.cmd Add .NETStandard DependencyCollector implementation (#366) Apr 8, 2017
clearNugetCache.cmd Add .NETStandard DependencyCollector implementation (#366) Apr 8, 2017
dirs.proj ammend dirs.proj Oct 18, 2018
disablestrongnamevalidation.ps1 Comment added about why both are run. Jun 23, 2017
dockercleanup.ps1 Minor May 16, 2018
enablestrongnamevalidation.ps1 Comment added about why both are run. Jun 23, 2017
findMsBuild.cmd Sergkanz/to2017 (#410) Apr 6, 2017
killiisexpress.ps1 Cleanup script to stop iisexpresstray.exe as well as it was found to … Mar 2, 2018
restorePath.cmd Add .NETStandard DependencyCollector implementation (#366) Apr 8, 2017
runAllFunctionalTests.cmd Report intermediate requests for lost and restored Activity (#898) May 3, 2018
runFunctionalTestsDependencyCollector.cmd Report intermediate requests for lost and restored Activity (#898) May 3, 2018
runFunctionalTestsPerfCollectorAndQuickPulse.cmd Enabled PerfCounterModule for NetCore apps. The perf counter will onl… Apr 23, 2018
runFunctionalTestsWeb.cmd Added Info message when netstandard app use perf counter in non azure… Apr 23, 2018
runUnitTests.cmd Populate DependencyTelemetry with Operation Data for Initializers (#897) Jun 5, 2018
savePath.cmd Add .NETStandard DependencyCollector implementation (#366) Apr 8, 2017
upgradeVersion.ps1 bump version 2.8.1 in DEVELOP Oct 19, 2018

README.md

Build Status codecov.io

NuGet packages

Visual Studio Application Insights SDK for .NET Web Applications

The code in this repository is the .NET web application SDK for Application Insights. Application Insights is a service that lets you monitor your live application's performance and usage. This SDK sends telemetry to the service. It collects data such as web request timings and success rates, dependency calls, exceptions, and server performance counters. You can also use the SDK to send your own telemetry and add modules to collect logs. You can use this SDK in any .NET web application, hosted either on your own servers or on Microsoft Azure.

Get the SDK

The SDK is installed on each project by the Application Insights tools in Visual Studio (2013 and later).

To add Application Insights to your project in Visual Studio:

  • If you're creating a new project, check Add Application Insights in the New Project dialog.
  • If it's an existing project, right-click your project in Solution Explorer and select Add Application Insights or Update Application Insights.
  • If these options aren't available for your project type, use Extension Manager in Visual Studio to install or update the NuGet package. Create a new Application Insights resource in the Azure portal, obtain its instrumentation key, and insert that in ApplicationInsights.config.

Run your project, and then open your Application Insights resource in the Azure Preview Portal and look for events.

To upgrade to the latest SDK

  • After you upgrade, you'll need to merge back any customizations you made to ApplicationInsights.config. If you're unsure whether you customized it, create a new project, add Application Insights to it, and compare your .config file with the one in the new project. Make a note of any differences.
  • In Solution Explorer, right-click your project and choose Manage NuGet packages.
  • Set the filter to show Updates.
  • Select Microsoft.ApplicationInsights.Web and choose Update. (This will also upgrade all the dependent packages.)
  • Compare ApplicationInsights.config with the old copy. Most of the changes you'll see are because we removed some modules and made others parameterizable. Reinstate any customizations you made to the old file.
  • Rebuild your solution.

To build

Follow contributor's guide

Branches

  • master contains the latest published release located on NuGet.
  • develop contains the code for the next release.

Shared Projects

Our projects target multiple frameworks (ex: Net45 & NetCore). We have framework specific projects and a shared project for common files between them. (ex: Perf.Net45, Perf.NetCore, Perf.Shared). If a file is used by both frameworks, we prefer to store that file in a Shared project and use preprocessor directives to separate framework specific code (ex: #if NETCORE, #if !NETCORE). We also use a conditional ItemGroup to assign files to a framework (ex: ItemGroup Condition=" '$(TargetFramework)' != 'netcoreapp1.0' ").

We've found that this makes our projects easier to maintain because it keeps Framework assignments in a single project. As an added bonus our Framework specific projects can include a single Shared project instead of individual files, which keeps our project files neat and clean.

Contributing

We strongly welcome and encourage contributions to this project. Please read the contributor's guide. If making a large change we request that you open an issue first. If we agree that an issue is a bug, we'll add the "bug" label, and issues that we plan to fix are labeled with an iteration number. We follow the Git Flow approach to branching.

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.