Committing source code
This commit is contained in:
Родитель
132e713072
Коммит
e3d164d1c5
|
@ -0,0 +1,63 @@
|
|||
###############################################################################
|
||||
# Set default behavior to automatically normalize line endings.
|
||||
###############################################################################
|
||||
* text=auto
|
||||
|
||||
###############################################################################
|
||||
# Set default behavior for command prompt diff.
|
||||
#
|
||||
# This is need for earlier builds of msysgit that does not have it on by
|
||||
# default for csharp files.
|
||||
# Note: This is only used by command line
|
||||
###############################################################################
|
||||
#*.cs diff=csharp
|
||||
|
||||
###############################################################################
|
||||
# Set the merge driver for project and solution files
|
||||
#
|
||||
# Merging from the command prompt will add diff markers to the files if there
|
||||
# are conflicts (Merging from VS is not affected by the settings below, in VS
|
||||
# the diff markers are never inserted). Diff markers may cause the following
|
||||
# file extensions to fail to load in VS. An alternative would be to treat
|
||||
# these files as binary and thus will always conflict and require user
|
||||
# intervention with every merge. To do so, just uncomment the entries below
|
||||
###############################################################################
|
||||
#*.sln merge=binary
|
||||
#*.csproj merge=binary
|
||||
#*.vbproj merge=binary
|
||||
#*.vcxproj merge=binary
|
||||
#*.vcproj merge=binary
|
||||
#*.dbproj merge=binary
|
||||
#*.fsproj merge=binary
|
||||
#*.lsproj merge=binary
|
||||
#*.wixproj merge=binary
|
||||
#*.modelproj merge=binary
|
||||
#*.sqlproj merge=binary
|
||||
#*.wwaproj merge=binary
|
||||
|
||||
###############################################################################
|
||||
# behavior for image files
|
||||
#
|
||||
# image files are treated as binary by default.
|
||||
###############################################################################
|
||||
#*.jpg binary
|
||||
#*.png binary
|
||||
#*.gif binary
|
||||
|
||||
###############################################################################
|
||||
# diff behavior for common document formats
|
||||
#
|
||||
# Convert binary document formats to text before diffing them. This feature
|
||||
# is only available from the command line. Turn it on by uncommenting the
|
||||
# entries below.
|
||||
###############################################################################
|
||||
#*.doc diff=astextplain
|
||||
#*.DOC diff=astextplain
|
||||
#*.docx diff=astextplain
|
||||
#*.DOCX diff=astextplain
|
||||
#*.dot diff=astextplain
|
||||
#*.DOT diff=astextplain
|
||||
#*.pdf diff=astextplain
|
||||
#*.PDF diff=astextplain
|
||||
#*.rtf diff=astextplain
|
||||
#*.RTF diff=astextplain
|
|
@ -0,0 +1,164 @@
|
|||
## Ignore Visual Studio temporary files, build results, and
|
||||
## files generated by popular Visual Studio add-ons.
|
||||
|
||||
# User-specific files
|
||||
*.suo
|
||||
*.user
|
||||
*.sln.docstates
|
||||
.vs
|
||||
|
||||
# Build results
|
||||
[Dd]ebug/
|
||||
[Rr]elease/
|
||||
[Bb]in/
|
||||
[Oo]bj/
|
||||
[Oo]bj//Core/Javascript/ai*.[tj]s*
|
||||
|
||||
# Telemetry output
|
||||
*.onesipkg
|
||||
|
||||
# Enable "build/" folder in the NuGet Packages folder since NuGet packages use it for MSBuild targets
|
||||
!packages/*/build/
|
||||
|
||||
# MSTest test Results
|
||||
[Tt]est[Rr]esult*/
|
||||
[Bb]uild[Ll]og.*
|
||||
|
||||
*_i.c
|
||||
*_p.c
|
||||
*.ilk
|
||||
*.meta
|
||||
*.obj
|
||||
*.pch
|
||||
*.pdb
|
||||
*.pgc
|
||||
*.pgd
|
||||
*.rsp
|
||||
*.sbr
|
||||
*.tlb
|
||||
*.tli
|
||||
*.tlh
|
||||
*.tmp
|
||||
*.tmp_proj
|
||||
*.log
|
||||
*.vspscc
|
||||
*.vssscc
|
||||
.builds
|
||||
*.pidb
|
||||
*.log
|
||||
*.scc
|
||||
|
||||
# Visual C++ cache files
|
||||
ipch/
|
||||
*.aps
|
||||
*.ncb
|
||||
*.opensdf
|
||||
*.sdf
|
||||
*.cachefile
|
||||
|
||||
# Visual Studio profiler
|
||||
*.psess
|
||||
*.vsp
|
||||
*.vspx
|
||||
|
||||
# Guidance Automation Toolkit
|
||||
*.gpState
|
||||
|
||||
# ReSharper is a .NET coding add-in
|
||||
_ReSharper*/
|
||||
*.[Rr]e[Ss]harper
|
||||
|
||||
# TeamCity is a build add-in
|
||||
_TeamCity*
|
||||
|
||||
# DotCover is a Code Coverage Tool
|
||||
*.dotCover
|
||||
|
||||
# NCrunch
|
||||
*.ncrunch*
|
||||
.*crunch*.local.xml
|
||||
|
||||
# Installshield output folder
|
||||
[Ee]xpress/
|
||||
|
||||
# DocProject is a documentation generator add-in
|
||||
DocProject/buildhelp/
|
||||
DocProject/Help/*.HxT
|
||||
DocProject/Help/*.HxC
|
||||
DocProject/Help/*.hhc
|
||||
DocProject/Help/*.hhk
|
||||
DocProject/Help/*.hhp
|
||||
DocProject/Help/Html2
|
||||
DocProject/Help/html
|
||||
|
||||
# Click-Once directory
|
||||
publish/
|
||||
|
||||
# Publish Web Output
|
||||
*.Publish.xml
|
||||
|
||||
# NuGet binaries downloaded automatically
|
||||
packages/
|
||||
|
||||
# Windows Azure Build Output
|
||||
csx
|
||||
*.build.csdef
|
||||
|
||||
# Windows Store app package directory
|
||||
AppPackages/
|
||||
|
||||
# Others
|
||||
sql/
|
||||
*.Cache
|
||||
ClientBin/
|
||||
[Ss]tyle[Cc]op.*
|
||||
~$*
|
||||
*~
|
||||
*.dbmdl
|
||||
*.[Pp]ublish.xml
|
||||
*.publishsettings
|
||||
|
||||
# RIA/Silverlight projects
|
||||
Generated_Code/
|
||||
|
||||
# Backup & report files from converting an old project file to a newer
|
||||
# Visual Studio version. Backup files are not needed, because we have git ;-)
|
||||
_UpgradeReport_Files/
|
||||
Backup*/
|
||||
UpgradeLog*.XML
|
||||
UpgradeLog*.htm
|
||||
|
||||
# SQL Server files
|
||||
App_Data/*.mdf
|
||||
App_Data/*.ldf
|
||||
|
||||
|
||||
#LightSwitch generated files
|
||||
GeneratedArtifacts/
|
||||
_Pvt_Extensions/
|
||||
ModelManifest.xml
|
||||
|
||||
# =========================
|
||||
# Windows detritus
|
||||
# =========================
|
||||
|
||||
# Windows image file caches
|
||||
Thumbs.db
|
||||
ehthumbs.db
|
||||
|
||||
# Folder config file
|
||||
Desktop.ini
|
||||
|
||||
# Recycle Bin used on file shares
|
||||
$RECYCLE.BIN/
|
||||
|
||||
# Mac desktop service store files
|
||||
.DS_Store
|
||||
|
||||
# Build log files
|
||||
*.err
|
||||
*.prf
|
||||
*.wrn
|
||||
*.vsix
|
||||
.PreReleaseVersion
|
||||
.nugetVersion
|
|
@ -0,0 +1,95 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RuleSet Name="ApplicationInsights SDK Rules" Description="These rules focus on the most critical problems in your code, including potential security holes, application crashes, and other important logic and design errors. It is recommended to include this rule set in any custom rule set you create for your projects. These include a combination of Microsoft Managed Recommended Rules and DevDivRuleSet for Microbuild." ToolsVersion="12.0">
|
||||
<Localization ResourceAssembly="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.dll" ResourceBaseName="Microsoft.VisualStudio.CodeAnalysis.RuleSets.Strings.Localized">
|
||||
<Name Resource="ApplicationInsightsSDKRules_Name" />
|
||||
<Description Resource="ApplicationInsightsSDKRules_Description" />
|
||||
</Localization>
|
||||
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
|
||||
<Rule Id="CA1001" Action="Warning" />
|
||||
<Rule Id="CA1009" Action="Warning" />
|
||||
<Rule Id="CA1016" Action="Warning" />
|
||||
<Rule Id="CA1033" Action="Warning" />
|
||||
<Rule Id="CA1049" Action="Warning" />
|
||||
<Rule Id="CA1060" Action="Warning" />
|
||||
<Rule Id="CA1061" Action="Warning" />
|
||||
<Rule Id="CA1063" Action="Warning" />
|
||||
<Rule Id="CA1065" Action="Warning" />
|
||||
<Rule Id="CA1304" Action="Warning" />
|
||||
<Rule Id="CA1305" Action="Warning" />
|
||||
<Rule Id="CA1307" Action="Warning" />
|
||||
<Rule Id="CA1309" Action="Warning" />
|
||||
<Rule Id="CA1401" Action="Warning" />
|
||||
<Rule Id="CA1403" Action="Warning" />
|
||||
<Rule Id="CA1405" Action="Warning" />
|
||||
<Rule Id="CA1410" Action="Warning" />
|
||||
<Rule Id="CA1821" Action="Warning" />
|
||||
<Rule Id="CA1900" Action="Warning" />
|
||||
<Rule Id="CA2001" Action="Warning" />
|
||||
<Rule Id="CA2002" Action="Warning" />
|
||||
<Rule Id="CA2100" Action="Warning" />
|
||||
<Rule Id="CA2102" Action="Warning" />
|
||||
<Rule Id="CA2103" Action="Warning" />
|
||||
<Rule Id="CA2104" Action="Warning" />
|
||||
<Rule Id="CA2105" Action="Warning" />
|
||||
<Rule Id="CA2106" Action="Warning" />
|
||||
<Rule Id="CA2107" Action="Warning" />
|
||||
<Rule Id="CA2108" Action="Warning" />
|
||||
<Rule Id="CA2109" Action="Warning" />
|
||||
<Rule Id="CA2111" Action="Warning" />
|
||||
<Rule Id="CA2112" Action="Warning" />
|
||||
<Rule Id="CA2114" Action="Warning" />
|
||||
<Rule Id="CA2115" Action="Warning" />
|
||||
<Rule Id="CA2116" Action="Warning" />
|
||||
<Rule Id="CA2117" Action="Warning" />
|
||||
<Rule Id="CA2118" Action="Warning" />
|
||||
<Rule Id="CA2119" Action="Warning" />
|
||||
<Rule Id="CA2120" Action="Warning" />
|
||||
<Rule Id="CA2121" Action="Warning" />
|
||||
<Rule Id="CA2122" Action="Warning" />
|
||||
<Rule Id="CA2123" Action="Warning" />
|
||||
<Rule Id="CA2124" Action="Warning" />
|
||||
<Rule Id="CA2126" Action="Warning" />
|
||||
<Rule Id="CA2130" Action="Warning" />
|
||||
<Rule Id="CA2131" Action="Warning" />
|
||||
<Rule Id="CA2132" Action="Warning" />
|
||||
<Rule Id="CA2133" Action="Warning" />
|
||||
<Rule Id="CA2134" Action="Warning" />
|
||||
<Rule Id="CA2135" Action="Warning" />
|
||||
<Rule Id="CA2136" Action="Warning" />
|
||||
<Rule Id="CA2137" Action="Warning" />
|
||||
<Rule Id="CA2138" Action="Warning" />
|
||||
<Rule Id="CA2139" Action="Warning" />
|
||||
<Rule Id="CA2140" Action="Warning" />
|
||||
<Rule Id="CA2141" Action="Warning" />
|
||||
<Rule Id="CA2142" Action="Warning" />
|
||||
<Rule Id="CA2143" Action="Warning" />
|
||||
<Rule Id="CA2144" Action="Warning" />
|
||||
<Rule Id="CA2145" Action="Warning" />
|
||||
<Rule Id="CA2146" Action="Warning" />
|
||||
<Rule Id="CA2147" Action="Warning" />
|
||||
<Rule Id="CA2149" Action="Warning" />
|
||||
<Rule Id="CA2151" Action="Warning" />
|
||||
<Rule Id="CA2200" Action="Warning" />
|
||||
<Rule Id="CA2202" Action="Warning" />
|
||||
<Rule Id="CA2207" Action="Warning" />
|
||||
<Rule Id="CA2212" Action="Warning" />
|
||||
<Rule Id="CA2213" Action="Warning" />
|
||||
<Rule Id="CA2214" Action="Warning" />
|
||||
<Rule Id="CA2216" Action="Warning" />
|
||||
<Rule Id="CA2219" Action="Warning" />
|
||||
<Rule Id="CA2220" Action="Warning" />
|
||||
<Rule Id="CA2229" Action="Warning" />
|
||||
<Rule Id="CA2231" Action="Warning" />
|
||||
<Rule Id="CA2232" Action="Warning" />
|
||||
<Rule Id="CA2233" Action="Warning" />
|
||||
<Rule Id="CA2234" Action="Warning" />
|
||||
<Rule Id="CA2235" Action="Warning" />
|
||||
<Rule Id="CA2236" Action="Warning" />
|
||||
<Rule Id="CA2237" Action="Warning" />
|
||||
<Rule Id="CA2238" Action="Warning" />
|
||||
<Rule Id="CA2240" Action="Warning" />
|
||||
<Rule Id="CA2241" Action="Warning" />
|
||||
<Rule Id="CA2242" Action="Warning" />
|
||||
<Rule Id="CA5122" Action="Warning" />
|
||||
</Rules>
|
||||
</RuleSet>
|
|
@ -0,0 +1,34 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Global.props'))\Global.props" />
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Signing.props'))\Signing.props" />
|
||||
|
||||
<PropertyGroup>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Debug'">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(Configuration)' == 'Release'">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<CodeAnalysisRuleSet>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'ApplicationInsightsSDKRules.ruleset'))\ApplicationInsightsSDKRules.ruleset</CodeAnalysisRuleSet>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
<CodeAnalysisTreatWarningsAsErrors>true</CodeAnalysisTreatWarningsAsErrors>
|
||||
<StyleCopEnabled>True</StyleCopEnabled>
|
||||
<StyleCopTreatErrorsAsWarnings>False</StyleCopTreatErrorsAsWarnings>
|
||||
<TreatWarningsAsErrors>true</TreatWarningsAsErrors>
|
||||
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<PartitionPropertiesFile>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'Partition.props'))\Partition.props</PartitionPropertiesFile>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(PartitionPropertiesFile)" Condition="Exists($(PartitionPropertiesFile))" />
|
||||
</Project>
|
|
@ -0,0 +1,146 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<RuleSet Name="Copy of DevDivRuleSet" Description="DevDiv required checks." ToolsVersion="12.0">
|
||||
<Rules AnalyzerId="Microsoft.Analyzers.ManagedCodeAnalysis" RuleNamespace="Microsoft.Rules.Managed">
|
||||
<Rule Id="CA1304" Action="Error" />
|
||||
<Rule Id="CA1305" Action="Error" />
|
||||
<Rule Id="CA1307" Action="Error" />
|
||||
<Rule Id="CA1309" Action="Error" />
|
||||
<Rule Id="CA1401" Action="Error" />
|
||||
<Rule Id="CA2001" Action="Error" />
|
||||
<Rule Id="CA2100" Action="Error" />
|
||||
<Rule Id="CA2102" Action="Error" />
|
||||
<Rule Id="CA2103" Action="Error" />
|
||||
<Rule Id="CA2104" Action="Error" />
|
||||
<Rule Id="CA2105" Action="Error" />
|
||||
<Rule Id="CA2106" Action="Error" />
|
||||
<Rule Id="CA2107" Action="Error" />
|
||||
<Rule Id="CA2108" Action="Error" />
|
||||
<Rule Id="CA2109" Action="Error" />
|
||||
<Rule Id="CA2111" Action="Error" />
|
||||
<Rule Id="CA2112" Action="Error" />
|
||||
<Rule Id="CA2114" Action="Error" />
|
||||
<Rule Id="CA2115" Action="Error" />
|
||||
<Rule Id="CA2116" Action="Error" />
|
||||
<Rule Id="CA2117" Action="Error" />
|
||||
<Rule Id="CA2118" Action="Error" />
|
||||
<Rule Id="CA2119" Action="Error" />
|
||||
<Rule Id="CA2120" Action="Error" />
|
||||
<Rule Id="CA2121" Action="Error" />
|
||||
<Rule Id="CA2122" Action="Error" />
|
||||
<Rule Id="CA2123" Action="Error" />
|
||||
<Rule Id="CA2124" Action="Error" />
|
||||
<Rule Id="CA2126" Action="Error" />
|
||||
<Rule Id="CA2130" Action="Error" />
|
||||
<Rule Id="CA2131" Action="Error" />
|
||||
<Rule Id="CA2132" Action="Error" />
|
||||
<Rule Id="CA2133" Action="Error" />
|
||||
<Rule Id="CA2134" Action="Error" />
|
||||
<Rule Id="CA2135" Action="Error" />
|
||||
<Rule Id="CA2136" Action="Error" />
|
||||
<Rule Id="CA2137" Action="Error" />
|
||||
<Rule Id="CA2138" Action="Error" />
|
||||
<Rule Id="CA2139" Action="Error" />
|
||||
<Rule Id="CA2140" Action="Error" />
|
||||
<Rule Id="CA2141" Action="Error" />
|
||||
<Rule Id="CA2142" Action="Error" />
|
||||
<Rule Id="CA2143" Action="Error" />
|
||||
<Rule Id="CA2144" Action="Error" />
|
||||
<Rule Id="CA2145" Action="Error" />
|
||||
<Rule Id="CA2146" Action="Error" />
|
||||
<Rule Id="CA2147" Action="Error" />
|
||||
<Rule Id="CA2149" Action="Error" />
|
||||
<Rule Id="CA2151" Action="Error" />
|
||||
<Rule Id="CA2153" Action="Error" />
|
||||
<Rule Id="CA2219" Action="Error" />
|
||||
<Rule Id="CA2233" Action="Error" />
|
||||
<Rule Id="CA2234" Action="Error" />
|
||||
<Rule Id="CA3001" Action="Error" />
|
||||
<Rule Id="CA3002" Action="Error" />
|
||||
<Rule Id="CA3003" Action="Error" />
|
||||
<Rule Id="CA3004" Action="Error" />
|
||||
<Rule Id="CA3005" Action="Error" />
|
||||
<Rule Id="CA3006" Action="Error" />
|
||||
<Rule Id="CA3007" Action="Error" />
|
||||
<Rule Id="CA3008" Action="Error" />
|
||||
<Rule Id="CA3009" Action="Error" />
|
||||
<Rule Id="CA3010" Action="Error" />
|
||||
<Rule Id="CA3011" Action="Error" />
|
||||
<Rule Id="CA3012" Action="Error" />
|
||||
<Rule Id="CA3050" Action="Error" />
|
||||
<Rule Id="CA3051" Action="Error" />
|
||||
<Rule Id="CA3052" Action="Error" />
|
||||
<Rule Id="CA3053" Action="Error" />
|
||||
<Rule Id="CA3054" Action="Error" />
|
||||
<Rule Id="CA3055" Action="Error" />
|
||||
<Rule Id="CA3056" Action="Error" />
|
||||
<Rule Id="CA3057" Action="Error" />
|
||||
<Rule Id="CA3058" Action="Error" />
|
||||
<Rule Id="CA3059" Action="Error" />
|
||||
<Rule Id="CA3060" Action="Error" />
|
||||
<Rule Id="CA3061" Action="Error" />
|
||||
<Rule Id="CA3062" Action="Error" />
|
||||
<Rule Id="CA3063" Action="Error" />
|
||||
<Rule Id="CA3064" Action="Error" />
|
||||
<Rule Id="CA3065" Action="Error" />
|
||||
<Rule Id="CA3066" Action="Error" />
|
||||
<Rule Id="CA3067" Action="Error" />
|
||||
<Rule Id="CA3068" Action="Error" />
|
||||
<Rule Id="CA3069" Action="Error" />
|
||||
<Rule Id="CA3070" Action="Error" />
|
||||
<Rule Id="CA3071" Action="Error" />
|
||||
<Rule Id="CA3072" Action="Error" />
|
||||
<Rule Id="CA3073" Action="Error" />
|
||||
<Rule Id="CA3074" Action="Error" />
|
||||
<Rule Id="CA3101" Action="Error" />
|
||||
<Rule Id="CA3102" Action="Error" />
|
||||
<Rule Id="CA3103" Action="Error" />
|
||||
<Rule Id="CA3104" Action="Error" />
|
||||
<Rule Id="CA3105" Action="Error" />
|
||||
<Rule Id="CA3106" Action="Error" />
|
||||
<Rule Id="CA3107" Action="Error" />
|
||||
<Rule Id="CA3108" Action="Error" />
|
||||
<Rule Id="CA3109" Action="Error" />
|
||||
<Rule Id="CA3110" Action="Error" />
|
||||
<Rule Id="CA3111" Action="Error" />
|
||||
<Rule Id="CA3112" Action="Error" />
|
||||
<Rule Id="CA3113" Action="Error" />
|
||||
<Rule Id="CA3114" Action="Error" />
|
||||
<Rule Id="CA3115" Action="Error" />
|
||||
<Rule Id="CA3116" Action="Error" />
|
||||
<Rule Id="CA3117" Action="Error" />
|
||||
<Rule Id="CA3118" Action="Error" />
|
||||
<Rule Id="CA3119" Action="Error" />
|
||||
<Rule Id="CA3120" Action="Error" />
|
||||
<Rule Id="CA3121" Action="Error" />
|
||||
<Rule Id="CA3122" Action="Error" />
|
||||
<Rule Id="CA3123" Action="Error" />
|
||||
<Rule Id="CA3124" Action="Error" />
|
||||
<Rule Id="CA3125" Action="Error" />
|
||||
<Rule Id="CA3127" Action="Error" />
|
||||
<Rule Id="CA3129" Action="Error" />
|
||||
<Rule Id="CA3130" Action="Error" />
|
||||
<Rule Id="CA3131" Action="Error" />
|
||||
<Rule Id="CA3132" Action="Error" />
|
||||
<Rule Id="CA3133" Action="Error" />
|
||||
<Rule Id="CA3134" Action="Error" />
|
||||
<Rule Id="CA3135" Action="Error" />
|
||||
<Rule Id="CA3137" Action="Error" />
|
||||
<Rule Id="CA3138" Action="Error" />
|
||||
<Rule Id="CA3139" Action="Error" />
|
||||
<Rule Id="CA3140" Action="Error" />
|
||||
<Rule Id="CA3141" Action="Error" />
|
||||
<Rule Id="CA3142" Action="Error" />
|
||||
<Rule Id="CA3143" Action="Error" />
|
||||
<Rule Id="CA3145" Action="Error" />
|
||||
<Rule Id="CA3146" Action="Error" />
|
||||
<Rule Id="CA5122" Action="Error" />
|
||||
<Rule Id="CA5350" Action="Error" />
|
||||
<Rule Id="CA5351" Action="Error" />
|
||||
<Rule Id="CA5352" Action="Error" />
|
||||
<Rule Id="CA5353" Action="Error" />
|
||||
<Rule Id="CA5354" Action="Error" />
|
||||
<Rule Id="CA5355" Action="Error" />
|
||||
<Rule Id="CA5356" Action="Error" />
|
||||
<Rule Id="CA5357" Action="Error" />
|
||||
</Rules>
|
||||
</RuleSet>
|
|
@ -0,0 +1,142 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project=".\GlobalStaticVersion.props" />
|
||||
|
||||
<!-- This file (Global.props) must be included into all projects in all solutions of this product. -->
|
||||
<!-- It defines common build paths and infrastructure. -->
|
||||
<!-- Other products / repositories using the same build pattern will have an own copy of copy this file -->
|
||||
|
||||
<!-- Project file location for the Import statement: -->
|
||||
<!-- * You MUST include this file towards the bottom of each respective project file, * -->
|
||||
<!-- * BELOW all local definitions, RIGHT ABOVE the targets import. * -->
|
||||
<!-- * For example, right above this line: * -->
|
||||
<!-- * <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> * -->
|
||||
|
||||
<!-- There are two easy ways to import this file. The shortest way is to write something like: -->
|
||||
<!-- <Import Project="..\..\Global.props" /> -->
|
||||
<!-- However, you will need to match the number of "..\" segments to the respective location of each project file in -->
|
||||
<!-- your sourcce tree. A more robust approach is to include the following code. It can stay the same regardless of -->
|
||||
<!-- your project file location: -->
|
||||
<!--
|
||||
<PropertyGroup Label="Include_Common_Build_Properties">
|
||||
<CommonBuildPropsLocation>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'EnlistmentRoot.marker'))</CommonBuildPropsLocation>
|
||||
</PropertyGroup>
|
||||
<ImportGroup Label="Include_Common_Build_Properties">
|
||||
<Import Project="$(CommonBuildPropsLocation)\Global.props" />
|
||||
</ImportGroup>
|
||||
-->
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- The common project structure looks like this: -->
|
||||
<!-- d:\DDGit\ -->
|
||||
<!-- ServiceFoo\ -->
|
||||
<!-- Bin\ -->
|
||||
<!-- Obj\ -->
|
||||
<!-- Packages\ -->
|
||||
<!-- Src\ -->
|
||||
<!-- .git\ -->
|
||||
<!-- .nuget\ -->
|
||||
<!-- Global.props -->
|
||||
<!-- SomeProjectFolderA\ -->
|
||||
<!-- NuGet.config -->
|
||||
<!-- SomeProjectA.sln -->
|
||||
<!-- ... -->
|
||||
<!-- SomeProjectFolderB\ -->
|
||||
<!-- ... -->
|
||||
<!-- EnlistmentRoot.marker -->
|
||||
<!-- ServiceBar\ -->
|
||||
<!-- Bin\ -->
|
||||
<!-- Obj\ -->
|
||||
<!-- Packages\ -->
|
||||
<!-- Src\ -->
|
||||
<!-- ... -->
|
||||
<!-- -->
|
||||
<!-- The Bin folder contains ALL build output. -->
|
||||
<!-- The Obj folder contains all intermediate build files (like the obj folder). -->
|
||||
<!-- The Packages folder contains ALL packages downloaded by NuGet. -->
|
||||
<!-- The above folders contain NOTHING that is checked in (they are not checked in themselves). -->
|
||||
<!-- The Src folder contains EVERHYTHNG that is checked in and ALL that is checked in. -->
|
||||
<!-- No build output or temp files should end up in the Src folder! (barring a few *small* VS temporaries) -->
|
||||
<!-- -->
|
||||
<!-- Src MUST contain the EnlistmentRoot.marker file which marks the EnlistmentRoot. -->
|
||||
<!-- Src also contains the NuGet.config file which ensures that NuGet uses the NuGet.Packages folder. -->
|
||||
|
||||
<EnlistmentRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'EnlistmentRoot.marker'))</EnlistmentRoot>
|
||||
|
||||
<BinRoot>$(EnlistmentRoot)\..\bin</BinRoot>
|
||||
<BinRoot>$([System.IO.Path]::GetFullPath( $(BinRoot) ))</BinRoot>
|
||||
|
||||
<RelativeOutputPathBase>$(MSBuildProjectDirectory.Substring($(EnlistmentRoot.Length)))</RelativeOutputPathBase>
|
||||
|
||||
<BaseIntermediateOutputPath>$(EnlistmentRoot)\..\obj</BaseIntermediateOutputPath>
|
||||
<BaseIntermediateOutputPath>$([System.IO.Path]::GetFullPath( $(BaseIntermediateOutputPath) ))</BaseIntermediateOutputPath>
|
||||
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
|
||||
<OutputPath>$(BinRoot)\$(Configuration)\$(RelativeOutputPathBase)</OutputPath>
|
||||
<OutputPath>$([System.IO.Path]::GetFullPath( $(OutputPath) ))\</OutputPath>
|
||||
|
||||
<!-- Collect all NuGet packages in the same folder for convenience during testing -->
|
||||
<PackageOutputDir>$(BinRoot)\$(Configuration)\NuGet</PackageOutputDir>
|
||||
|
||||
<AppxPackageDir>$(OutputPath)</AppxPackageDir>
|
||||
|
||||
<IntermediateOutputPath>$(BaseIntermediateOutputPath)\$(Configuration)\$(RelativeOutputPathBase)</IntermediateOutputPath>
|
||||
<IntermediateOutputPath>$([System.IO.Path]::GetFullPath( $(IntermediateOutputPath) ))\</IntermediateOutputPath>
|
||||
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(EnlistmentRoot)\</SolutionDir>
|
||||
|
||||
<PackagesDir>$(EnlistmentRoot)\..\packages</PackagesDir>
|
||||
<PackagesDir>$([System.IO.Path]::GetFullPath( $(PackagesDir) ))</PackagesDir>
|
||||
|
||||
<MyGetPackageSource>https://www.myget.org/F/applicationinsights/api/v2</MyGetPackageSource>
|
||||
|
||||
<PowerShellExe Condition=" '$(PowerShellExe)'=='' ">%WINDIR%\System32\WindowsPowerShell\v1.0\powershell.exe</PowerShellExe>
|
||||
|
||||
<NugetVersionFilePath>$(MSBuildThisFileDirectory).nugetVersion</NugetVersionFilePath>
|
||||
<BuildNugetVersion Condition="Exists($(NugetVersionFilePath))">$([System.IO.File]::ReadAllText($(NugetVersionFilePath)))</BuildNugetVersion>
|
||||
|
||||
<CoreSdkVersion>2.0.0-beta4</CoreSdkVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- Enable NuGet package restore during build -->
|
||||
<RestorePackages>true</RestorePackages>
|
||||
<RequireRestoreConsent>false</RequireRestoreConsent>
|
||||
|
||||
<!-- Set the root namespace for all assemblies in this project hierarchy -->
|
||||
<RootNamespace>Microsoft.ApplicationInsights</RootNamespace>
|
||||
|
||||
<!-- Disable StyleCop by default to prevent StyleCop.MSBuild package from slowing down the debug build -->
|
||||
<StyleCopEnabled>false</StyleCopEnabled>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Generate AssemblyFileVersion and AssemblyVersion attributes. -->
|
||||
<PropertyGroup>
|
||||
<PreReleaseVersion Condition="Exists($(PreReleaseVersionFilePath))">$([System.IO.File]::ReadAllText($(PreReleaseVersionFilePath)))</PreReleaseVersion>
|
||||
<PreReleaseVersion Condition="!Exists($(PreReleaseVersionFilePath))">0</PreReleaseVersion>
|
||||
<PreReleaseVersion>$(PreReleaseVersion.Replace('%0D', '').Replace('%0A', ''))</PreReleaseVersion>
|
||||
<!-- Turn on dynamic assembly attribute generation -->
|
||||
<AssemblyAttributesPath>$(IntermediateOutputPath)\AssemblyInfo.g.cs</AssemblyAttributesPath>
|
||||
<GenerateAdditionalSources>true</GenerateAdditionalSources>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition="'$(PackageVersion)' == ''">
|
||||
<PackageVersion>$(SemanticVersionMajor).$(SemanticVersionMinor).$(SemanticVersionPatch)</PackageVersion>
|
||||
<PackageVersion Condition="'$(PreReleaseMilestone)' != ''">$(PackageVersion)-$(PreReleaseMilestone)</PackageVersion>
|
||||
<PackageVersion Condition="'$(StableRelease)' != 'True'">$(PackageVersion)-build$(PreReleaseVersion)</PackageVersion>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup>
|
||||
<!--
|
||||
AssemblyVersion and AssemblyFileVersion attributes are generated automatically for every build.
|
||||
NuGet package version is derived from AssemblyFileVersion.
|
||||
-->
|
||||
<AssemblyAttributes Include="AssemblyVersion">
|
||||
<_Parameter1>$(SemanticVersionMajor).$(SemanticVersionMinor).$(SemanticVersionPatch).$(PreReleaseVersion)</_Parameter1>
|
||||
</AssemblyAttributes>
|
||||
<AssemblyAttributes Include="AssemblyFileVersion">
|
||||
<_Parameter1>$(SemanticVersionMajor).$(SemanticVersionMinor).$(SemanticVersionPatch).$(PreReleaseVersion)</_Parameter1>
|
||||
</AssemblyAttributes>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,23 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<!--
|
||||
Semantic Version. See http://semver.org for full details.
|
||||
Update for every public release.
|
||||
-->
|
||||
<SemanticVersionMajor>2</SemanticVersionMajor>
|
||||
<SemanticVersionMinor>0</SemanticVersionMinor>
|
||||
<SemanticVersionPatch>0</SemanticVersionPatch>
|
||||
<PreReleaseMilestone>beta5</PreReleaseMilestone>
|
||||
|
||||
<!--
|
||||
Date when Semantic Version was changed.
|
||||
Update for every public release.
|
||||
This resets file version counter. We will not change it before the stable version
|
||||
-->
|
||||
<SemanticVersionDate>2015-10-22</SemanticVersionDate>
|
||||
|
||||
<PreReleaseVersionFileName>.PreReleaseVersion</PreReleaseVersionFileName>
|
||||
<PreReleaseVersionFilePath>$(MSBuildThisFileDirectory)$(PreReleaseVersionFileName)</PreReleaseVersionFilePath>
|
||||
</PropertyGroup>
|
||||
</Project>
|
Двоичный файл не отображается.
Двоичный файл не отображается.
|
@ -0,0 +1,22 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<!-- This file belongs into the EnlistmentRoot folder next to EnlistmentRoot.marker. -->
|
||||
<!-- See the comments in Global.props for explanations. -->
|
||||
<packageRestore>
|
||||
<add key="enabled" value="True" />
|
||||
<add key="automatic" value="True" />
|
||||
</packageRestore>
|
||||
<solution>
|
||||
<add key="disableSourceControlIntegration" value="true" />
|
||||
</solution>
|
||||
<activePackageSource>
|
||||
<add key="All" value="(Aggregate source)" />
|
||||
</activePackageSource>
|
||||
<config>
|
||||
<add key="repositoryPath" value="..\packages" />
|
||||
</config>
|
||||
<packageSources>
|
||||
<add key="nuget.org" value="https://www.nuget.org/api/v2/" />
|
||||
<add key="MyGetApplicationInsights" value="https://www.myget.org/F/applicationinsights" />
|
||||
</packageSources>
|
||||
</configuration>
|
Двоичный файл не отображается.
|
@ -0,0 +1,136 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<PropertyGroup>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$(MSBuildProjectDirectory)\..\</SolutionDir>
|
||||
|
||||
<!-- Enable the restore command to run before builds -->
|
||||
<RestorePackages Condition=" '$(RestorePackages)' == '' ">false</RestorePackages>
|
||||
|
||||
<!-- Property that enables building a package from a project -->
|
||||
<BuildPackage Condition=" '$(BuildPackage)' == '' ">false</BuildPackage>
|
||||
|
||||
<!-- Determines if package restore consent is required to restore packages -->
|
||||
<RequireRestoreConsent Condition=" '$(RequireRestoreConsent)' != 'false' ">true</RequireRestoreConsent>
|
||||
|
||||
<!-- Download NuGet.exe if it does not already exist -->
|
||||
<DownloadNuGetExe Condition=" '$(DownloadNuGetExe)' == '' ">false</DownloadNuGetExe>
|
||||
</PropertyGroup>
|
||||
|
||||
<ItemGroup Condition=" '$(PackageSources)' == '' ">
|
||||
<!-- Package sources used to restore packages. By default, registered sources under %APPDATA%\NuGet\NuGet.Config will be used -->
|
||||
<!-- The official NuGet package source (https://www.nuget.org/api/v2/) will be excluded if package sources are specified and it does not appear in the list -->
|
||||
<!--
|
||||
<PackageSource Include="https://www.nuget.org/api/v2/" />
|
||||
<PackageSource Include="https://my-nuget-source/nuget/" />
|
||||
-->
|
||||
</ItemGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(OS)' == 'Windows_NT'">
|
||||
<!-- Windows specific commands -->
|
||||
<NuGetToolsPath>$(MSBuildThisFileDirectory)</NuGetToolsPath>
|
||||
<PackagesConfig>$([System.IO.Path]::Combine($(ProjectDir), "packages.config"))</PackagesConfig>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup Condition=" '$(OS)' != 'Windows_NT'">
|
||||
<!-- We need to launch nuget.exe with the mono command if we're not on windows -->
|
||||
<NuGetToolsPath>$(SolutionDir).nuget</NuGetToolsPath>
|
||||
<PackagesConfig>packages.config</PackagesConfig>
|
||||
</PropertyGroup>
|
||||
|
||||
<PropertyGroup>
|
||||
<!-- NuGet command -->
|
||||
<NuGetExePath Condition=" '$(NuGetExePath)' == '' ">$(NuGetToolsPath)\NuGet.exe</NuGetExePath>
|
||||
<PackageSources Condition=" $(PackageSources) == '' ">@(PackageSource)</PackageSources>
|
||||
|
||||
<NuGetCommand Condition=" '$(OS)' == 'Windows_NT'">"$(NuGetExePath)"</NuGetCommand>
|
||||
<NuGetCommand Condition=" '$(OS)' != 'Windows_NT' ">mono --runtime=v4.0.30319 $(NuGetExePath)</NuGetCommand>
|
||||
|
||||
<PackageOutputDir Condition="$(PackageOutputDir) == ''">$(TargetDir.Trim('\\'))</PackageOutputDir>
|
||||
|
||||
<RequireConsentSwitch Condition=" $(RequireRestoreConsent) == 'true' ">-RequireConsent</RequireConsentSwitch>
|
||||
<NonInteractiveSwitch Condition=" '$(VisualStudioVersion)' != '' AND '$(OS)' == 'Windows_NT' ">-NonInteractive</NonInteractiveSwitch>
|
||||
|
||||
<PaddedSolutionDir Condition=" '$(OS)' == 'Windows_NT'">"$(SolutionDir) "</PaddedSolutionDir>
|
||||
<PaddedSolutionDir Condition=" '$(OS)' != 'Windows_NT' ">"$(SolutionDir)"</PaddedSolutionDir>
|
||||
|
||||
<!-- Commands -->
|
||||
<RestoreCommand>$(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir)</RestoreCommand>
|
||||
<BuildCommand>$(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols</BuildCommand>
|
||||
|
||||
<!-- We need to ensure packages are restored prior to assembly resolve -->
|
||||
<BuildDependsOn Condition="$(RestorePackages) == 'true'">
|
||||
RestorePackages;
|
||||
$(BuildDependsOn);
|
||||
</BuildDependsOn>
|
||||
|
||||
<!-- Make the build depend on restore packages -->
|
||||
<BuildDependsOn Condition="$(BuildPackage) == 'true'">
|
||||
$(BuildDependsOn);
|
||||
BuildPackage;
|
||||
</BuildDependsOn>
|
||||
</PropertyGroup>
|
||||
|
||||
<Target Name="CheckPrerequisites">
|
||||
<!-- Raise an error if we're unable to locate nuget.exe -->
|
||||
<Error Condition="'$(DownloadNuGetExe)' != 'true' AND !Exists('$(NuGetExePath)')" Text="Unable to locate '$(NuGetExePath)'" />
|
||||
<!--
|
||||
Take advantage of MsBuild's build dependency tracking to make sure that we only ever download nuget.exe once.
|
||||
This effectively acts as a lock that makes sure that the download operation will only happen once and all
|
||||
parallel builds will have to wait for it to complete.
|
||||
-->
|
||||
<MsBuild Targets="_DownloadNuGet" Projects="$(MSBuildThisFileFullPath)" Properties="Configuration=NOT_IMPORTANT;DownloadNuGetExe=$(DownloadNuGetExe)" />
|
||||
</Target>
|
||||
|
||||
<Target Name="_DownloadNuGet">
|
||||
<DownloadNuGet OutputFilename="$(NuGetExePath)" Condition=" '$(DownloadNuGetExe)' == 'true' AND !Exists('$(NuGetExePath)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="RestorePackages" DependsOnTargets="CheckPrerequisites">
|
||||
<Exec Command="$(RestoreCommand)"
|
||||
Condition="'$(OS)' != 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
||||
|
||||
<Exec Command="$(RestoreCommand)"
|
||||
LogStandardErrorAsError="true"
|
||||
Condition="'$(OS)' == 'Windows_NT' And Exists('$(PackagesConfig)')" />
|
||||
</Target>
|
||||
|
||||
<Target Name="BuildPackage" DependsOnTargets="CheckPrerequisites">
|
||||
<Exec Command="$(BuildCommand)"
|
||||
Condition=" '$(OS)' != 'Windows_NT' " />
|
||||
|
||||
<Exec Command="$(BuildCommand)"
|
||||
LogStandardErrorAsError="true"
|
||||
Condition=" '$(OS)' == 'Windows_NT' " />
|
||||
</Target>
|
||||
|
||||
<UsingTask TaskName="DownloadNuGet" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll">
|
||||
<ParameterGroup>
|
||||
<OutputFilename ParameterType="System.String" Required="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Reference Include="System.Core" />
|
||||
<Using Namespace="System" />
|
||||
<Using Namespace="System.IO" />
|
||||
<Using Namespace="System.Net" />
|
||||
<Using Namespace="Microsoft.Build.Framework" />
|
||||
<Using Namespace="Microsoft.Build.Utilities" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
try {
|
||||
OutputFilename = Path.GetFullPath(OutputFilename);
|
||||
|
||||
Log.LogMessage("Downloading latest version of NuGet.exe...");
|
||||
WebClient webClient = new WebClient();
|
||||
webClient.DownloadFile("https://www.nuget.org/nuget.exe", OutputFilename);
|
||||
|
||||
return true;
|
||||
}
|
||||
catch (Exception ex) {
|
||||
Log.LogErrorFromException(ex);
|
||||
return false;
|
||||
}
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
</Project>
|
|
@ -0,0 +1,73 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project=".\NuGet.Targets" />
|
||||
|
||||
<!-- This target runs after all referenced projects have been built, but before the *.FileListAbsolute.txt file gets saved to support incremental build. -->
|
||||
<Target Name="PrepareForNugetPackaging" AfterTargets="ResolveProjectReferences">
|
||||
<Error Condition="!Exists('$(PackageSpecFile)')" Text="PackageSpecFile must be a valid path to a .nuspec file that defines NuGet package structure."/>
|
||||
|
||||
<!-- Read PackageId from the .nuspec file -->
|
||||
<XmlPeek XmlInputPath="$(PackageSpecFile)" Query="/package/metadata/id/text()">
|
||||
<Output TaskParameter="Result" PropertyName="PackageId"/>
|
||||
</XmlPeek>
|
||||
|
||||
<!-- Mark .nupkg file as generated by build so that Clean can remove it -->
|
||||
<ItemGroup>
|
||||
<FileWrites Include="$(PackageOutputDir)\$(PackageId)*.nupkg" />
|
||||
<FileWrites Include="$(PackageOutputDir)\$(PackageId)*.symbols.nupkg" Condition="'$(PackageSymbols)' == 'True'"/>
|
||||
</ItemGroup>
|
||||
</Target>
|
||||
|
||||
<!-- This target runs after build to guarantee that all dependent files have already been copied to output directory. -->
|
||||
<Target Name="BuildNugetPackage" AfterTargets="Build">
|
||||
<Error Condition="!Exists('$(PackageVersionFile)')" Text="PackageVersionFile must be a valid path to a .dll file that defines NuGet package version information."/>
|
||||
|
||||
<!-- Extract package properties from the .dll file -->
|
||||
<GetFileVersionInfo File="$(PackageVersionFile)">
|
||||
<Output TaskParameter="VersionInfo" ItemName="VersionInfo" />
|
||||
</GetFileVersionInfo>
|
||||
|
||||
<PropertyGroup>
|
||||
<PackageAuthor>@(VersionInfo->'%(CompanyName)')</PackageAuthor>
|
||||
<PackageImage>http://appanacdn.blob.core.windows.net/cdn/icons/aic.png</PackageImage>
|
||||
<PackageCopyright>@(VersionInfo->'%(LegalCopyright)')</PackageCopyright>
|
||||
<PackageCommand>$(NuGetCommand) pack "$(PackageSpecFile)" -Properties "coresdkversion=$(CoreSdkVersion);version=$(PackageVersion);author=$(PackageAuthor);image=$(PackageImage);copyright=$(PackageCopyright);configuration=$(Configuration)" -BasePath "$(BinRoot)" -OutputDirectory "$(PackageOutputDir)" -Symbols</PackageCommand>
|
||||
</PropertyGroup>
|
||||
|
||||
<!-- Make sure package output directory exists (expected by NuGet). -->
|
||||
<MakeDir Directories="$(PackageOutputDir)"/>
|
||||
|
||||
<!-- Generate .nupkg file -->
|
||||
<Error Condition="'$(CoreSdkVersion)' == ''" Text="CoreSdkVersion property must be a valid version of Core SDK included in Global.props."/>
|
||||
<Exec Command="$(PackageCommand)" ConsoleToMSBuild="true">
|
||||
<Output TaskParameter="ConsoleOutput" PropertyName="OutputOfExec" />
|
||||
</Exec>
|
||||
</Target>
|
||||
|
||||
<UsingTask TaskName="GetFileVersionInfo" TaskFactory="CodeTaskFactory" AssemblyFile="$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll">
|
||||
<ParameterGroup>
|
||||
<File ParameterType="System.String" Required="true" />
|
||||
<VersionInfo ParameterType="Microsoft.Build.Framework.ITaskItem" Output="true" />
|
||||
</ParameterGroup>
|
||||
<Task>
|
||||
<Using Namespace="System" />
|
||||
<Using Namespace="System.Diagnostics" />
|
||||
<Using Namespace="Microsoft.Build.Utilities" />
|
||||
<Code Type="Fragment" Language="cs">
|
||||
<![CDATA[
|
||||
FileVersionInfo versionInfo = FileVersionInfo.GetVersionInfo(this.File);
|
||||
this.VersionInfo = new TaskItem(this.File);
|
||||
this.VersionInfo.SetMetadata("Comments", versionInfo.Comments);
|
||||
this.VersionInfo.SetMetadata("CompanyName", versionInfo.CompanyName);
|
||||
this.VersionInfo.SetMetadata("FileMajorPart", versionInfo.FileMajorPart.ToString());
|
||||
this.VersionInfo.SetMetadata("FileMinorPart", versionInfo.FileMinorPart.ToString());
|
||||
this.VersionInfo.SetMetadata("FileBuildPart", versionInfo.FileBuildPart.ToString());
|
||||
this.VersionInfo.SetMetadata("FilePrivatePart", versionInfo.FilePrivatePart.ToString().PadLeft(5,'0'));
|
||||
this.VersionInfo.SetMetadata("LegalCopyright", versionInfo.LegalCopyright);
|
||||
this.VersionInfo.SetMetadata("ProductName", versionInfo.ProductName);
|
||||
]]>
|
||||
</Code>
|
||||
</Task>
|
||||
</UsingTask>
|
||||
|
||||
</Project>
|
|
@ -0,0 +1,12 @@
|
|||
# Changelog
|
||||
|
||||
## Version 1.2.0
|
||||
- Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector assembly was renamed on Microsoft.AI.PerfCounterCollector
|
||||
|
||||
## Version 1.0.0
|
||||
- Rename 'CustomPerformanceCounterCollectionRequest' to 'PerformanceCounterCollectionRequest'.
|
||||
|
||||
## Version 0.17
|
||||
- Diagnostic messages pertaining to performance counter collection are now merged into a single unified message that is logged at application start-up. Detailed failure information is still available through PerfView.
|
||||
|
||||
No release notes for older versions available.
|
|
@ -0,0 +1,84 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props" Condition="Exists('..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props')" />
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'Product.props'))\Product.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid Condition="'$(ProjectGuid)' == ''">{61FC6E01-B40D-4DB2-9DAB-B27B82F02244}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector</RootNamespace>
|
||||
<AssemblyName>Microsoft.AI.PerfCounterCollector</AssemblyName>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), PerformanceCollector.sln))</SolutionDir>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>ab791c22</NuGetPackageImportStamp>
|
||||
<DefineConstants>$(DefineConstants);NET40</DefineConstants>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.ApplicationInsights, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\packages\Microsoft.ApplicationInsights.2.0.0-beta4\lib\net40\Microsoft.ApplicationInsights.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Diagnostics.Tracing.EventSource">
|
||||
<HintPath>..\..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.24\lib\net40\Microsoft.Diagnostics.Tracing.EventSource.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks">
|
||||
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks.Extensions">
|
||||
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop">
|
||||
<HintPath>..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.IO">
|
||||
<HintPath>..\..\..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.IO.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Runtime">
|
||||
<HintPath>..\..\..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Runtime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks">
|
||||
<HintPath>..\..\..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Threading.Tasks.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="PerformanceCollector\Telemetry\AppInsightsTypes.g.cs" />
|
||||
<Compile Include="PerformanceCollector\Telemetry\DependencyKind.g.cs" />
|
||||
<Compile Include="PerformanceCollector\Telemetry\PerformanceCounterData.g.cs" />
|
||||
<Compile Include="PerformanceCollector\Telemetry\SeverityLevel.g.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets" Condition="Exists('..\..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" />
|
||||
<Import Project="..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
|
||||
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
|
||||
<Error Condition="!Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
|
||||
<Error Condition="Exists('..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
|
||||
</Target>
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.targets" Condition="Exists('..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.targets')" />
|
||||
</Project>
|
|
@ -0,0 +1,609 @@
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Tool : Bond Compiler 3.02
|
||||
// File : AppInsightsTypes_types.cs
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// <auto-generated />
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#region ReSharper warnings
|
||||
// ReSharper disable PartialTypeWithSinglePart
|
||||
// ReSharper disable RedundantNameQualifier
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable CheckNamespace
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
// ReSharper disable RedundantUsingDirective
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal enum DataPointType
|
||||
{
|
||||
Measurement,
|
||||
Aggregation,
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class DataPoint
|
||||
{
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
|
||||
public DataPointType kind { get; set; }
|
||||
|
||||
|
||||
public double value { get; set; }
|
||||
|
||||
|
||||
public int? count { get; set; }
|
||||
|
||||
|
||||
public double? min { get; set; }
|
||||
|
||||
|
||||
public double? max { get; set; }
|
||||
|
||||
|
||||
public double? stdDev { get; set; }
|
||||
|
||||
public DataPoint()
|
||||
: this("AI.DataPoint", "DataPoint")
|
||||
{}
|
||||
|
||||
protected DataPoint(string fullName, string name)
|
||||
{
|
||||
this.name = string.Empty;
|
||||
kind = DataPointType.Measurement;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class MetricData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public IList<DataPoint> metrics { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
public MetricData()
|
||||
: this("AI.MetricData", "MetricData")
|
||||
{}
|
||||
|
||||
protected MetricData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
metrics = new List<DataPoint>();
|
||||
properties = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal enum DependencySourceType
|
||||
{
|
||||
Undefined,
|
||||
Aic,
|
||||
Apmc,
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class RemoteDependencyData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
|
||||
public string id { get; set; }
|
||||
|
||||
|
||||
public string resultCode { get; set; }
|
||||
|
||||
|
||||
public DataPointType kind { get; set; }
|
||||
|
||||
|
||||
public double value { get; set; }
|
||||
|
||||
|
||||
public int? count { get; set; }
|
||||
|
||||
|
||||
public double? min { get; set; }
|
||||
|
||||
|
||||
public double? max { get; set; }
|
||||
|
||||
|
||||
public double? stdDev { get; set; }
|
||||
|
||||
|
||||
public DependencyKind dependencyKind { get; set; }
|
||||
|
||||
|
||||
public bool? success { get; set; }
|
||||
|
||||
|
||||
public bool? async { get; set; }
|
||||
|
||||
|
||||
public DependencySourceType dependencySource { get; set; }
|
||||
|
||||
|
||||
public string commandName { get; set; }
|
||||
|
||||
|
||||
public string dependencyTypeName { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
public RemoteDependencyData()
|
||||
: this("AI.RemoteDependencyData", "RemoteDependencyData")
|
||||
{}
|
||||
|
||||
protected RemoteDependencyData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
this.name = string.Empty;
|
||||
id = string.Empty;
|
||||
resultCode = string.Empty;
|
||||
kind = DataPointType.Measurement;
|
||||
dependencyKind = DependencyKind.Other;
|
||||
success = true;
|
||||
dependencySource = DependencySourceType.Undefined;
|
||||
commandName = string.Empty;
|
||||
dependencyTypeName = string.Empty;
|
||||
properties = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class RequestData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string id { get; set; }
|
||||
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
|
||||
|
||||
public string startTime { get; set; }
|
||||
|
||||
|
||||
|
||||
public string duration { get; set; }
|
||||
|
||||
|
||||
public string responseCode { get; set; }
|
||||
|
||||
|
||||
public bool success { get; set; }
|
||||
|
||||
|
||||
public string httpMethod { get; set; }
|
||||
|
||||
|
||||
public string url { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, double> measurements { get; set; }
|
||||
|
||||
public RequestData()
|
||||
: this("AI.RequestData", "RequestData")
|
||||
{}
|
||||
|
||||
protected RequestData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
id = string.Empty;
|
||||
this.name = string.Empty;
|
||||
startTime = string.Empty;
|
||||
duration = string.Empty;
|
||||
responseCode = string.Empty;
|
||||
httpMethod = string.Empty;
|
||||
url = string.Empty;
|
||||
properties = new Dictionary<string, string>();
|
||||
measurements = new Dictionary<string, double>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class StackFrame
|
||||
{
|
||||
|
||||
public int level { get; set; }
|
||||
|
||||
|
||||
public string method { get; set; }
|
||||
|
||||
|
||||
public string assembly { get; set; }
|
||||
|
||||
|
||||
public string fileName { get; set; }
|
||||
|
||||
|
||||
public int line { get; set; }
|
||||
|
||||
public StackFrame()
|
||||
: this("AI.StackFrame", "StackFrame")
|
||||
{}
|
||||
|
||||
protected StackFrame(string fullName, string name)
|
||||
{
|
||||
method = string.Empty;
|
||||
assembly = string.Empty;
|
||||
fileName = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class ExceptionDetails
|
||||
{
|
||||
|
||||
public int id { get; set; }
|
||||
|
||||
|
||||
public int outerId { get; set; }
|
||||
|
||||
|
||||
public string typeName { get; set; }
|
||||
|
||||
|
||||
public string message { get; set; }
|
||||
|
||||
|
||||
public bool hasFullStack { get; set; }
|
||||
|
||||
|
||||
public string stack { get; set; }
|
||||
|
||||
|
||||
public IList<StackFrame> parsedStack { get; set; }
|
||||
|
||||
public ExceptionDetails()
|
||||
: this("AI.ExceptionDetails", "ExceptionDetails")
|
||||
{}
|
||||
|
||||
protected ExceptionDetails(string fullName, string name)
|
||||
{
|
||||
typeName = string.Empty;
|
||||
message = string.Empty;
|
||||
hasFullStack = true;
|
||||
stack = string.Empty;
|
||||
parsedStack = new List<StackFrame>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class ExceptionData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string handledAt { get; set; }
|
||||
|
||||
|
||||
public IList<ExceptionDetails> exceptions { get; set; }
|
||||
|
||||
|
||||
public SeverityLevel? severityLevel { get; set; }
|
||||
|
||||
|
||||
public string problemId { get; set; }
|
||||
|
||||
|
||||
public int crashThreadId { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, double> measurements { get; set; }
|
||||
|
||||
public ExceptionData()
|
||||
: this("AI.ExceptionData", "ExceptionData")
|
||||
{}
|
||||
|
||||
protected ExceptionData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
handledAt = string.Empty;
|
||||
exceptions = new List<ExceptionDetails>();
|
||||
problemId = string.Empty;
|
||||
properties = new Dictionary<string, string>();
|
||||
measurements = new Dictionary<string, double>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class MessageData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string message { get; set; }
|
||||
|
||||
|
||||
public SeverityLevel? severityLevel { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
public MessageData()
|
||||
: this("AI.MessageData", "MessageData")
|
||||
{}
|
||||
|
||||
protected MessageData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
message = string.Empty;
|
||||
properties = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class EventData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, double> measurements { get; set; }
|
||||
|
||||
public EventData()
|
||||
: this("AI.EventData", "EventData")
|
||||
{}
|
||||
|
||||
protected EventData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
this.name = string.Empty;
|
||||
properties = new Dictionary<string, string>();
|
||||
measurements = new Dictionary<string, double>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class PageViewData
|
||||
: EventData
|
||||
{
|
||||
|
||||
public string url { get; set; }
|
||||
|
||||
|
||||
|
||||
public string duration { get; set; }
|
||||
|
||||
|
||||
public string referrer { get; set; }
|
||||
|
||||
|
||||
public string referrerData { get; set; }
|
||||
|
||||
public PageViewData()
|
||||
: this("AI.PageViewData", "PageViewData")
|
||||
{}
|
||||
|
||||
protected PageViewData(string fullName, string name)
|
||||
{
|
||||
url = string.Empty;
|
||||
duration = string.Empty;
|
||||
referrer = string.Empty;
|
||||
referrerData = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class PageViewPerfData
|
||||
: PageViewData
|
||||
{
|
||||
|
||||
|
||||
public string perfTotal { get; set; }
|
||||
|
||||
|
||||
|
||||
public string networkConnect { get; set; }
|
||||
|
||||
|
||||
|
||||
public string sentRequest { get; set; }
|
||||
|
||||
|
||||
|
||||
public string receivedResponse { get; set; }
|
||||
|
||||
|
||||
|
||||
public string domProcessing { get; set; }
|
||||
|
||||
public PageViewPerfData()
|
||||
: this("AI.PageViewPerfData", "PageViewPerfData")
|
||||
{}
|
||||
|
||||
protected PageViewPerfData(string fullName, string name)
|
||||
{
|
||||
perfTotal = string.Empty;
|
||||
networkConnect = string.Empty;
|
||||
sentRequest = string.Empty;
|
||||
receivedResponse = string.Empty;
|
||||
domProcessing = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class AjaxCallData
|
||||
: PageViewData
|
||||
{
|
||||
|
||||
public string ajaxUrl { get; set; }
|
||||
|
||||
|
||||
public double requestSize { get; set; }
|
||||
|
||||
|
||||
public double responseSize { get; set; }
|
||||
|
||||
|
||||
|
||||
public string timeToFirstByte { get; set; }
|
||||
|
||||
|
||||
|
||||
public string timeToLastByte { get; set; }
|
||||
|
||||
|
||||
|
||||
public string callbackDuration { get; set; }
|
||||
|
||||
|
||||
public string responseCode { get; set; }
|
||||
|
||||
|
||||
public bool success { get; set; }
|
||||
|
||||
public AjaxCallData()
|
||||
: this("AI.AjaxCallData", "AjaxCallData")
|
||||
{}
|
||||
|
||||
protected AjaxCallData(string fullName, string name)
|
||||
{
|
||||
ajaxUrl = string.Empty;
|
||||
timeToFirstByte = string.Empty;
|
||||
timeToLastByte = string.Empty;
|
||||
callbackDuration = string.Empty;
|
||||
responseCode = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal enum TestResult
|
||||
{
|
||||
Pass,
|
||||
Fail,
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class AvailabilityData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string testRunId { get; set; }
|
||||
|
||||
|
||||
|
||||
public string testTimeStamp { get; set; }
|
||||
|
||||
|
||||
public string testName { get; set; }
|
||||
|
||||
|
||||
|
||||
public string duration { get; set; }
|
||||
|
||||
|
||||
public TestResult result { get; set; }
|
||||
|
||||
|
||||
public string runLocation { get; set; }
|
||||
|
||||
|
||||
public string message { get; set; }
|
||||
|
||||
|
||||
public double dataSize { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, double> measurements { get; set; }
|
||||
|
||||
public AvailabilityData()
|
||||
: this("AI.AvailabilityData", "AvailabilityData")
|
||||
{}
|
||||
|
||||
protected AvailabilityData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
testRunId = string.Empty;
|
||||
testTimeStamp = string.Empty;
|
||||
testName = string.Empty;
|
||||
duration = string.Empty;
|
||||
result = new TestResult();
|
||||
runLocation = string.Empty;
|
||||
message = string.Empty;
|
||||
properties = new Dictionary<string, string>();
|
||||
measurements = new Dictionary<string, double>();
|
||||
}
|
||||
}
|
||||
} // AI
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Tool : Bond Compiler 3.02
|
||||
// File : DependencyKind_types.cs
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// <auto-generated />
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#region ReSharper warnings
|
||||
// ReSharper disable PartialTypeWithSinglePart
|
||||
// ReSharper disable RedundantNameQualifier
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable CheckNamespace
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
// ReSharper disable RedundantUsingDirective
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal enum DependencyKind
|
||||
{
|
||||
SQL = 0,
|
||||
Http,
|
||||
Other,
|
||||
}
|
||||
} // AI
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Tool : Bond Compiler 3.02
|
||||
// File : PerformanceCounterData_types.cs
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// <auto-generated />
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#region ReSharper warnings
|
||||
// ReSharper disable PartialTypeWithSinglePart
|
||||
// ReSharper disable RedundantNameQualifier
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable CheckNamespace
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
// ReSharper disable RedundantUsingDirective
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class PerformanceCounterData
|
||||
|
||||
{
|
||||
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string categoryName { get; set; }
|
||||
|
||||
|
||||
public string counterName { get; set; }
|
||||
|
||||
|
||||
public string instanceName { get; set; }
|
||||
|
||||
|
||||
public DataPointType kind { get; set; }
|
||||
|
||||
|
||||
public int? count { get; set; }
|
||||
|
||||
|
||||
public double? min { get; set; }
|
||||
|
||||
|
||||
public double? max { get; set; }
|
||||
|
||||
|
||||
public double? stdDev { get; set; }
|
||||
|
||||
|
||||
public double value { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
public PerformanceCounterData()
|
||||
: this("AI.PerformanceCounterData", "PerformanceCounterData")
|
||||
{}
|
||||
|
||||
protected PerformanceCounterData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
categoryName = string.Empty;
|
||||
counterName = string.Empty;
|
||||
instanceName = string.Empty;
|
||||
kind = DataPointType.Aggregation;
|
||||
properties = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
} // AI
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Tool : Bond Compiler 3.02
|
||||
// File : SeverityLevel_types.cs
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// <auto-generated />
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#region ReSharper warnings
|
||||
// ReSharper disable PartialTypeWithSinglePart
|
||||
// ReSharper disable RedundantNameQualifier
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable CheckNamespace
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
// ReSharper disable RedundantUsingDirective
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal enum SeverityLevel
|
||||
{
|
||||
Verbose,
|
||||
Information,
|
||||
Warning,
|
||||
Error,
|
||||
Critical,
|
||||
}
|
||||
} // AI
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MicroBuild.Core" version="0.2.0" targetFramework="net40" developmentDependency="true" />
|
||||
<package id="Microsoft.ApplicationInsights" version="2.0.0-beta4" targetFramework="net40" />
|
||||
<package id="Microsoft.ApplicationInsights.TelemetryTypes.PerformanceCollector.v2" version="2.0.68-build00708" targetFramework="net40" />
|
||||
<package id="Microsoft.Bcl" version="1.1.8" targetFramework="net40" />
|
||||
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net40" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net40" />
|
||||
<package id="Microsoft.Diagnostics.Tracing.EventSource.Redist" version="1.1.24" targetFramework="net40" />
|
||||
<package id="StyleCop.MSBuild" version="4.7.49.0" targetFramework="net40" developmentDependency="true" />
|
||||
</packages>
|
|
@ -0,0 +1,64 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props" Condition="Exists('..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props')" />
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'Product.props'))\Product.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid Condition="'$(ProjectGuid)' == ''">{FBFCB985-BBFE-4954-A2EF-8124A42F56C7}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector</RootNamespace>
|
||||
<AssemblyName>Microsoft.AI.PerfCounterCollector</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<NuGetPackageImportStamp>b2556b51</NuGetPackageImportStamp>
|
||||
<DefineConstants>$(DefineConstants);NET45</DefineConstants>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), PerformanceCollector.sln))</SolutionDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.ApplicationInsights, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\packages\Microsoft.ApplicationInsights.2.0.0-beta4\lib\net45\Microsoft.ApplicationInsights.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Xml" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Net" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="PerformanceCollector\Telemetry\AppInsightsTypes.g.cs" />
|
||||
<Compile Include="PerformanceCollector\Telemetry\DependencyKind.g.cs" />
|
||||
<Compile Include="PerformanceCollector\Telemetry\PerformanceCounterData.g.cs" />
|
||||
<Compile Include="PerformanceCollector\Telemetry\SeverityLevel.g.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="..\Shared\Shared.projitems" Label="Shared" Condition="Exists('..\Shared\Shared.projitems')" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.props'))" />
|
||||
<Error Condition="!Exists('..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.targets'))" />
|
||||
</Target>
|
||||
<Import Project="..\..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets" Condition="Exists('..\..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" />
|
||||
<Import Project="..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.targets" Condition="Exists('..\..\..\packages\MicroBuild.Core.0.2.0\build\MicroBuild.Core.targets')" />
|
||||
</Project>
|
|
@ -0,0 +1,609 @@
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Tool : Bond Compiler 3.02
|
||||
// File : AppInsightsTypes_types.cs
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// <auto-generated />
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#region ReSharper warnings
|
||||
// ReSharper disable PartialTypeWithSinglePart
|
||||
// ReSharper disable RedundantNameQualifier
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable CheckNamespace
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
// ReSharper disable RedundantUsingDirective
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal enum DataPointType
|
||||
{
|
||||
Measurement,
|
||||
Aggregation,
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class DataPoint
|
||||
{
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
|
||||
public DataPointType kind { get; set; }
|
||||
|
||||
|
||||
public double value { get; set; }
|
||||
|
||||
|
||||
public int? count { get; set; }
|
||||
|
||||
|
||||
public double? min { get; set; }
|
||||
|
||||
|
||||
public double? max { get; set; }
|
||||
|
||||
|
||||
public double? stdDev { get; set; }
|
||||
|
||||
public DataPoint()
|
||||
: this("AI.DataPoint", "DataPoint")
|
||||
{}
|
||||
|
||||
protected DataPoint(string fullName, string name)
|
||||
{
|
||||
this.name = string.Empty;
|
||||
kind = DataPointType.Measurement;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class MetricData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public IList<DataPoint> metrics { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
public MetricData()
|
||||
: this("AI.MetricData", "MetricData")
|
||||
{}
|
||||
|
||||
protected MetricData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
metrics = new List<DataPoint>();
|
||||
properties = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal enum DependencySourceType
|
||||
{
|
||||
Undefined,
|
||||
Aic,
|
||||
Apmc,
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class RemoteDependencyData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
|
||||
public string id { get; set; }
|
||||
|
||||
|
||||
public string resultCode { get; set; }
|
||||
|
||||
|
||||
public DataPointType kind { get; set; }
|
||||
|
||||
|
||||
public double value { get; set; }
|
||||
|
||||
|
||||
public int? count { get; set; }
|
||||
|
||||
|
||||
public double? min { get; set; }
|
||||
|
||||
|
||||
public double? max { get; set; }
|
||||
|
||||
|
||||
public double? stdDev { get; set; }
|
||||
|
||||
|
||||
public DependencyKind dependencyKind { get; set; }
|
||||
|
||||
|
||||
public bool? success { get; set; }
|
||||
|
||||
|
||||
public bool? async { get; set; }
|
||||
|
||||
|
||||
public DependencySourceType dependencySource { get; set; }
|
||||
|
||||
|
||||
public string commandName { get; set; }
|
||||
|
||||
|
||||
public string dependencyTypeName { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
public RemoteDependencyData()
|
||||
: this("AI.RemoteDependencyData", "RemoteDependencyData")
|
||||
{}
|
||||
|
||||
protected RemoteDependencyData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
this.name = string.Empty;
|
||||
id = string.Empty;
|
||||
resultCode = string.Empty;
|
||||
kind = DataPointType.Measurement;
|
||||
dependencyKind = DependencyKind.Other;
|
||||
success = true;
|
||||
dependencySource = DependencySourceType.Undefined;
|
||||
commandName = string.Empty;
|
||||
dependencyTypeName = string.Empty;
|
||||
properties = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class RequestData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string id { get; set; }
|
||||
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
|
||||
|
||||
public string startTime { get; set; }
|
||||
|
||||
|
||||
|
||||
public string duration { get; set; }
|
||||
|
||||
|
||||
public string responseCode { get; set; }
|
||||
|
||||
|
||||
public bool success { get; set; }
|
||||
|
||||
|
||||
public string httpMethod { get; set; }
|
||||
|
||||
|
||||
public string url { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, double> measurements { get; set; }
|
||||
|
||||
public RequestData()
|
||||
: this("AI.RequestData", "RequestData")
|
||||
{}
|
||||
|
||||
protected RequestData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
id = string.Empty;
|
||||
this.name = string.Empty;
|
||||
startTime = string.Empty;
|
||||
duration = string.Empty;
|
||||
responseCode = string.Empty;
|
||||
httpMethod = string.Empty;
|
||||
url = string.Empty;
|
||||
properties = new Dictionary<string, string>();
|
||||
measurements = new Dictionary<string, double>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class StackFrame
|
||||
{
|
||||
|
||||
public int level { get; set; }
|
||||
|
||||
|
||||
public string method { get; set; }
|
||||
|
||||
|
||||
public string assembly { get; set; }
|
||||
|
||||
|
||||
public string fileName { get; set; }
|
||||
|
||||
|
||||
public int line { get; set; }
|
||||
|
||||
public StackFrame()
|
||||
: this("AI.StackFrame", "StackFrame")
|
||||
{}
|
||||
|
||||
protected StackFrame(string fullName, string name)
|
||||
{
|
||||
method = string.Empty;
|
||||
assembly = string.Empty;
|
||||
fileName = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class ExceptionDetails
|
||||
{
|
||||
|
||||
public int id { get; set; }
|
||||
|
||||
|
||||
public int outerId { get; set; }
|
||||
|
||||
|
||||
public string typeName { get; set; }
|
||||
|
||||
|
||||
public string message { get; set; }
|
||||
|
||||
|
||||
public bool hasFullStack { get; set; }
|
||||
|
||||
|
||||
public string stack { get; set; }
|
||||
|
||||
|
||||
public IList<StackFrame> parsedStack { get; set; }
|
||||
|
||||
public ExceptionDetails()
|
||||
: this("AI.ExceptionDetails", "ExceptionDetails")
|
||||
{}
|
||||
|
||||
protected ExceptionDetails(string fullName, string name)
|
||||
{
|
||||
typeName = string.Empty;
|
||||
message = string.Empty;
|
||||
hasFullStack = true;
|
||||
stack = string.Empty;
|
||||
parsedStack = new List<StackFrame>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class ExceptionData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string handledAt { get; set; }
|
||||
|
||||
|
||||
public IList<ExceptionDetails> exceptions { get; set; }
|
||||
|
||||
|
||||
public SeverityLevel? severityLevel { get; set; }
|
||||
|
||||
|
||||
public string problemId { get; set; }
|
||||
|
||||
|
||||
public int crashThreadId { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, double> measurements { get; set; }
|
||||
|
||||
public ExceptionData()
|
||||
: this("AI.ExceptionData", "ExceptionData")
|
||||
{}
|
||||
|
||||
protected ExceptionData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
handledAt = string.Empty;
|
||||
exceptions = new List<ExceptionDetails>();
|
||||
problemId = string.Empty;
|
||||
properties = new Dictionary<string, string>();
|
||||
measurements = new Dictionary<string, double>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class MessageData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string message { get; set; }
|
||||
|
||||
|
||||
public SeverityLevel? severityLevel { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
public MessageData()
|
||||
: this("AI.MessageData", "MessageData")
|
||||
{}
|
||||
|
||||
protected MessageData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
message = string.Empty;
|
||||
properties = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class EventData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string name { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, double> measurements { get; set; }
|
||||
|
||||
public EventData()
|
||||
: this("AI.EventData", "EventData")
|
||||
{}
|
||||
|
||||
protected EventData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
this.name = string.Empty;
|
||||
properties = new Dictionary<string, string>();
|
||||
measurements = new Dictionary<string, double>();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class PageViewData
|
||||
: EventData
|
||||
{
|
||||
|
||||
public string url { get; set; }
|
||||
|
||||
|
||||
|
||||
public string duration { get; set; }
|
||||
|
||||
|
||||
public string referrer { get; set; }
|
||||
|
||||
|
||||
public string referrerData { get; set; }
|
||||
|
||||
public PageViewData()
|
||||
: this("AI.PageViewData", "PageViewData")
|
||||
{}
|
||||
|
||||
protected PageViewData(string fullName, string name)
|
||||
{
|
||||
url = string.Empty;
|
||||
duration = string.Empty;
|
||||
referrer = string.Empty;
|
||||
referrerData = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class PageViewPerfData
|
||||
: PageViewData
|
||||
{
|
||||
|
||||
|
||||
public string perfTotal { get; set; }
|
||||
|
||||
|
||||
|
||||
public string networkConnect { get; set; }
|
||||
|
||||
|
||||
|
||||
public string sentRequest { get; set; }
|
||||
|
||||
|
||||
|
||||
public string receivedResponse { get; set; }
|
||||
|
||||
|
||||
|
||||
public string domProcessing { get; set; }
|
||||
|
||||
public PageViewPerfData()
|
||||
: this("AI.PageViewPerfData", "PageViewPerfData")
|
||||
{}
|
||||
|
||||
protected PageViewPerfData(string fullName, string name)
|
||||
{
|
||||
perfTotal = string.Empty;
|
||||
networkConnect = string.Empty;
|
||||
sentRequest = string.Empty;
|
||||
receivedResponse = string.Empty;
|
||||
domProcessing = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class AjaxCallData
|
||||
: PageViewData
|
||||
{
|
||||
|
||||
public string ajaxUrl { get; set; }
|
||||
|
||||
|
||||
public double requestSize { get; set; }
|
||||
|
||||
|
||||
public double responseSize { get; set; }
|
||||
|
||||
|
||||
|
||||
public string timeToFirstByte { get; set; }
|
||||
|
||||
|
||||
|
||||
public string timeToLastByte { get; set; }
|
||||
|
||||
|
||||
|
||||
public string callbackDuration { get; set; }
|
||||
|
||||
|
||||
public string responseCode { get; set; }
|
||||
|
||||
|
||||
public bool success { get; set; }
|
||||
|
||||
public AjaxCallData()
|
||||
: this("AI.AjaxCallData", "AjaxCallData")
|
||||
{}
|
||||
|
||||
protected AjaxCallData(string fullName, string name)
|
||||
{
|
||||
ajaxUrl = string.Empty;
|
||||
timeToFirstByte = string.Empty;
|
||||
timeToLastByte = string.Empty;
|
||||
callbackDuration = string.Empty;
|
||||
responseCode = string.Empty;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal enum TestResult
|
||||
{
|
||||
Pass,
|
||||
Fail,
|
||||
}
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class AvailabilityData
|
||||
|
||||
{
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string testRunId { get; set; }
|
||||
|
||||
|
||||
|
||||
public string testTimeStamp { get; set; }
|
||||
|
||||
|
||||
public string testName { get; set; }
|
||||
|
||||
|
||||
|
||||
public string duration { get; set; }
|
||||
|
||||
|
||||
public TestResult result { get; set; }
|
||||
|
||||
|
||||
public string runLocation { get; set; }
|
||||
|
||||
|
||||
public string message { get; set; }
|
||||
|
||||
|
||||
public double dataSize { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, double> measurements { get; set; }
|
||||
|
||||
public AvailabilityData()
|
||||
: this("AI.AvailabilityData", "AvailabilityData")
|
||||
{}
|
||||
|
||||
protected AvailabilityData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
testRunId = string.Empty;
|
||||
testTimeStamp = string.Empty;
|
||||
testName = string.Empty;
|
||||
duration = string.Empty;
|
||||
result = new TestResult();
|
||||
runLocation = string.Empty;
|
||||
message = string.Empty;
|
||||
properties = new Dictionary<string, string>();
|
||||
measurements = new Dictionary<string, double>();
|
||||
}
|
||||
}
|
||||
} // AI
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,45 @@
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Tool : Bond Compiler 3.02
|
||||
// File : DependencyKind_types.cs
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// <auto-generated />
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#region ReSharper warnings
|
||||
// ReSharper disable PartialTypeWithSinglePart
|
||||
// ReSharper disable RedundantNameQualifier
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable CheckNamespace
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
// ReSharper disable RedundantUsingDirective
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal enum DependencyKind
|
||||
{
|
||||
SQL = 0,
|
||||
Http,
|
||||
Other,
|
||||
}
|
||||
} // AI
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,90 @@
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Tool : Bond Compiler 3.02
|
||||
// File : PerformanceCounterData_types.cs
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// <auto-generated />
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#region ReSharper warnings
|
||||
// ReSharper disable PartialTypeWithSinglePart
|
||||
// ReSharper disable RedundantNameQualifier
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable CheckNamespace
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
// ReSharper disable RedundantUsingDirective
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal partial class PerformanceCounterData
|
||||
|
||||
{
|
||||
|
||||
|
||||
public int ver { get; set; }
|
||||
|
||||
|
||||
public string categoryName { get; set; }
|
||||
|
||||
|
||||
public string counterName { get; set; }
|
||||
|
||||
|
||||
public string instanceName { get; set; }
|
||||
|
||||
|
||||
public DataPointType kind { get; set; }
|
||||
|
||||
|
||||
public int? count { get; set; }
|
||||
|
||||
|
||||
public double? min { get; set; }
|
||||
|
||||
|
||||
public double? max { get; set; }
|
||||
|
||||
|
||||
public double? stdDev { get; set; }
|
||||
|
||||
|
||||
public double value { get; set; }
|
||||
|
||||
|
||||
public IDictionary<string, string> properties { get; set; }
|
||||
|
||||
public PerformanceCounterData()
|
||||
: this("AI.PerformanceCounterData", "PerformanceCounterData")
|
||||
{}
|
||||
|
||||
protected PerformanceCounterData(string fullName, string name)
|
||||
{
|
||||
ver = 2;
|
||||
categoryName = string.Empty;
|
||||
counterName = string.Empty;
|
||||
instanceName = string.Empty;
|
||||
kind = DataPointType.Aggregation;
|
||||
properties = new Dictionary<string, string>();
|
||||
}
|
||||
}
|
||||
} // AI
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,47 @@
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Tool : Bond Compiler 3.02
|
||||
// File : SeverityLevel_types.cs
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost when
|
||||
// the code is regenerated.
|
||||
// <auto-generated />
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
|
||||
#region ReSharper warnings
|
||||
// ReSharper disable PartialTypeWithSinglePart
|
||||
// ReSharper disable RedundantNameQualifier
|
||||
// ReSharper disable InconsistentNaming
|
||||
// ReSharper disable CheckNamespace
|
||||
// ReSharper disable UnusedParameter.Local
|
||||
// ReSharper disable RedundantUsingDirective
|
||||
#endregion
|
||||
|
||||
namespace Microsoft.ApplicationInsights.Extensibility.Implementation.External
|
||||
{
|
||||
using System.Collections.Generic;
|
||||
|
||||
|
||||
[System.CodeDom.Compiler.GeneratedCode("gbc", "3.02")]
|
||||
internal enum SeverityLevel
|
||||
{
|
||||
Verbose,
|
||||
Information,
|
||||
Warning,
|
||||
Error,
|
||||
Critical,
|
||||
}
|
||||
} // AI
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
|
@ -0,0 +1,7 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="MicroBuild.Core" version="0.2.0" targetFramework="net45" developmentDependency="true" />
|
||||
<package id="Microsoft.ApplicationInsights" version="2.0.0-beta4" targetFramework="net45" />
|
||||
<package id="Microsoft.ApplicationInsights.TelemetryTypes.PerformanceCollector.v2" version="2.0.68-build00708" targetFramework="net45" />
|
||||
<package id="StyleCop.MSBuild" version="4.7.49.0" targetFramework="net45" developmentDependency="true" />
|
||||
</packages>
|
|
@ -0,0 +1,22 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("Xdt.Tests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("Xdt.Tests")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("0cde476e-a4fb-4c0c-8dea-d8e65a753274")]
|
|
@ -0,0 +1,202 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<data>
|
||||
<item>
|
||||
<original>
|
||||
|
||||
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
|
||||
<!--
|
||||
Learn more about Application Insights configuration with ApplicationInsights.config here:
|
||||
http://go.microsoft.com/fwlink/?LinkID=513840
|
||||
-->
|
||||
<InstrumentationKey>56D500C1-0F6C-46D1-A1F2-250D65075E0F</InstrumentationKey>
|
||||
<TelemetryChannel>
|
||||
<DeveloperMode>true</DeveloperMode>
|
||||
</TelemetryChannel>
|
||||
<TelemetryModules>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnosticsTelemetryModule, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry.ApmcModule, Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebRequestTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebExceptionTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
</TelemetryModules>
|
||||
<ContextInitializers>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.ComponentContextInitializer, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.DeviceContextInitializer, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.AzureRoleEnvironmentContextInitializer, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
</ContextInitializers>
|
||||
<TelemetryInitializers>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.TimestampPropertyInitializer, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationNameTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationIdTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
</TelemetryInitializers>
|
||||
</ApplicationInsights>
|
||||
|
||||
</original>
|
||||
<expectedPostTransform>
|
||||
|
||||
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
|
||||
<!--
|
||||
Learn more about Application Insights configuration with ApplicationInsights.config here:
|
||||
http://go.microsoft.com/fwlink/?LinkID=513840
|
||||
-->
|
||||
<InstrumentationKey>56D500C1-0F6C-46D1-A1F2-250D65075E0F</InstrumentationKey>
|
||||
<TelemetryChannel>
|
||||
<DeveloperMode>true</DeveloperMode>
|
||||
</TelemetryChannel>
|
||||
<TelemetryModules>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnosticsTelemetryModule, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry.ApmcModule, Microsoft.ApplicationInsights.Extensibility.RuntimeTelemetry"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebRequestTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.RequestTracking.TelemetryModules.WebExceptionTrackingTelemetryModule, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
|
||||
<!--
|
||||
Use the following syntax here to collect additional performance counters:
|
||||
|
||||
<Counters>
|
||||
<Add PerformanceCounter="\Process(??APP_WIN32_PROC??)\Handle Count" ReportAs="Process handle count" />
|
||||
...
|
||||
</Counters>
|
||||
|
||||
PerformanceCounter must be either \CategoryName(InstanceName)\CounterName or \CategoryName\CounterName
|
||||
|
||||
Counter names may only contain letters, round brackets, forward slashes, hyphens, underscores, spaces and dots.
|
||||
You may provide an optional ReportAs attribute which will be used as the metric name when reporting counter data.
|
||||
For the purposes of reporting, metric names will be sanitized by removing all invalid characters from the resulting metric name.
|
||||
|
||||
NOTE: performance counters configuration will be lost upon NuGet upgrade.
|
||||
|
||||
The following placeholders are supported as InstanceName:
|
||||
??APP_WIN32_PROC?? - instance name of the application process for Win32 counters.
|
||||
??APP_W3SVC_PROC?? - instance name of the application IIS worker process for IIS/ASP.NET counters.
|
||||
??APP_CLR_PROC?? - instance name of the application CLR process for .NET counters.
|
||||
-->
|
||||
</Add>
|
||||
</TelemetryModules>
|
||||
<ContextInitializers>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.ComponentContextInitializer, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.DeviceContextInitializer, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.AzureRoleEnvironmentContextInitializer, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
</ContextInitializers>
|
||||
<TelemetryInitializers>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.TimestampPropertyInitializer, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationNameTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationIdTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
</TelemetryInitializers>
|
||||
</ApplicationInsights>
|
||||
|
||||
</expectedPostTransform>
|
||||
</item>
|
||||
<item>
|
||||
<original>
|
||||
|
||||
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
|
||||
<!--
|
||||
Learn more about Application Insights configuration with ApplicationInsights.config here:
|
||||
http://go.microsoft.com/fwlink/?LinkID=513840
|
||||
-->
|
||||
<InstrumentationKey>56D500C1-0F6C-46D1-A1F2-250D65075E0F</InstrumentationKey>
|
||||
<TelemetryChannel>
|
||||
<DeveloperMode>true</DeveloperMode>
|
||||
</TelemetryChannel>
|
||||
<ContextInitializers>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.ComponentContextInitializer, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.DeviceContextInitializer, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.AzureRoleEnvironmentContextInitializer, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
</ContextInitializers>
|
||||
<TelemetryInitializers>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.TimestampPropertyInitializer, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationNameTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationIdTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
</TelemetryInitializers>
|
||||
</ApplicationInsights>
|
||||
|
||||
</original>
|
||||
<expectedPostTransform>
|
||||
|
||||
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
|
||||
<!--
|
||||
Learn more about Application Insights configuration with ApplicationInsights.config here:
|
||||
http://go.microsoft.com/fwlink/?LinkID=513840
|
||||
-->
|
||||
<InstrumentationKey>56D500C1-0F6C-46D1-A1F2-250D65075E0F</InstrumentationKey>
|
||||
<TelemetryChannel>
|
||||
<DeveloperMode>true</DeveloperMode>
|
||||
</TelemetryChannel>
|
||||
<ContextInitializers>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.ComponentContextInitializer, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.DeviceContextInitializer, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.AzureRoleEnvironmentContextInitializer, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
</ContextInitializers>
|
||||
<TelemetryInitializers>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.TimestampPropertyInitializer, Microsoft.ApplicationInsights"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationNameTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Web.TelemetryInitializers.WebOperationIdTelemetryInitializer, Microsoft.ApplicationInsights.Extensibility.Web"/>
|
||||
</TelemetryInitializers>
|
||||
<TelemetryModules>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
|
||||
<!--
|
||||
Use the following syntax here to collect additional performance counters:
|
||||
|
||||
<Counters>
|
||||
<Add PerformanceCounter="\Process(??APP_WIN32_PROC??)\Handle Count" ReportAs="Process handle count" />
|
||||
...
|
||||
</Counters>
|
||||
|
||||
PerformanceCounter must be either \CategoryName(InstanceName)\CounterName or \CategoryName\CounterName
|
||||
|
||||
Counter names may only contain letters, round brackets, forward slashes, hyphens, underscores, spaces and dots.
|
||||
You may provide an optional ReportAs attribute which will be used as the metric name when reporting counter data.
|
||||
For the purposes of reporting, metric names will be sanitized by removing all invalid characters from the resulting metric name.
|
||||
|
||||
NOTE: performance counters configuration will be lost upon NuGet upgrade.
|
||||
|
||||
The following placeholders are supported as InstanceName:
|
||||
??APP_WIN32_PROC?? - instance name of the application process for Win32 counters.
|
||||
??APP_W3SVC_PROC?? - instance name of the application IIS worker process for IIS/ASP.NET counters.
|
||||
??APP_CLR_PROC?? - instance name of the application CLR process for .NET counters.
|
||||
-->
|
||||
</Add>
|
||||
</TelemetryModules>
|
||||
</ApplicationInsights>
|
||||
|
||||
</expectedPostTransform>
|
||||
</item>
|
||||
<item>
|
||||
<original>
|
||||
|
||||
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
|
||||
</ApplicationInsights>
|
||||
|
||||
</original>
|
||||
<expectedPostTransform>
|
||||
|
||||
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" schemaVersion="2014-05-30">
|
||||
<TelemetryModules>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
|
||||
<!--
|
||||
Use the following syntax here to collect additional performance counters:
|
||||
|
||||
<Counters>
|
||||
<Add PerformanceCounter="\Process(??APP_WIN32_PROC??)\Handle Count" ReportAs="Process handle count" />
|
||||
...
|
||||
</Counters>
|
||||
|
||||
PerformanceCounter must be either \CategoryName(InstanceName)\CounterName or \CategoryName\CounterName
|
||||
|
||||
Counter names may only contain letters, round brackets, forward slashes, hyphens, underscores, spaces and dots.
|
||||
You may provide an optional ReportAs attribute which will be used as the metric name when reporting counter data.
|
||||
For the purposes of reporting, metric names will be sanitized by removing all invalid characters from the resulting metric name.
|
||||
|
||||
NOTE: performance counters configuration will be lost upon NuGet upgrade.
|
||||
|
||||
The following placeholders are supported as InstanceName:
|
||||
??APP_WIN32_PROC?? - instance name of the application process for Win32 counters.
|
||||
??APP_W3SVC_PROC?? - instance name of the application IIS worker process for IIS/ASP.NET counters.
|
||||
??APP_CLR_PROC?? - instance name of the application CLR process for .NET counters.
|
||||
-->
|
||||
</Add>
|
||||
</TelemetryModules>
|
||||
</ApplicationInsights>
|
||||
|
||||
</expectedPostTransform>
|
||||
</item>
|
||||
</data>
|
|
@ -0,0 +1,107 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'Test.props'))\Test.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{C6B569BC-6F19-42C9-A951-DA611BB0F4BE}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>Xdt.Tests</RootNamespace>
|
||||
<AssemblyName>Xdt.Tests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||
<IsCodedUITest>False</IsCodedUITest>
|
||||
<TestProjectType>UnitTest</TestProjectType>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<NuGetPackageImportStamp>b92eaaea</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<OutputPath>..\..\..\..\bin\Debug\PerformanceCollector\Tests\</OutputPath>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<OutputPath>..\..\..\..\bin\Release\PerformanceCollector\Tests\</OutputPath>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<CodeAnalysisRuleSet>..\..\..\ApplicationInsightsSDKRules.ruleset</CodeAnalysisRuleSet>
|
||||
<RunCodeAnalysis>true</RunCodeAnalysis>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.Web.XmlTransform">
|
||||
<HintPath>..\..\..\..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="('$(VisualStudioVersion)' == '10.0' or '$(VisualStudioVersion)' == '') and '$(TargetFrameworkVersion)' == 'v3.5'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
</ItemGroup>
|
||||
</When>
|
||||
<Otherwise>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
||||
</ItemGroup>
|
||||
</Otherwise>
|
||||
</Choose>
|
||||
<ItemGroup>
|
||||
<Compile Include="XdtTests.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="..\..\NuGet\ApplicationInsights.config.install.xdt">
|
||||
<Link>ApplicationInsights.config.install.xdt</Link>
|
||||
</EmbeddedResource>
|
||||
<EmbeddedResource Include="..\..\NuGet\ApplicationInsights.config.uninstall.xdt">
|
||||
<Link>ApplicationInsights.config.uninstall.xdt</Link>
|
||||
</EmbeddedResource>
|
||||
<None Include="packages.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<EmbeddedResource Include="Resources\TestDataSet.xml">
|
||||
<SubType>Designer</SubType>
|
||||
</EmbeddedResource>
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</When>
|
||||
</Choose>
|
||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="..\..\..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets" Condition="Exists('..\..\..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('..\..\..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\..\..\packages\StyleCop.MSBuild.4.7.49.0\build\StyleCop.MSBuild.Targets'))" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,118 @@
|
|||
namespace Xdt.Tests
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reflection;
|
||||
using System.Xml;
|
||||
using System.Xml.Linq;
|
||||
using System.Xml.XPath;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using Microsoft.Web.XmlTransform;
|
||||
|
||||
[TestClass]
|
||||
public class XdtTests
|
||||
{
|
||||
[TestMethod]
|
||||
public void XdtTest()
|
||||
{
|
||||
this.ValidateTransform(
|
||||
".ApplicationInsights.config.install.xdt",
|
||||
".ApplicationInsights.config.uninstall.xdt",
|
||||
".TestDataSet.xml");
|
||||
}
|
||||
|
||||
private static string GetInnerXml(XElement element)
|
||||
{
|
||||
XmlReader reader = element.CreateReader();
|
||||
reader.MoveToContent();
|
||||
return reader.ReadInnerXml();
|
||||
}
|
||||
|
||||
private void ValidateTransform(string installTransformationName, string uninstallTransformationName, string testDataSetName)
|
||||
{
|
||||
// load all relevant XDTs and the test data set XML
|
||||
var installXdtName =
|
||||
Assembly.GetExecutingAssembly()
|
||||
.GetManifestResourceNames()
|
||||
.Single(name => name.EndsWith(installTransformationName, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
var uninstallXdtName =
|
||||
Assembly.GetExecutingAssembly()
|
||||
.GetManifestResourceNames()
|
||||
.Single(name => name.EndsWith(uninstallTransformationName, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
var dataSetName =
|
||||
Assembly.GetExecutingAssembly()
|
||||
.GetManifestResourceNames()
|
||||
.Single(name => name.EndsWith(testDataSetName, StringComparison.OrdinalIgnoreCase));
|
||||
|
||||
var installXdtStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(installXdtName);
|
||||
var uninstallXdtStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(uninstallXdtName);
|
||||
|
||||
var dataSetStream = Assembly.GetExecutingAssembly().GetManifestResourceStream(dataSetName);
|
||||
var dataSetXml = XElement.Load(dataSetStream);
|
||||
|
||||
using (var installXdtStreamReader = new StreamReader(installXdtStream))
|
||||
{
|
||||
using (var uninstallXdtStreamReader = new StreamReader(uninstallXdtStream))
|
||||
{
|
||||
var installTransformation = new XmlTransformation(installXdtStreamReader.ReadToEnd(), false, null);
|
||||
var uninstallTransformation = new XmlTransformation(uninstallXdtStreamReader.ReadToEnd(), false, null);
|
||||
|
||||
int i = 0;
|
||||
foreach (var item in dataSetXml.XPathSelectElements("./item"))
|
||||
{
|
||||
Trace.WriteLine("Item #" + i++);
|
||||
|
||||
var original = GetInnerXml(item.XPathSelectElement("./original"));
|
||||
var expectedPostTransform = GetInnerXml(item.XPathSelectElement("./expectedPostTransform"));
|
||||
|
||||
var targetDocument = new XmlDocument();
|
||||
targetDocument.LoadXml(original);
|
||||
|
||||
bool success = installTransformation.Apply(targetDocument);
|
||||
Assert.IsTrue(
|
||||
success,
|
||||
"Transformation (install) has failed. XDT: {0}, XML: {1}",
|
||||
installXdtName,
|
||||
item);
|
||||
|
||||
// validate the transformation result
|
||||
Assert.IsTrue(
|
||||
string.Equals(
|
||||
expectedPostTransform,
|
||||
targetDocument.OuterXml.Replace("\r", null),
|
||||
StringComparison.Ordinal),
|
||||
"Unexpected transform (install) result. Expected:{0}{0}{1}{0}{0} Actual:{0}{2}{0}{0}",
|
||||
Environment.NewLine,
|
||||
expectedPostTransform,
|
||||
targetDocument.OuterXml);
|
||||
|
||||
var transformedDocument = targetDocument.OuterXml;
|
||||
|
||||
// apply uninstall transformation
|
||||
success = uninstallTransformation.Apply(targetDocument);
|
||||
Assert.IsTrue(
|
||||
success,
|
||||
"Transformation (uninstall) has failed. XDT: {0}, XML: {1}",
|
||||
uninstallXdtName,
|
||||
transformedDocument);
|
||||
|
||||
// validate the transformation result
|
||||
Assert.IsTrue(
|
||||
string.Equals(
|
||||
original,
|
||||
targetDocument.OuterXml.Replace("\r", null),
|
||||
StringComparison.Ordinal),
|
||||
"Unexpected transform (uninstall) result. Expected:{0}{1}{0}{0} Actual:{0}{2}",
|
||||
Environment.NewLine,
|
||||
original,
|
||||
targetDocument.OuterXml);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,5 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.Web.Xdt" version="2.1.1" targetFramework="net45" />
|
||||
<package id="StyleCop.MSBuild" version="4.7.49.0" targetFramework="net45" developmentDependency="true" />
|
||||
</packages>
|
|
@ -0,0 +1,27 @@
|
|||
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<TelemetryModules xdt:Transform="InsertIfMissing">
|
||||
<Add xdt:Transform="InsertIfMissing" xdt:Locator="Match(Type)" Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector">
|
||||
<!--
|
||||
Use the following syntax here to collect additional performance counters:
|
||||
|
||||
<Counters>
|
||||
<Add PerformanceCounter="\Process(??APP_WIN32_PROC??)\Handle Count" ReportAs="Process handle count" />
|
||||
...
|
||||
</Counters>
|
||||
|
||||
PerformanceCounter must be either \CategoryName(InstanceName)\CounterName or \CategoryName\CounterName
|
||||
|
||||
Counter names may only contain letters, round brackets, forward slashes, hyphens, underscores, spaces and dots.
|
||||
You may provide an optional ReportAs attribute which will be used as the metric name when reporting counter data.
|
||||
For the purposes of reporting, metric names will be sanitized by removing all invalid characters from the resulting metric name.
|
||||
|
||||
NOTE: performance counters configuration will be lost upon NuGet upgrade.
|
||||
|
||||
The following placeholders are supported as InstanceName:
|
||||
??APP_WIN32_PROC?? - instance name of the application process for Win32 counters.
|
||||
??APP_W3SVC_PROC?? - instance name of the application IIS worker process for IIS/ASP.NET counters.
|
||||
??APP_CLR_PROC?? - instance name of the application CLR process for .NET counters.
|
||||
-->
|
||||
</Add>
|
||||
</TelemetryModules>
|
||||
</ApplicationInsights>
|
|
@ -0,0 +1,3 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
|
||||
</ApplicationInsights>
|
|
@ -0,0 +1,6 @@
|
|||
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings" xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<TelemetryModules>
|
||||
<Add xdt:Transform="Remove" xdt:Locator="Match(Type)" Type="Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.PerformanceCollectorModule, Microsoft.AI.PerfCounterCollector" />
|
||||
</TelemetryModules>
|
||||
<TelemetryModules xdt:Transform="Remove" xdt:Locator="Condition(count(*)=0)"/>
|
||||
</ApplicationInsights>
|
|
@ -0,0 +1,43 @@
|
|||
<?xml version="1.0"?>
|
||||
<package >
|
||||
<metadata>
|
||||
<id>Microsoft.ApplicationInsights.PerfCounterCollector</id>
|
||||
<version>$version$</version>
|
||||
<title>Application Insights Performance Counters Collector</title>
|
||||
<authors>Microsoft</authors>
|
||||
<owners>Microsoft</owners>
|
||||
<licenseUrl>http://go.microsoft.com/fwlink/?LinkID=391182</licenseUrl>
|
||||
<projectUrl>http://go.microsoft.com/fwlink/?LinkId=392727</projectUrl>
|
||||
<iconUrl>$image$</iconUrl>
|
||||
<requireLicenseAcceptance>true</requireLicenseAcceptance>
|
||||
<description>Application Insights Performance Counters Collector allows you to send data collected by Performance Counters to Application Insights.</description>
|
||||
<summary>Application Insights Performance Counters Collector is supported for .NET FX 4.0 and later.</summary>
|
||||
<copyright>$copyright$</copyright>
|
||||
<releaseNotes>For the release notes please follow http://go.microsoft.com/fwlink/?LinkId=535037</releaseNotes>
|
||||
<tags>Analytics ApplicationInsights Telemetry ASP.NET ASMX Web Azure Server Services ASPX Websites Performance Counters Performance Collection</tags>
|
||||
<dependencies>
|
||||
<group targetFramework="net40">
|
||||
<dependency id="Microsoft.ApplicationInsights" version="$coresdkversion$" />
|
||||
<dependency id="Microsoft.Diagnostics.Tracing.EventSource.Redist" version="1.1.24"/>
|
||||
</group>
|
||||
<group targetFramework="net45">
|
||||
<dependency id="Microsoft.ApplicationInsights" version="[$coresdkversion$]" />
|
||||
</group>
|
||||
</dependencies>
|
||||
</metadata>
|
||||
<files>
|
||||
<!-- Binaries for .NET 4.0 -->
|
||||
<file src="$configuration$\PerformanceCollector\Net40\Microsoft.AI.PerfCounterCollector.dll" target="lib\net40" />
|
||||
<file src="$configuration$\PerformanceCollector\Net40\Microsoft.AI.PerfCounterCollector.pdb" target="lib\net40" />
|
||||
|
||||
<!-- Binaries for .NET 4.5 -->
|
||||
<file src="$configuration$\PerformanceCollector\Net45\Microsoft.AI.PerfCounterCollector.dll" target="lib\net45" />
|
||||
<file src="$configuration$\PerformanceCollector\Net45\Microsoft.AI.PerfCounterCollector.pdb" target="lib\net45" />
|
||||
|
||||
<!-- XDT transformations -->
|
||||
<file src="$configuration$\PerformanceCollector\NuGet\ApplicationInsights.config.transform" target="content"/>
|
||||
<file src="$configuration$\PerformanceCollector\NuGet\ApplicationInsights.config.install.xdt" target="content"/>
|
||||
<file src="$configuration$\PerformanceCollector\NuGet\ApplicationInsights.config.uninstall.xdt" target="content"/>
|
||||
|
||||
</files>
|
||||
</package>
|
|
@ -0,0 +1,45 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'Global.props'))\Global.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{9392CF11-9063-4FC9-B8D1-922C754007D7}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<RootNamespace>Microsoft.ApplicationInsights.PerfCounterCollector.NuGet</RootNamespace>
|
||||
<AssemblyName>Microsoft.ApplicationInsights.PerfCounterCollector.NuGet</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<!-- Suppress the "CS2008: No source files specified" warning -->
|
||||
<NoWarn>2008</NoWarn>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
|
||||
<PackageSpecFile>$(MSBuildProjectDirectory)\Package.nuspec</PackageSpecFile>
|
||||
<PackageVersionFile>$(BinRoot)\$(Configuration)\PerformanceCollector\Net40\Microsoft.AI.PerfCounterCollector.dll</PackageVersionFile>
|
||||
<TargetFrameworkProfile />
|
||||
<NuGetPackageImportStamp>dd2813bf</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' " />
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<None Include="ApplicationInsights.config.transform">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="Package.nuspec">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
<None Include="ApplicationInsights.config.uninstall.xdt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
</None>
|
||||
<None Include="ApplicationInsights.config.install.xdt">
|
||||
<CopyToOutputDirectory>PreserveNewest</CopyToOutputDirectory>
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Net" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'Package.targets'))\Package.targets" />
|
||||
</Project>
|
|
@ -0,0 +1,11 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<configuration>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Diagnostics.Tracing.EventSource" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.1.16.0" newVersion="1.1.16.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
</configuration>
|
|
@ -0,0 +1,82 @@
|
|||
namespace PerfCounterCollector.FunctionalTests
|
||||
{
|
||||
using System.Linq;
|
||||
using Functional.Helpers;
|
||||
using Microsoft.Developer.Analytics.DataCollection.Model.v2;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
public class CommonTests
|
||||
{
|
||||
private const int TestListenerWaitTimeInMs = 30000;
|
||||
|
||||
public static void DefaultCounterCollection(HttpListenerObservable listener)
|
||||
{
|
||||
var counterItems = listener.ReceiveItemsOfType<TelemetryItem<PerformanceCounterData>>(10, TestListenerWaitTimeInMs);
|
||||
|
||||
AssertDefaultCounterReported(counterItems, "Memory", "Available Bytes");
|
||||
}
|
||||
|
||||
public static void CustomCounterCollection(HttpListenerObservable listener)
|
||||
{
|
||||
var counterItems = listener.ReceiveItemsOfType<TelemetryItem<MetricData>>(10, TestListenerWaitTimeInMs);
|
||||
|
||||
AssertCustomCounterReported(counterItems, "Custom counter one");
|
||||
AssertCustomCounterReported(counterItems, "Custom counter two");
|
||||
}
|
||||
|
||||
public static void NonExistentCounter(HttpListenerObservable listener)
|
||||
{
|
||||
var counterItems = listener.ReceiveItemsOfType<TelemetryItem<MetricData>>(10, TestListenerWaitTimeInMs);
|
||||
|
||||
AssertCustomCounterReported(counterItems, @"Custom counter - does not exist", false);
|
||||
}
|
||||
|
||||
public static void NonParsableCounter(HttpListenerObservable listener)
|
||||
{
|
||||
var counterItems = listener.ReceiveItemsOfType<TelemetryItem<MetricData>>(10, TestListenerWaitTimeInMs);
|
||||
|
||||
AssertCustomCounterReported(counterItems, @"Custom counter - will not parse", false);
|
||||
}
|
||||
|
||||
private static void AssertDefaultCounterReported(TelemetryItem[] counterItems, string categoryName, string counterName, bool reported = true)
|
||||
{
|
||||
bool counterReported = counterItems.Any(
|
||||
item =>
|
||||
{
|
||||
var perfData = item as TelemetryItem<PerformanceCounterData>;
|
||||
|
||||
return perfData != null && perfData.Data.BaseData.CategoryName == categoryName
|
||||
&& perfData.Data.BaseData.CounterName == counterName;
|
||||
});
|
||||
|
||||
if (reported)
|
||||
{
|
||||
Assert.IsTrue(counterReported);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.IsFalse(counterReported);
|
||||
}
|
||||
}
|
||||
|
||||
private static void AssertCustomCounterReported(TelemetryItem[] counterItems, string metricName, bool reported = true)
|
||||
{
|
||||
bool counterReported = counterItems.Any(
|
||||
item =>
|
||||
{
|
||||
var metricData = item as TelemetryItem<MetricData>;
|
||||
|
||||
return metricData != null && metricData.Data.BaseData.Metrics[0].Name == metricName;
|
||||
});
|
||||
|
||||
if (reported)
|
||||
{
|
||||
Assert.IsTrue(counterReported);
|
||||
}
|
||||
else
|
||||
{
|
||||
Assert.IsFalse(counterReported);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,176 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
|
||||
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildProjectDirectory), 'EnlistmentRoot.marker'))\Global.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProjectGuid>{D233F8EF-C4A8-49B1-8D60-58B32756C850}</ProjectGuid>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>PerfCollector.FunctionalTests</RootNamespace>
|
||||
<AssemblyName>PerfCollector.FunctionalTests</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
|
||||
<FileAlignment>512</FileAlignment>
|
||||
<ProjectTypeGuids>{3AC096D0-A1C2-E12C-1390-A8335801FDAB};{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}</ProjectTypeGuids>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
<ReferencePath>$(ProgramFiles)\Common Files\microsoft shared\VSTT\$(VisualStudioVersion)\UITestExtensionPackages</ReferencePath>
|
||||
<IsCodedUITest>False</IsCodedUITest>
|
||||
<TestProjectType>UnitTest</TestProjectType>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\</SolutionDir>
|
||||
<NuGetPackageImportStamp>39592d2f</NuGetPackageImportStamp>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
<UseVSHostingProcess>true</UseVSHostingProcess>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.ApplicationInsights.TelemetryTypes.DataPlatform.v1, Version=1.0.68.708, Culture=neutral, PublicKeyToken=f23a46de0be5d6f3, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.TelemetryTypes.DataPlatform.3.0.68-build00708\lib\net35\Microsoft.ApplicationInsights.TelemetryTypes.DataPlatform.v1.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationInsights.TelemetryTypes.DataPlatform.v2, Version=2.0.68.708, Culture=neutral, PublicKeyToken=f23a46de0be5d6f3, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.TelemetryTypes.DataPlatform.3.0.68-build00708\lib\net35\Microsoft.ApplicationInsights.TelemetryTypes.DataPlatform.v2.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationInsights.TelemetryTypes.DataPlatform.v3, Version=3.0.68.708, Culture=neutral, PublicKeyToken=f23a46de0be5d6f3, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\..\packages\Microsoft.ApplicationInsights.TelemetryTypes.DataPlatform.3.0.68-build00708\lib\net35\Microsoft.ApplicationInsights.TelemetryTypes.DataPlatform.v3.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Diagnostics.Tracing.TraceEvent, Version=1.0.29.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(PackagesDir)\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.29\lib\net40\Microsoft.Diagnostics.Tracing.TraceEvent.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(PackagesDir)\Newtonsoft.Json.6.0.5\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Reactive.Core">
|
||||
<HintPath>$(PackagesDir)\Rx-Core.2.1.30214.0\lib\Net45\System.Reactive.Core.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reactive.Interfaces">
|
||||
<HintPath>$(PackagesDir)\Rx-Interfaces.2.1.30214.0\lib\Net45\System.Reactive.Interfaces.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Reactive.Linq">
|
||||
<HintPath>$(PackagesDir)\Rx-Linq.2.1.30214.0\lib\Net45\System.Reactive.Linq.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.XmlTransform">
|
||||
<HintPath>$(PackagesDir)\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.XML" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="CommonTests.cs" />
|
||||
<Compile Include="Helpers\Debugger\ProcessBasicInformation.cs" />
|
||||
<Compile Include="Helpers\Debugger\ProcessCreationFlags.cs" />
|
||||
<Compile Include="Helpers\Debugger\ProcessInfo.cs" />
|
||||
<Compile Include="Helpers\Debugger\ProcessInfoClass.cs" />
|
||||
<Compile Include="Helpers\Debugger\ProcessInformation.cs" />
|
||||
<Compile Include="Helpers\Debugger\ProcessUtil.cs" />
|
||||
<Compile Include="Helpers\Debugger\SecurityAttributes.cs" />
|
||||
<Compile Include="Helpers\Debugger\StartupInfo.cs" />
|
||||
<Compile Include="Helpers\Debugger\VsDebugger.cs" />
|
||||
<Compile Include="Helpers\EtwEventSession.cs" />
|
||||
<Compile Include="Helpers\Extensions.cs" />
|
||||
<Compile Include="Helpers\HttpListenerObservable.cs" />
|
||||
<Compile Include="Helpers\ResponseCookiesExtension.cs" />
|
||||
<Compile Include="Test40.cs" />
|
||||
<Compile Include="TestBase\SingleWebHostTestBase.cs" />
|
||||
<Compile Include="Helpers\SingleWebHostTestConfiguration.cs" />
|
||||
<Compile Include="Serialization\TelemetryExtensions.cs" />
|
||||
<Compile Include="Helpers\CookieNames.cs" />
|
||||
<Compile Include="IisExpress\IISExpress.cs" />
|
||||
<Compile Include="IisExpress\IisExpressAppPools.cs" />
|
||||
<Compile Include="IisExpress\IisExpressConfiguration.cs" />
|
||||
<Compile Include="Serialization\TelemetryItemFactory.cs" />
|
||||
<Compile Include="Test45.cs" />
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<None Include="app.config" />
|
||||
<EmbeddedResource Include="IisExpress\applicationhost.config" />
|
||||
<None Include="IisExpress\HostConfigTransform.xdt" />
|
||||
<None Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<WCFMetadata Include="Service References\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<COMReference Include="EnvDTE">
|
||||
<Guid>{80CC9F66-E7D8-4DDD-85B6-D9E6CD0E93E2}</Guid>
|
||||
<VersionMajor>8</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
<COMReference Include="EnvDTE80">
|
||||
<Guid>{1A31287A-4D7D-413E-8E32-3B374931BD89}</Guid>
|
||||
<VersionMajor>8</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
<COMReference Include="stdole">
|
||||
<Guid>{00020430-0000-0000-C000-000000000046}</Guid>
|
||||
<VersionMajor>2</VersionMajor>
|
||||
<VersionMinor>0</VersionMinor>
|
||||
<Lcid>0</Lcid>
|
||||
<WrapperTool>primary</WrapperTool>
|
||||
<Isolated>False</Isolated>
|
||||
<EmbedInteropTypes>True</EmbedInteropTypes>
|
||||
</COMReference>
|
||||
</ItemGroup>
|
||||
<Choose>
|
||||
<When Condition="'$(VisualStudioVersion)' == '10.0' And '$(IsCodedUITest)' == 'True'">
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.CodedUITestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Common, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITest.Extension, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.TestTools.UITesting, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<Private>False</Private>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
</When>
|
||||
</Choose>
|
||||
<Import Project="$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets" Condition="Exists('$(VSToolsPath)\TeamTest\Microsoft.TestTools.targets')" />
|
||||
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
|
||||
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
|
||||
<PropertyGroup>
|
||||
<ErrorText>This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}.</ErrorText>
|
||||
</PropertyGroup>
|
||||
<Error Condition="!Exists('$(PackagesDir)\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.29\build\Microsoft.Diagnostics.Tracing.TraceEvent.targets')" Text="$([System.String]::Format('$(ErrorText)', '$(PackagesDir)\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.29\build\Microsoft.Diagnostics.Tracing.TraceEvent.targets'))" />
|
||||
</Target>
|
||||
<Import Project="$(PackagesDir)\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.29\build\Microsoft.Diagnostics.Tracing.TraceEvent.targets" Condition="Exists('$(PackagesDir)\Microsoft.Diagnostics.Tracing.TraceEvent.1.0.29\build\Microsoft.Diagnostics.Tracing.TraceEvent.targets')" />
|
||||
</Project>
|
|
@ -0,0 +1,15 @@
|
|||
namespace Functional.Helpers
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public class CookieNames
|
||||
{
|
||||
public const string UserCookie = "ai_user";
|
||||
|
||||
public const string SessionCookie = "ai_session";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="ProcessBasicInformation.cs" company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// <author>Sergei Nikitin: sergeyni@microsoft.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Functional.Helpers.Debugger
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
/// <summary>
|
||||
/// Represents PROCESS_BASIC_INFORMATION ntdll structure
|
||||
/// </summary>
|
||||
[StructLayout(LayoutKind.Sequential, Pack = 1)]
|
||||
public struct ProcessBasicInformation
|
||||
{
|
||||
public IntPtr ExitStatus;
|
||||
public IntPtr PebBaseAddress;
|
||||
public IntPtr AffinityMask;
|
||||
public IntPtr BasePriority;
|
||||
public UIntPtr UniqueProcessId;
|
||||
public IntPtr InheritedFromUniqueProcessId;
|
||||
|
||||
public int Size
|
||||
{
|
||||
get { return Marshal.SizeOf(typeof(ProcessBasicInformation)); }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,45 @@
|
|||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="ProcessCreationFlags.cs" company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// <author>Sergei Nikitin: sergeyni@microsoft.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
namespace Functional.Helpers.Debugger
|
||||
{
|
||||
using System;
|
||||
|
||||
[Flags]
|
||||
public enum ProcessCreationFlags : uint
|
||||
{
|
||||
DEBUG_PROCESS = 0x00000001,
|
||||
DEBUG_ONLY_THIS_PROCESS = 0x00000002,
|
||||
CREATE_SUSPENDED = 0x00000004,
|
||||
DETACHED_PROCESS = 0x00000008,
|
||||
CREATE_NEW_CONSOLE = 0x00000010,
|
||||
NORMAL_PRIORITY_CLASS = 0x00000020,
|
||||
IDLE_PRIORITY_CLASS = 0x00000040,
|
||||
HIGH_PRIORITY_CLASS = 0x00000080,
|
||||
REALTIME_PRIORITY_CLASS = 0x00000100,
|
||||
CREATE_NEW_PROCESS_GROUP = 0x00000200,
|
||||
CREATE_UNICODE_ENVIRONMENT = 0x00000400,
|
||||
CREATE_SEPARATE_WOW_VDM = 0x00000800,
|
||||
CREATE_SHARED_WOW_VDM = 0x00001000,
|
||||
CREATE_FORCEDOS = 0x00002000,
|
||||
BELOW_NORMAL_PRIORITY_CLASS = 0x00004000,
|
||||
ABOVE_NORMAL_PRIORITY_CLASS = 0x00008000,
|
||||
INHERIT_PARENT_AFFINITY = 0x00010000,
|
||||
INHERIT_CALLER_PRIORITY = 0x00020000,
|
||||
CREATE_PROTECTED_PROCESS = 0x00040000,
|
||||
EXTENDED_STARTUPINFO_PRESENT = 0x00080000,
|
||||
PROCESS_MODE_BACKGROUND_BEGIN = 0x00100000,
|
||||
PROCESS_MODE_BACKGROUND_END = 0x00200000,
|
||||
CREATE_BREAKAWAY_FROM_JOB = 0x01000000,
|
||||
CREATE_PRESERVE_CODE_AUTHZ_LEVEL = 0x02000000,
|
||||
CREATE_DEFAULT_ERROR_MODE = 0x04000000,
|
||||
CREATE_NO_WINDOW = 0x08000000,
|
||||
PROFILE_USER = 0x10000000,
|
||||
PROFILE_KERNEL = 0x20000000,
|
||||
PROFILE_SERVER = 0x40000000,
|
||||
CREATE_IGNORE_SYSTEM_DEFAULT = 0x80000000,
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="ProcessInfo.cs" company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// <author>Sergei Nikitin: sergeyni@microsoft.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
namespace Functional.Helpers.Debugger
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
|
||||
/// <summary>
|
||||
/// Represents extended process information
|
||||
/// </summary>
|
||||
public class ProcessInfo
|
||||
{
|
||||
private readonly Process ps;
|
||||
private readonly SafeWaitHandle mainThreadHandle;
|
||||
|
||||
public ProcessInfo(
|
||||
Process ps,
|
||||
ProcessInformation psi)
|
||||
{
|
||||
if (null == ps)
|
||||
{
|
||||
throw new ArgumentNullException("ps");
|
||||
}
|
||||
|
||||
this.ps = ps;
|
||||
this.mainThreadHandle = new SafeWaitHandle(
|
||||
psi.hThread,
|
||||
true);
|
||||
}
|
||||
|
||||
public SafeWaitHandle MainThreadHandle
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.mainThreadHandle;
|
||||
}
|
||||
}
|
||||
|
||||
public Process Process
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.ps;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,73 @@
|
|||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="ProcessInfoClass.cs" company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// <author>Sergei Nikitin: sergeyni@microsoft.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
namespace Functional.Helpers.Debugger
|
||||
{
|
||||
/// <summary>
|
||||
/// Represents PROCESSINFOCLASS ntdll structure
|
||||
/// </summary>
|
||||
public enum ProcessInfoClass
|
||||
{
|
||||
ProcessBasicInformation = 0, // 0, q: PROCESS_BASIC_INFORMATION, PROCESS_EXTENDED_BASIC_INFORMATION
|
||||
ProcessQuotaLimits, // qs: QUOTA_LIMITS, QUOTA_LIMITS_EX
|
||||
ProcessIoCounters, // q: IO_COUNTERS
|
||||
ProcessVmCounters, // q: VM_COUNTERS, VM_COUNTERS_EX
|
||||
ProcessTimes, // q: KERNEL_USER_TIMES
|
||||
ProcessBasePriority, // s: KPRIORITY
|
||||
ProcessRaisePriority, // s: ULONG
|
||||
ProcessDebugPort, // q: HANDLE
|
||||
ProcessExceptionPort, // s: HANDLE
|
||||
ProcessAccessToken, // s: PROCESS_ACCESS_TOKEN
|
||||
ProcessLdtInformation, // 10
|
||||
ProcessLdtSize,
|
||||
ProcessDefaultHardErrorMode, // qs: ULONG
|
||||
ProcessIoPortHandlers, // (kernel-mode only)
|
||||
ProcessPooledUsageAndLimits, // q: POOLED_USAGE_AND_LIMITS
|
||||
ProcessWorkingSetWatch, // q: PROCESS_WS_WATCH_INFORMATION[]; s: void
|
||||
ProcessUserModeIOPL,
|
||||
ProcessEnableAlignmentFaultFixup, // s: BOOLEAN
|
||||
ProcessPriorityClass, // qs: PROCESS_PRIORITY_CLASS
|
||||
ProcessWx86Information,
|
||||
ProcessHandleCount, // 20, q: ULONG, PROCESS_HANDLE_INFORMATION
|
||||
ProcessAffinityMask, // s: KAFFINITY
|
||||
ProcessPriorityBoost, // qs: ULONG
|
||||
ProcessDeviceMap, // qs: PROCESS_DEVICEMAP_INFORMATION, PROCESS_DEVICEMAP_INFORMATION_EX
|
||||
ProcessSessionInformation, // q: PROCESS_SESSION_INFORMATION
|
||||
ProcessForegroundInformation, // s: PROCESS_FOREGROUND_BACKGROUND
|
||||
ProcessWow64Information, // q: ULONG_PTR
|
||||
ProcessImageFileName, // q: UNICODE_STRING
|
||||
ProcessLUIDDeviceMapsEnabled, // q: ULONG
|
||||
ProcessBreakOnTermination, // qs: ULONG
|
||||
ProcessDebugObjectHandle, // 30, q: HANDLE
|
||||
ProcessDebugFlags, // qs: ULONG
|
||||
ProcessHandleTracing, // q: PROCESS_HANDLE_TRACING_QUERY; s: size 0 disables, otherwise enables
|
||||
ProcessIoPriority, // qs: ULONG
|
||||
ProcessExecuteFlags, // qs: ULONG
|
||||
ProcessResourceManagement,
|
||||
ProcessCookie, // q: ULONG
|
||||
ProcessImageInformation, // q: SECTION_IMAGE_INFORMATION
|
||||
ProcessCycleTime, // q: PROCESS_CYCLE_TIME_INFORMATION
|
||||
ProcessPagePriority, // q: ULONG
|
||||
ProcessInstrumentationCallback, // 40
|
||||
ProcessThreadStackAllocation, // s: PROCESS_STACK_ALLOCATION_INFORMATION, PROCESS_STACK_ALLOCATION_INFORMATION_EX
|
||||
ProcessWorkingSetWatchEx, // q: PROCESS_WS_WATCH_INFORMATION_EX[]
|
||||
ProcessImageFileNameWin32, // q: UNICODE_STRING
|
||||
ProcessImageFileMapping, // q: HANDLE (input)
|
||||
ProcessAffinityUpdateMode, // qs: PROCESS_AFFINITY_UPDATE_MODE
|
||||
ProcessMemoryAllocationMode, // qs: PROCESS_MEMORY_ALLOCATION_MODE
|
||||
ProcessGroupInformation, // q: USHORT[]
|
||||
ProcessTokenVirtualizationEnabled, // s: ULONG
|
||||
ProcessConsoleHostProcess, // q: ULONG_PTR
|
||||
ProcessWindowInformation, // 50, q: PROCESS_WINDOW_INFORMATION
|
||||
ProcessHandleInformation, // q: PROCESS_HANDLE_SNAPSHOT_INFORMATION // since WIN8
|
||||
ProcessMitigationPolicy, // s: PROCESS_MITIGATION_POLICY_INFORMATION
|
||||
ProcessDynamicFunctionTableInformation,
|
||||
ProcessHandleCheckingMode,
|
||||
ProcessKeepAliveCount, // q: PROCESS_KEEPALIVE_COUNT_INFORMATION
|
||||
ProcessRevokeFileHandles, // s: PROCESS_REVOKE_FILE_HANDLES_INFORMATION
|
||||
MaxProcessInfoClass
|
||||
}
|
||||
}
|
|
@ -0,0 +1,26 @@
|
|||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="ProcessInformation.cs" company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// <author>Sergei Nikitin: sergeyni@microsoft.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Functional.Helpers.Debugger
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct ProcessInformation
|
||||
{
|
||||
public IntPtr hProcess;
|
||||
public IntPtr hThread;
|
||||
public int dwProcessId;
|
||||
public int dwThreadId;
|
||||
|
||||
public int Size
|
||||
{
|
||||
get { return Marshal.SizeOf(typeof(ProcessInformation)); }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,197 @@
|
|||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="ProcessUtil.cs" company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// <author>Sergei Nikitin: sergeyni@microsoft.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Functional.Helpers.Debugger
|
||||
{
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
using Microsoft.Win32.SafeHandles;
|
||||
|
||||
/// <summary>
|
||||
/// Process utils
|
||||
/// </summary>
|
||||
public static class ProcessUtil
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets the parent process of a specified process.
|
||||
/// </summary>
|
||||
/// <param name="ps">The process object</param>
|
||||
/// <returns>An instance of the Process class.</returns>
|
||||
public static Process GetParentProcess(this Process ps)
|
||||
{
|
||||
if (null == ps)
|
||||
{
|
||||
throw new ArgumentNullException("ps");
|
||||
}
|
||||
|
||||
return ps.Handle.GetParentProcess();
|
||||
}
|
||||
|
||||
public static Process FindParent(
|
||||
this Process ps,
|
||||
Func<Process, bool> pred)
|
||||
{
|
||||
if (null == ps)
|
||||
{
|
||||
throw new ArgumentNullException("ps");
|
||||
}
|
||||
|
||||
if (null == pred)
|
||||
{
|
||||
throw new ArgumentNullException("pred");
|
||||
}
|
||||
|
||||
var parent = ps;
|
||||
while (true)
|
||||
{
|
||||
parent = parent.Handle.GetParentProcess();
|
||||
if (null != parent)
|
||||
{
|
||||
if (true != pred(parent))
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
return parent;
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the parent process of a specified process.
|
||||
/// </summary>
|
||||
/// <param name="ps">The process object</param>
|
||||
/// <param name="strProcessName">Parent process name</param>
|
||||
/// <returns>An instance of the Process class.</returns>
|
||||
public static Process FindParentByName(
|
||||
this Process ps,
|
||||
string strProcessName)
|
||||
{
|
||||
if (null == ps)
|
||||
{
|
||||
throw new ArgumentNullException("ps");
|
||||
}
|
||||
|
||||
if (true == string.IsNullOrWhiteSpace(strProcessName))
|
||||
{
|
||||
throw new ArgumentNullException("strProcessName");
|
||||
}
|
||||
|
||||
return ps.FindParent(
|
||||
parent => parent.ProcessName.Equals(
|
||||
strProcessName,
|
||||
StringComparison.OrdinalIgnoreCase));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets the parent process of a specified process.
|
||||
/// </summary>
|
||||
/// <param name="handle">The process handle.</param>
|
||||
/// <returns>An instance of the Process class.</returns>
|
||||
public static Process GetParentProcess(this IntPtr handle)
|
||||
{
|
||||
var pbi = new ProcessBasicInformation();
|
||||
var returnLength = 0;
|
||||
|
||||
var status = NtQueryInformationProcess(
|
||||
handle,
|
||||
0,
|
||||
ref pbi,
|
||||
pbi.Size,
|
||||
out returnLength);
|
||||
|
||||
if (status != 0)
|
||||
{
|
||||
throw new Win32Exception(status);
|
||||
}
|
||||
|
||||
try
|
||||
{
|
||||
return Process.GetProcessById(
|
||||
pbi.InheritedFromUniqueProcessId.ToInt32());
|
||||
}
|
||||
catch (ArgumentException)
|
||||
{
|
||||
// not found
|
||||
return null;
|
||||
}
|
||||
}
|
||||
|
||||
public static ProcessInfo Create(
|
||||
string applicationName,
|
||||
string arguments)
|
||||
{
|
||||
var startupInfo = new StartupInfo();
|
||||
var sec = new SecurityAttributes();
|
||||
sec.nLength = sec.Size;
|
||||
ProcessInformation processInfo;
|
||||
|
||||
const ProcessCreationFlags CreateFlags =
|
||||
ProcessCreationFlags.CREATE_NO_WINDOW
|
||||
| ProcessCreationFlags.CREATE_SUSPENDED;
|
||||
|
||||
if (true == CreateProcess(
|
||||
applicationName,
|
||||
arguments,
|
||||
ref sec,
|
||||
ref sec,
|
||||
false,
|
||||
(uint)CreateFlags,
|
||||
IntPtr.Zero,
|
||||
null,
|
||||
ref startupInfo,
|
||||
out processInfo))
|
||||
{
|
||||
|
||||
return new ProcessInfo(
|
||||
Process.GetProcessById(processInfo.dwProcessId),
|
||||
processInfo);
|
||||
}
|
||||
|
||||
return null;
|
||||
}
|
||||
|
||||
public static void Resume(this ProcessInfo ps)
|
||||
{
|
||||
ResumeThread(ps.MainThreadHandle.DangerousGetHandle());
|
||||
}
|
||||
|
||||
[DllImport("ntdll.dll", SetLastError = true)]
|
||||
private static extern int NtQueryInformationProcess(
|
||||
IntPtr processHandle,
|
||||
int processInformationClass,
|
||||
ref ProcessBasicInformation processInformation,
|
||||
int processInformationLength,
|
||||
out int returnLength);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
private static extern bool CreateProcess(
|
||||
string lpApplicationName,
|
||||
string lpCommandLine,
|
||||
ref SecurityAttributes lpProcessAttributes,
|
||||
ref SecurityAttributes lpThreadAttributes,
|
||||
bool bInheritHandles,
|
||||
uint dwCreationFlags,
|
||||
IntPtr lpEnvironment,
|
||||
string lpCurrentDirectory,
|
||||
[In] ref StartupInfo lpStartupInfo,
|
||||
out ProcessInformation lpProcessInformation);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
private static extern int SuspendThread(IntPtr hThread);
|
||||
|
||||
[DllImport("kernel32.dll", SetLastError = true)]
|
||||
private static extern uint ResumeThread(IntPtr hThread);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,25 @@
|
|||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="SecurityAttributes.cs" company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// <author>Sergei Nikitin: sergeyni@microsoft.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Functional.Helpers.Debugger
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential)]
|
||||
public struct SecurityAttributes
|
||||
{
|
||||
public int nLength;
|
||||
public IntPtr lpSecurityDescriptor;
|
||||
public int bInheritHandle;
|
||||
|
||||
public int Size
|
||||
{
|
||||
get { return Marshal.SizeOf(typeof(SecurityAttributes)); }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,39 @@
|
|||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="StartupInfo.cs" company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// <author>Sergei Nikitin: sergeyni@microsoft.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
namespace Functional.Helpers.Debugger
|
||||
{
|
||||
using System;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
[StructLayout(LayoutKind.Sequential, CharSet = CharSet.Unicode)]
|
||||
public struct StartupInfo
|
||||
{
|
||||
public int cb;
|
||||
public string lpReserved;
|
||||
public string lpDesktop;
|
||||
public string lpTitle;
|
||||
public int dwX;
|
||||
public int dwY;
|
||||
public int dwXSize;
|
||||
public int dwYSize;
|
||||
public int dwXCountChars;
|
||||
public int dwYCountChars;
|
||||
public int dwFillAttribute;
|
||||
public int dwFlags;
|
||||
public short wShowWindow;
|
||||
public short cbReserved2;
|
||||
public IntPtr lpReserved2;
|
||||
public IntPtr hStdInput;
|
||||
public IntPtr hStdOutput;
|
||||
public IntPtr hStdError;
|
||||
|
||||
public int Size
|
||||
{
|
||||
get { return Marshal.SizeOf(typeof(StartupInfo)); }
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="VsDebugger.cs" company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// <author>Sergei Nikitin: sergeyni@microsoft.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Functional.Helpers.Debugger
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Runtime.InteropServices.ComTypes;
|
||||
|
||||
|
||||
public static class VsDebugger
|
||||
{
|
||||
/// <summary>
|
||||
/// Attaches managed Visual Studio debugger to the target process
|
||||
/// </summary>
|
||||
/// <param name="visualStudioProcess">Visual studio process object</param>
|
||||
/// <param name="applicationProcess">Application process object</param>
|
||||
public static void AttachManagedTo(
|
||||
this Process visualStudioProcess,
|
||||
Process applicationProcess)
|
||||
{
|
||||
var engines = new[] { "Managed" };
|
||||
AttachTo(visualStudioProcess, applicationProcess, engines);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attaches managed and native Visual Studio debuggers to the target process
|
||||
/// </summary>
|
||||
/// <param name="visualStudioProcess">Visual studio process object</param>
|
||||
/// <param name="applicationProcess">Application process object</param>
|
||||
public static void AttachMixedTo(
|
||||
this Process visualStudioProcess,
|
||||
Process applicationProcess)
|
||||
{
|
||||
var engines = new[] { "Managed", "Native" };
|
||||
AttachTo(visualStudioProcess, applicationProcess, engines);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Attaches Visual Studio debugger to the target process
|
||||
/// </summary>
|
||||
/// <param name="visualStudioProcess">Visual studio process object</param>
|
||||
/// <param name="applicationProcess">Application process object</param>
|
||||
/// <param name="engines">List of debug engines to use</param>
|
||||
private static void AttachTo(
|
||||
this Process visualStudioProcess,
|
||||
Process applicationProcess,
|
||||
string[] engines)
|
||||
{
|
||||
EnvDTE._DTE visualStudioInstance;
|
||||
|
||||
if (true == TryGetVsInstance(visualStudioProcess.Id, out visualStudioInstance))
|
||||
{
|
||||
var processToAttachTo =
|
||||
visualStudioInstance.Debugger.LocalProcesses
|
||||
.Cast<EnvDTE80.Process2>()
|
||||
.FirstOrDefault(
|
||||
process => process.ProcessID == applicationProcess.Id);
|
||||
|
||||
if (null != processToAttachTo)
|
||||
{
|
||||
processToAttachTo.Attach2(engines);
|
||||
}
|
||||
else
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Visual Studio process cannot find specified application '" + applicationProcess.Id + "'");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
private static bool TryGetVsInstance(int processId, out EnvDTE._DTE instance)
|
||||
{
|
||||
var numFetched = IntPtr.Zero;
|
||||
IRunningObjectTable runningObjectTable;
|
||||
IEnumMoniker monikerEnumerator;
|
||||
var monikers = new IMoniker[1];
|
||||
|
||||
GetRunningObjectTable(0, out runningObjectTable);
|
||||
runningObjectTable.EnumRunning(out monikerEnumerator);
|
||||
monikerEnumerator.Reset();
|
||||
|
||||
while (0 == monikerEnumerator.Next(1, monikers, numFetched))
|
||||
{
|
||||
IBindCtx ctx;
|
||||
CreateBindCtx(0, out ctx);
|
||||
|
||||
string runningObjectName;
|
||||
monikers[0].GetDisplayName(ctx, null, out runningObjectName);
|
||||
|
||||
object runningObjectVal;
|
||||
runningObjectTable.GetObject(monikers[0], out runningObjectVal);
|
||||
|
||||
if (runningObjectVal is EnvDTE._DTE && runningObjectName.StartsWith("!VisualStudio"))
|
||||
{
|
||||
int currentProcessId = int.Parse(runningObjectName.Split(':')[1]);
|
||||
|
||||
if (currentProcessId == processId)
|
||||
{
|
||||
instance = (EnvDTE._DTE)runningObjectVal;
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
instance = null;
|
||||
return false;
|
||||
}
|
||||
|
||||
[DllImport("ole32.dll")]
|
||||
private static extern int CreateBindCtx(int reserved, out IBindCtx ppbc);
|
||||
|
||||
[DllImport("ole32.dll")]
|
||||
private static extern int GetRunningObjectTable(int reserved, out IRunningObjectTable prot);
|
||||
}
|
||||
}
|
|
@ -0,0 +1,161 @@
|
|||
namespace Functional.Helpers
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Threading.Tasks;
|
||||
using Microsoft.Diagnostics.Tracing;
|
||||
using Microsoft.Diagnostics.Tracing.Session;
|
||||
|
||||
public class EtwEventSession : IDisposable
|
||||
{
|
||||
private readonly string[] providers =
|
||||
{
|
||||
"Microsoft-ApplicationInsights-Extensibility-Web",
|
||||
"Microsoft-ApplicationInsights-Extensibility-DependencyCollector",
|
||||
"Microsoft-ApplicationInsights-Core",
|
||||
};
|
||||
|
||||
private const string SessionName = "RequestTelemetryFunctionalTest";
|
||||
|
||||
private TraceEventSession session;
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (!(TraceEventSession.IsElevated() ?? false))
|
||||
{
|
||||
Trace.WriteLine(
|
||||
"WARNING! To turn on ETW events you need to be Administrator, please run from an Admin process.");
|
||||
return;
|
||||
}
|
||||
|
||||
// Same session name is reused to prevent multiple orphaned sessions in case if dispose is not done when test stopped in debug
|
||||
// Important! Note that session can leave longer that the process and it is important to dispose it
|
||||
session = new TraceEventSession(SessionName, null);
|
||||
foreach (var provider in this.providers)
|
||||
{
|
||||
this.session.EnableProvider(provider);
|
||||
}
|
||||
this.session.StopOnDispose = true;
|
||||
|
||||
this.session.Source.Dynamic.All += Process;
|
||||
this.session.Source.UnhandledEvents += Process;
|
||||
|
||||
Task.Run(() =>
|
||||
{
|
||||
// Blocking call. Will end when session is disposed
|
||||
this.session.Source.Process();
|
||||
});
|
||||
|
||||
this.FailureDetected = false;
|
||||
Trace.WriteLine("Etw session started");
|
||||
}
|
||||
|
||||
public bool FailureDetected { get; set; }
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
this.Dispose();
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (this.session != null)
|
||||
{
|
||||
this.session.Dispose();
|
||||
this.session = null;
|
||||
}
|
||||
|
||||
Trace.WriteLine("Etw session stopped");
|
||||
}
|
||||
|
||||
private void Process(TraceEvent data)
|
||||
{
|
||||
Trace.WriteLine(string.Format(
|
||||
"Application Trace. Level: {0}; Id: {1}; Message: {2}; ",
|
||||
data.Level,
|
||||
data.ID,
|
||||
data.FormattedMessage));
|
||||
|
||||
this.TestAppDomainNameIsTheLastPayloadParameter(data);
|
||||
|
||||
this.TestTraceLevelIsNotErrorOrCritical(data);
|
||||
}
|
||||
|
||||
private void TestAppDomainNameIsTheLastPayloadParameter(TraceEvent data)
|
||||
{
|
||||
if (data.PayloadNames.Length > 0)
|
||||
{
|
||||
int id = (int) data.ID;
|
||||
|
||||
// Not system event
|
||||
if ((id > 0) && (id < 65534))
|
||||
{
|
||||
string domainName = data.PayloadString(data.PayloadNames.Length - 1);
|
||||
bool correctName = TraceAssert.IsTrue(
|
||||
domainName.StartsWith("/LM/W3SVC"),
|
||||
"Every message must have application name as the last parameter to enable StatusMonitor integration: " +
|
||||
domainName);
|
||||
|
||||
this.FailureDetected = !correctName || this.FailureDetected;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
TraceAssert.IsTrue(false, "Trace must have at least 1 parameter - appDomain name");
|
||||
this.FailureDetected = true;
|
||||
}
|
||||
}
|
||||
|
||||
private void TestTraceLevelIsNotErrorOrCritical(TraceEvent data)
|
||||
{
|
||||
this.FailureDetected =
|
||||
!TraceAssert.AreNotEqual(data.Level, TraceEventLevel.Error, data.FormattedMessage)
|
||||
|| this.FailureDetected;
|
||||
this.FailureDetected =
|
||||
!TraceAssert.AreNotEqual(data.Level, TraceEventLevel.Critical, data.FormattedMessage)
|
||||
|| this.FailureDetected;
|
||||
}
|
||||
|
||||
private static class TraceAssert
|
||||
{
|
||||
public static bool AreEqual<T>(T expected, T actual, string message) where T : IComparable
|
||||
{
|
||||
if (actual.CompareTo(expected) != 0)
|
||||
{
|
||||
Trace(expected, actual, message);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool AreNotEqual<T>(T expected, T actual, string message) where T : IComparable
|
||||
{
|
||||
if (actual.CompareTo(expected) == 0)
|
||||
{
|
||||
Trace(expected, actual, message);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public static bool IsTrue(bool condition, string message)
|
||||
{
|
||||
if (!condition)
|
||||
{
|
||||
System.Diagnostics.Trace.WriteLine("ERROR! " + message);
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static void Trace<T>(T expected, T actual, string message) where T : IComparable
|
||||
{
|
||||
string assert = string.Format("Expected: {0}; Actual: {1}; Message: {2}", expected, actual, message);
|
||||
System.Diagnostics.Trace.WriteLine("ERROR! " + assert);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,60 @@
|
|||
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
|
||||
namespace FunctionalTests.Helpers
|
||||
{
|
||||
/// <summary>
|
||||
/// Helper extensions
|
||||
/// </summary>
|
||||
public static class Extensions
|
||||
{
|
||||
/// <summary>
|
||||
/// Gets content of the body for HttpListner request
|
||||
/// </summary>
|
||||
/// <param name="request"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetContent(this HttpListenerRequest request)
|
||||
{
|
||||
var result = string.Empty;
|
||||
|
||||
if (request.HasEntityBody)
|
||||
{
|
||||
using (var requestInputStream = request.InputStream)
|
||||
{
|
||||
var encoding = request.ContentEncoding;
|
||||
using (var reader = new StreamReader(requestInputStream, encoding))
|
||||
{
|
||||
result = reader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Gets content of the body for Http Web Response
|
||||
/// </summary>
|
||||
/// <param name="response"></param>
|
||||
/// <returns></returns>
|
||||
public static string GetContent(this WebResponse response)
|
||||
{
|
||||
var result = string.Empty;
|
||||
|
||||
using (var requestInputStream = response.GetResponseStream())
|
||||
{
|
||||
if (requestInputStream != null)
|
||||
{
|
||||
using (var reader = new StreamReader(requestInputStream, Encoding.Default))
|
||||
{
|
||||
result = reader.ReadToEnd();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,143 @@
|
|||
namespace Functional.Helpers
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.IO.Compression;
|
||||
using System.Net;
|
||||
using System.Reactive.Linq;
|
||||
using System.Reactive.Threading.Tasks;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
using Functional.Serialization;
|
||||
using FunctionalTests.Helpers;
|
||||
using Microsoft.Developer.Analytics.DataCollection.Model.v2;
|
||||
|
||||
public class HttpListenerObservable : IObservable<TelemetryItem>, IDisposable
|
||||
{
|
||||
private readonly HttpListener listener;
|
||||
private IObservable<TelemetryItem> stream;
|
||||
|
||||
public HttpListenerObservable(string url)
|
||||
{
|
||||
this.listener = new HttpListener();
|
||||
this.listener.Prefixes.Add(url);
|
||||
}
|
||||
|
||||
public void Start()
|
||||
{
|
||||
if (this.stream != null)
|
||||
{
|
||||
this.Stop();
|
||||
}
|
||||
|
||||
if (!this.listener.IsListening)
|
||||
{
|
||||
this.listener.Start();
|
||||
}
|
||||
|
||||
this.stream = this.CreateStream();
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
this.Dispose();
|
||||
}
|
||||
|
||||
public IDisposable Subscribe(IObserver<TelemetryItem> observer)
|
||||
{
|
||||
if (this.stream == null)
|
||||
{
|
||||
throw new InvalidOperationException("Call HttpListenerObservable.Start before subscribing to the stream");
|
||||
}
|
||||
|
||||
return this.stream
|
||||
.Subscribe(observer);
|
||||
}
|
||||
|
||||
public void Dispose()
|
||||
{
|
||||
if (listener != null && listener.IsListening)
|
||||
{
|
||||
listener.Stop();
|
||||
listener.Close();
|
||||
this.stream = null;
|
||||
}
|
||||
}
|
||||
|
||||
private IObservable<TelemetryItem> CreateStream()
|
||||
{
|
||||
return Observable
|
||||
.Create<TelemetryItem>
|
||||
(obs =>
|
||||
Task.Factory.FromAsync(
|
||||
(a, c) => this.listener.BeginGetContext(a, c),
|
||||
ar => this.listener.EndGetContext(ar),
|
||||
null)
|
||||
.ToObservable()
|
||||
.SelectMany(this.CreateNewItemsFromContext)
|
||||
.Subscribe(obs)
|
||||
)
|
||||
.Repeat()
|
||||
.Publish()
|
||||
.RefCount();
|
||||
}
|
||||
|
||||
private IEnumerable<TelemetryItem> CreateNewItemsFromContext(HttpListenerContext context)
|
||||
{
|
||||
try
|
||||
{
|
||||
var request = context.Request;
|
||||
var content = request.GetContent();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(request.Headers["Content-Encoding"]) &&
|
||||
string.Equals("gzip", request.Headers["Content-Encoding"],
|
||||
StringComparison.InvariantCultureIgnoreCase))
|
||||
{
|
||||
content = Decompress(content);
|
||||
}
|
||||
|
||||
Trace.WriteLine("=>");
|
||||
Trace.WriteLine("Item received: " + content);
|
||||
Trace.WriteLine("<=");
|
||||
|
||||
return TelemetryItemFactory.GetTelemetryItems(content);
|
||||
}
|
||||
finally
|
||||
{
|
||||
context.Response.Close();
|
||||
}
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Decompresses content in gzip and returns decompressed string
|
||||
/// </summary>
|
||||
/// <param name="content"></param>
|
||||
/// <returns></returns>
|
||||
private static string Decompress(string content)
|
||||
{
|
||||
var zippedData = Encoding.Default.GetBytes(content);
|
||||
using (var ms = new MemoryStream(zippedData))
|
||||
{
|
||||
using (var compressedzipStream = new GZipStream(ms, CompressionMode.Decompress))
|
||||
{
|
||||
var outputStream = new MemoryStream();
|
||||
var block = new byte[1024];
|
||||
while (true)
|
||||
{
|
||||
int bytesRead = compressedzipStream.Read(block, 0, block.Length);
|
||||
if (bytesRead <= 0)
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
outputStream.Write(block, 0, bytesRead);
|
||||
}
|
||||
compressedzipStream.Close();
|
||||
return Encoding.UTF8.GetString(outputStream.ToArray());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,49 @@
|
|||
namespace Functional.Helpers
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Text;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public static class ResponseCookiesExtension
|
||||
{
|
||||
private const string userCookieKey = "ai_user";
|
||||
private const string sessionCookieKey = "ai_session";
|
||||
|
||||
/// <summary>
|
||||
/// Returns the user cookie string from the total available set of cookies
|
||||
/// </summary>
|
||||
public static string ReceiveUserCookie(this CookieCollection responseCookies)
|
||||
{
|
||||
var enumerator = responseCookies.GetEnumerator();
|
||||
string userCookie = string.Empty;
|
||||
foreach(Cookie cookie in responseCookies)
|
||||
{
|
||||
if (cookie.Name.Equals(userCookieKey))
|
||||
{
|
||||
userCookie = cookie.Value;
|
||||
}
|
||||
}
|
||||
return userCookie;
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Returns the session cookie string from the total available set of cookies
|
||||
/// </summary>
|
||||
public static string ReceiveSessionCookie(this CookieCollection responseCookies)
|
||||
{
|
||||
var enumerator = responseCookies.GetEnumerator();
|
||||
string sessionCookie = string.Empty;
|
||||
foreach (Cookie cookie in responseCookies)
|
||||
{
|
||||
if (cookie.Name.Equals(sessionCookieKey))
|
||||
{
|
||||
sessionCookie = cookie.Value;
|
||||
}
|
||||
}
|
||||
return sessionCookie;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,55 @@
|
|||
// -----------------------------------------------------------------------
|
||||
// <copyright file="SingleWebHostTestConfiguration.cs" company="Microsoft">
|
||||
// Copyright (c) Microsoft Corporation.
|
||||
// All rights reserved. 2014
|
||||
// </copyright>
|
||||
// <author>Sergei Nikitin: sergeyni@microsoft.com</author>
|
||||
// <summary></summary>
|
||||
// -----------------------------------------------------------------------
|
||||
|
||||
namespace Functional.Helpers
|
||||
{
|
||||
using System;
|
||||
using IisExpress;
|
||||
|
||||
/// <summary>
|
||||
/// Single Web Host test configuration class
|
||||
/// </summary>
|
||||
public class SingleWebHostTestConfiguration
|
||||
{
|
||||
private const string LocalhostUriTemplate = "http://localhost:{0}";
|
||||
private readonly IisExpressConfiguration webHostConfiguration;
|
||||
|
||||
public SingleWebHostTestConfiguration(
|
||||
IisExpressConfiguration webHostConfiguration)
|
||||
{
|
||||
if (null == webHostConfiguration)
|
||||
{
|
||||
throw new ArgumentNullException("webHostConfiguration");
|
||||
}
|
||||
|
||||
this.webHostConfiguration = webHostConfiguration;
|
||||
}
|
||||
|
||||
public IisExpressConfiguration WebHostConfig
|
||||
{
|
||||
get { return webHostConfiguration; }
|
||||
}
|
||||
|
||||
public bool AttachDebugger { get; set; }
|
||||
|
||||
public string ApplicationUri
|
||||
{
|
||||
get { return string.Format(LocalhostUriTemplate, webHostConfiguration.Port); }
|
||||
}
|
||||
|
||||
public int TelemetryListenerPort { get; set; }
|
||||
|
||||
public string TelemetryListenerUri
|
||||
{
|
||||
get { return string.Format(LocalhostUriTemplate, TelemetryListenerPort) + "/v2/track/"; }
|
||||
}
|
||||
|
||||
public string IKey { get; set; }
|
||||
}
|
||||
}
|
|
@ -0,0 +1,15 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<system.applicationHost>
|
||||
<sites>
|
||||
<site name="Development Web Site" id="1" serverAutoStart="true" xdt:Transform="Replace" xdt:Locator="Match(id)">
|
||||
<application path="/" applicationPool="Clr4IntegratedAppPool">
|
||||
<virtualDirectory path="/" physicalPath="D:\mseng\AppDataCollection\src\OperationTracking\TestResults\Deploy_olesyam 2014-06-06 12_43_11\Out\TestApps_Mvc4_MediumTrust_App"/>
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation=":1111:localhost"/>
|
||||
</bindings>
|
||||
</site>
|
||||
</sites>
|
||||
</system.applicationHost>
|
||||
</configuration>
|
|
@ -0,0 +1,187 @@
|
|||
namespace Functional.IisExpress
|
||||
{
|
||||
using System;
|
||||
using System.ComponentModel;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Runtime.InteropServices;
|
||||
using System.Threading;
|
||||
|
||||
using Functional.Helpers.Debugger;
|
||||
|
||||
public class IisExpress
|
||||
{
|
||||
private const string IssExpressLocation = @"%programfiles%\IIS Express\iisexpress.exe";
|
||||
private const string ConfigParameter = "config";
|
||||
private const string ConfigFileName = "applicationHost.config";
|
||||
|
||||
private readonly Process hostProcess;
|
||||
|
||||
private IisExpress(
|
||||
IisExpressConfiguration parameters,
|
||||
bool attachVsDebugger)
|
||||
{
|
||||
if (null == parameters)
|
||||
{
|
||||
throw new ArgumentNullException("parameters");
|
||||
}
|
||||
|
||||
if (string.IsNullOrEmpty(parameters.Path))
|
||||
{
|
||||
throw new ArgumentNullException("parameters.Path");
|
||||
}
|
||||
|
||||
string configFilePath = string.Format("{0}\\{1}", parameters.Path, ConfigFileName);
|
||||
File.WriteAllText(configFilePath, parameters.GetConfigFile());
|
||||
|
||||
Trace.TraceInformation(
|
||||
"Starting IIS Express with configuration file: {0}",
|
||||
configFilePath);
|
||||
|
||||
var executablePath = Environment.ExpandEnvironmentVariables(IssExpressLocation);
|
||||
// executing x64 bit version (unable to use Environment.GetFolderPath(Environment.SpecialFolder.ProgramFiles) from x86 process)
|
||||
|
||||
if (true == parameters.UseX64Process)
|
||||
{
|
||||
executablePath = executablePath.Replace(" (x86)", string.Empty);
|
||||
}
|
||||
|
||||
var psi = new ProcessStartInfo
|
||||
{
|
||||
FileName = executablePath,
|
||||
Arguments = string.Format("/{0}:\"{1}\" ", ConfigParameter, configFilePath),
|
||||
RedirectStandardOutput = true,
|
||||
UseShellExecute = false,
|
||||
};
|
||||
|
||||
foreach (var envVariable in parameters.EnvironmentVariables)
|
||||
{
|
||||
psi.EnvironmentVariables.Add(
|
||||
envVariable.Key,
|
||||
envVariable.Value);
|
||||
}
|
||||
|
||||
this.hostProcess =
|
||||
true == attachVsDebugger
|
||||
? StartAndAttachVsDebugger(psi)
|
||||
: Process.Start(psi);
|
||||
|
||||
if (null == this.hostProcess)
|
||||
{
|
||||
throw new InvalidOperationException(
|
||||
"Unable to start process",
|
||||
new Win32Exception());
|
||||
}
|
||||
|
||||
this.WaitForHostInitialization();
|
||||
}
|
||||
|
||||
public static IisExpress Start(IisExpressConfiguration parameters,
|
||||
bool attachVsDebugger = false)
|
||||
{
|
||||
return new IisExpress(parameters, attachVsDebugger);
|
||||
}
|
||||
|
||||
public void Stop()
|
||||
{
|
||||
const int processExitWaitTimeout = 5000;
|
||||
|
||||
Trace.TraceInformation("Stopping iisexpress.exe: pid={0}", this.hostProcess.Id);
|
||||
|
||||
SendStopMessageToProcess(this.hostProcess.Id);
|
||||
|
||||
Trace.TraceInformation("Waiting for exit of iisexpress.exe: pid={0}", this.hostProcess.Id);
|
||||
if (false == this.hostProcess.WaitForExit(processExitWaitTimeout))
|
||||
{
|
||||
Trace.TraceWarning("iisexpress.exe process hasn't exited during expected time, terminating!");
|
||||
this.hostProcess.Kill();
|
||||
}
|
||||
else
|
||||
{
|
||||
Trace.TraceInformation("iisexpress.exe successfully exited: pid={0}", this.hostProcess.Id);
|
||||
}
|
||||
|
||||
this.hostProcess.Close();
|
||||
}
|
||||
|
||||
private static void SendStopMessageToProcess(int pid)
|
||||
{
|
||||
try
|
||||
{
|
||||
for (var ptr = NativeMethods.GetTopWindow(IntPtr.Zero);
|
||||
ptr != IntPtr.Zero;
|
||||
ptr = NativeMethods.GetWindow(ptr, 2))
|
||||
{
|
||||
uint num;
|
||||
NativeMethods.GetWindowThreadProcessId(ptr, out num);
|
||||
if (pid == num)
|
||||
{
|
||||
var handleRef = new HandleRef(null, ptr);
|
||||
NativeMethods.PostMessage(handleRef, 0x12, IntPtr.Zero, IntPtr.Zero);
|
||||
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
catch (Exception exc)
|
||||
{
|
||||
Trace.TraceError(exc.ToString());
|
||||
}
|
||||
}
|
||||
|
||||
private static Process StartAndAttachVsDebugger(
|
||||
ProcessStartInfo psi)
|
||||
{
|
||||
var hostProcess = Process.Start(psi);
|
||||
if (null != hostProcess)
|
||||
{
|
||||
var debugger = hostProcess.FindParentByName("devenv");
|
||||
if (null != debugger)
|
||||
{
|
||||
debugger.AttachManagedTo(hostProcess);
|
||||
}
|
||||
}
|
||||
|
||||
return hostProcess;
|
||||
}
|
||||
|
||||
private void WaitForHostInitialization()
|
||||
{
|
||||
const int outputLineReadingTimeoutMs = 500;
|
||||
|
||||
Trace.TraceInformation(
|
||||
"Waiting for iisexpress.exe initialization: pid={0}",
|
||||
this.hostProcess.Id);
|
||||
|
||||
var line = string.Empty;
|
||||
|
||||
while (null != line
|
||||
&& false == line.StartsWith("Registration completed")
|
||||
&& false == line.StartsWith("IIS Express is running.")
|
||||
&& false == this.hostProcess.StandardOutput.EndOfStream)
|
||||
{
|
||||
Thread.Sleep(outputLineReadingTimeoutMs);
|
||||
|
||||
line = this.hostProcess.StandardOutput.ReadLine();
|
||||
Trace.TraceInformation("Reading console output of iisexpress.exe: {0}", line);
|
||||
}
|
||||
|
||||
Trace.TraceInformation(
|
||||
"iisexpress.exe initialization complete: pid={0}",
|
||||
this.hostProcess.Id);
|
||||
}
|
||||
|
||||
internal class NativeMethods
|
||||
{
|
||||
// Methods
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
internal static extern IntPtr GetTopWindow(IntPtr hWnd);
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
internal static extern IntPtr GetWindow(IntPtr hWnd, uint uCmd);
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
internal static extern uint GetWindowThreadProcessId(IntPtr hwnd, out uint lpdwProcessId);
|
||||
[DllImport("user32.dll", SetLastError = true)]
|
||||
internal static extern bool PostMessage(HandleRef hWnd, uint Msg, IntPtr wParam, IntPtr lParam);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,11 @@
|
|||
namespace Functional.IisExpress
|
||||
{
|
||||
public enum IisExpressAppPools
|
||||
{
|
||||
Clr4IntegratedAppPool,
|
||||
Clr4ClassicAppPool,
|
||||
Clr2IntegratedAppPool,
|
||||
Clr2ClassicAppPool,
|
||||
IISExpressAppPool
|
||||
}
|
||||
}
|
|
@ -0,0 +1,91 @@
|
|||
namespace Functional.IisExpress
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using Microsoft.Web.XmlTransform;
|
||||
|
||||
public class IisExpressConfiguration
|
||||
{
|
||||
private const string TransformationTemplate = "<?xml version=\"1.0\" encoding=\"utf-8\" ?> " +
|
||||
"<configuration xmlns:xdt=\"http://schemas.microsoft.com/XML-Document-Transform\">" +
|
||||
"<system.applicationHost>" +
|
||||
"<sites>" +
|
||||
"<site name=\"{0}\" id=\"1\" serverAutoStart=\"true\" xdt:Transform=\"Replace\" xdt:Locator=\"Match(id)\"> " +
|
||||
"<application path=\"/\" applicationPool=\"{1}\">" +
|
||||
"<virtualDirectory path=\"/\" physicalPath=\"{2}\"/>" +
|
||||
"</application>" +
|
||||
"<bindings>" +
|
||||
"<binding protocol=\"http\" bindingInformation=\":{3}:localhost\"/>" +
|
||||
"</bindings> " +
|
||||
"</site> " +
|
||||
"</sites>" +
|
||||
"</system.applicationHost>" +
|
||||
"</configuration>";
|
||||
|
||||
private const string ApplicationHostResourceName = "PerfCollector.FunctionalTests.IisExpress.applicationhost.config";
|
||||
private const string DefaultSiteName = "Development Web Site";
|
||||
private IDictionary<string, string> environmentVariables = new Dictionary<string, string>();
|
||||
|
||||
public IisExpressAppPools ApplicationPool { get; set; }
|
||||
|
||||
public bool UseX64Process { get; set; }
|
||||
|
||||
public string Site { get; set; }
|
||||
|
||||
public string Path { get; set; }
|
||||
|
||||
public int Port { get; set; }
|
||||
|
||||
public IDictionary<string, string> EnvironmentVariables
|
||||
{
|
||||
get { return this.environmentVariables; }
|
||||
set
|
||||
{
|
||||
if (null == value)
|
||||
{
|
||||
throw new ArgumentNullException("value");
|
||||
}
|
||||
|
||||
this.environmentVariables = value;
|
||||
}
|
||||
}
|
||||
|
||||
public string GetConfigFile()
|
||||
{
|
||||
if (string.IsNullOrEmpty(Path))
|
||||
{
|
||||
throw new ArgumentNullException("Path");
|
||||
}
|
||||
|
||||
if (Port <= 0)
|
||||
{
|
||||
throw new ArgumentOutOfRangeException("Port");
|
||||
}
|
||||
|
||||
return
|
||||
SetParametersToConfig(string.Format(TransformationTemplate,
|
||||
string.IsNullOrEmpty(Site) ? DefaultSiteName : Site, ApplicationPool, Path, Port));
|
||||
}
|
||||
|
||||
private string SetParametersToConfig(string transformationString)
|
||||
{
|
||||
using (var applicationHostStream = typeof(IisExpressConfiguration).Assembly.GetManifestResourceStream(ApplicationHostResourceName))
|
||||
{
|
||||
if (applicationHostStream != null)
|
||||
{
|
||||
using (var transformation = new XmlTransformation(transformationString, false, null))
|
||||
{
|
||||
var document = new XmlTransformableDocument();
|
||||
document.Load(applicationHostStream);
|
||||
transformation.Apply(document);
|
||||
|
||||
return document.OuterXml;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return string.Empty;
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,953 @@
|
|||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="system.applicationHost">
|
||||
<section name="applicationPools" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||
<section name="configHistory" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||
<section name="customMetadata" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||
<section name="listenerAdapters" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||
<section name="log" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||
<section name="preloadProviders" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||
<section name="sites" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||
<section name="webLimits" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||
</sectionGroup>
|
||||
|
||||
<sectionGroup name="system.webServer">
|
||||
<section name="asp" overrideModeDefault="Deny" />
|
||||
<section name="caching" overrideModeDefault="Allow" />
|
||||
<section name="cgi" overrideModeDefault="Deny" />
|
||||
<section name="defaultDocument" overrideModeDefault="Allow" />
|
||||
<section name="directoryBrowse" overrideModeDefault="Allow" />
|
||||
<section name="fastCgi" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||
<section name="globalModules" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||
<section name="handlers" overrideModeDefault="Deny" />
|
||||
<section name="httpCompression" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||
<section name="httpErrors" overrideModeDefault="Allow" />
|
||||
<section name="httpLogging" overrideModeDefault="Deny" />
|
||||
<section name="httpProtocol" overrideModeDefault="Allow" />
|
||||
<section name="httpRedirect" overrideModeDefault="Allow" />
|
||||
<section name="httpTracing" overrideModeDefault="Deny" />
|
||||
<section name="isapiFilters" allowDefinition="MachineToApplication" overrideModeDefault="Deny" />
|
||||
<section name="modules" allowDefinition="MachineToApplication" overrideModeDefault="Deny" />
|
||||
<section name="odbcLogging" overrideModeDefault="Deny" />
|
||||
<sectionGroup name="security">
|
||||
<section name="access" overrideModeDefault="Deny" />
|
||||
<section name="applicationDependencies" overrideModeDefault="Deny" />
|
||||
<sectionGroup name="authentication">
|
||||
<section name="anonymousAuthentication" overrideModeDefault="Deny" />
|
||||
<section name="basicAuthentication" overrideModeDefault="Deny" />
|
||||
<section name="clientCertificateMappingAuthentication" overrideModeDefault="Deny" />
|
||||
<section name="digestAuthentication" overrideModeDefault="Deny" />
|
||||
<section name="iisClientCertificateMappingAuthentication" overrideModeDefault="Deny" />
|
||||
<section name="windowsAuthentication" overrideModeDefault="Deny" />
|
||||
</sectionGroup>
|
||||
<section name="authorization" overrideModeDefault="Allow" />
|
||||
<section name="ipSecurity" overrideModeDefault="Deny" />
|
||||
<section name="dynamicIpSecurity" overrideModeDefault="Deny" />
|
||||
<section name="isapiCgiRestriction" allowDefinition="AppHostOnly" overrideModeDefault="Deny" />
|
||||
<section name="requestFiltering" overrideModeDefault="Allow" />
|
||||
</sectionGroup>
|
||||
<section name="serverRuntime" overrideModeDefault="Deny" />
|
||||
<section name="serverSideInclude" overrideModeDefault="Deny" />
|
||||
<section name="staticContent" overrideModeDefault="Allow" />
|
||||
<sectionGroup name="tracing">
|
||||
<section name="traceFailedRequests" overrideModeDefault="Allow" />
|
||||
<section name="traceProviderDefinitions" overrideModeDefault="Deny" />
|
||||
</sectionGroup>
|
||||
<section name="urlCompression" overrideModeDefault="Allow" />
|
||||
<section name="validation" overrideModeDefault="Allow" />
|
||||
<sectionGroup name="webdav">
|
||||
<section name="globalSettings" overrideModeDefault="Deny" />
|
||||
<section name="authoring" overrideModeDefault="Deny" />
|
||||
<section name="authoringRules" overrideModeDefault="Deny" />
|
||||
</sectionGroup>
|
||||
<sectionGroup name="rewrite">
|
||||
<section name="allowedServerVariables" overrideModeDefault="Deny" />
|
||||
<section name="rules" overrideModeDefault="Allow" />
|
||||
<section name="outboundRules" overrideModeDefault="Allow" />
|
||||
<section name="globalRules" overrideModeDefault="Deny" allowDefinition="AppHostOnly" />
|
||||
<section name="providers" overrideModeDefault="Allow" />
|
||||
<section name="rewriteMaps" overrideModeDefault="Allow" />
|
||||
</sectionGroup>
|
||||
<section name="applicationInitialization" allowDefinition="MachineToApplication" overrideModeDefault="Allow" />
|
||||
<section name="webSocket" overrideModeDefault="Deny" />
|
||||
</sectionGroup>
|
||||
</configSections>
|
||||
|
||||
<configProtectedData>
|
||||
<providers>
|
||||
<add name="IISWASOnlyRsaProvider" type="" description="Uses RsaCryptoServiceProvider to encrypt and decrypt" keyContainerName="iisWasKey" cspProviderName="" useMachineContainer="true" useOAEP="false" />
|
||||
<add name="AesProvider" type="Microsoft.ApplicationHost.AesProtectedConfigurationProvider" description="Uses an AES session key to encrypt and decrypt" keyContainerName="iisConfigurationKey" cspProviderName="" useOAEP="false" useMachineContainer="true" sessionKey="AQIAAA5mAAAApAAAKmFQvWHDEETRz8l2bjZlRxIkwcqTFaCUnCLljn3Q1OkesrhEO9YyLyx4bUhsj1/DyShAv7OAFFhXlrlomaornnk5PLeyO4lIXxaiT33yOFUUgxDx4GSaygkqghVV0tO5yQ/XguUBp2juMfZyztnsNa4pLcz7ZNZQ6p4yn9hxwNs=" />
|
||||
<add name="IISWASOnlyAesProvider" type="Microsoft.ApplicationHost.AesProtectedConfigurationProvider" description="Uses an AES session key to encrypt and decrypt" keyContainerName="iisWasKey" cspProviderName="" useOAEP="false" useMachineContainer="true" sessionKey="AQIAAA5mAAAApAAA4WoiRJ8KHwzAG8AgejPxEOO4/2Vhkolbwo/8gZeNdUDSD36m55hWv4uC9tr/MlKdnwRLL0NhT50Gccyftqz5xTZ0dg5FtvQhTw/he1NwexTKbV+I4Zrd+sZUqHZTsr7JiEr6OHGXL70qoISW5G2m9U8wKT3caPiDPNj2aAaYPLo=" />
|
||||
</providers>
|
||||
</configProtectedData>
|
||||
|
||||
<system.applicationHost>
|
||||
|
||||
<applicationPools>
|
||||
<add name="Clr4IntegratedAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_BIN%\config\templates\PersonalWebServer\aspnet.config" autoStart="true" />
|
||||
<add name="Clr4ClassicAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Classic" CLRConfigFile="%IIS_BIN%\config\templates\PersonalWebServer\aspnet.config" autoStart="true" />
|
||||
<add name="Clr2IntegratedAppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_BIN%\config\templates\PersonalWebServer\aspnet.config" autoStart="true" />
|
||||
<add name="Clr2ClassicAppPool" managedRuntimeVersion="v2.0" managedPipelineMode="Classic" CLRConfigFile="%IIS_BIN%\config\templates\PersonalWebServer\aspnet.config" autoStart="true" />
|
||||
<add name="UnmanagedClassicAppPool" managedRuntimeVersion="" managedPipelineMode="Classic" autoStart="true" />
|
||||
<add name="IISExpressAppPool" managedRuntimeVersion="v4.0" managedPipelineMode="Integrated" CLRConfigFile="%IIS_BIN%\config\templates\PersonalWebServer\aspnet.config" autoStart="true" />
|
||||
<applicationPoolDefaults managedRuntimeLoader="v4.0" >
|
||||
<processModel/>
|
||||
</applicationPoolDefaults>
|
||||
</applicationPools>
|
||||
|
||||
<listenerAdapters>
|
||||
<add name="http" />
|
||||
</listenerAdapters>
|
||||
|
||||
<sites>
|
||||
<site name="Development Web Site" id="1" serverAutoStart="true">
|
||||
<application path="/" applicationPool="{ApplicationPoolPlaceholder}">
|
||||
<virtualDirectory path="/" physicalPath="{PhysicalPathPlaceholder}" />
|
||||
</application>
|
||||
<bindings>
|
||||
<binding protocol="http" bindingInformation=":{PortPlaceholder}:localhost" />
|
||||
</bindings>
|
||||
</site>
|
||||
<siteDefaults>
|
||||
<logFile logFormat="W3C" directory="%IIS_USER_HOME%\Logs" />
|
||||
<traceFailedRequestsLogging directory="%IIS_USER_HOME%\TraceLogFiles" enabled="true" maxLogFileSizeKB="1024" />
|
||||
</siteDefaults>
|
||||
<applicationDefaults applicationPool="IISExpressAppPool" />
|
||||
<virtualDirectoryDefaults allowSubDirConfig="true" />
|
||||
</sites>
|
||||
|
||||
<webLimits />
|
||||
|
||||
</system.applicationHost>
|
||||
|
||||
<system.webServer>
|
||||
|
||||
<serverRuntime />
|
||||
|
||||
<asp scriptErrorSentToBrowser="true">
|
||||
<cache diskTemplateCacheDirectory="%TEMP%\iisexpress\ASP Compiled Templates" />
|
||||
<limits />
|
||||
</asp>
|
||||
|
||||
<caching enabled="true" enableKernelCache="true">
|
||||
</caching>
|
||||
|
||||
<cgi />
|
||||
|
||||
<defaultDocument enabled="true">
|
||||
<files>
|
||||
<add value="Default.htm" />
|
||||
<add value="Default.asp" />
|
||||
<add value="index.htm" />
|
||||
<add value="index.html" />
|
||||
<add value="iisstart.htm" />
|
||||
<add value="default.aspx" />
|
||||
</files>
|
||||
</defaultDocument>
|
||||
|
||||
<directoryBrowse enabled="false" />
|
||||
|
||||
<fastCgi />
|
||||
<globalModules>
|
||||
<add name="UriCacheModule" image="%IIS_BIN%\cachuri.dll" />
|
||||
<add name="TokenCacheModule" image="%IIS_BIN%\cachtokn.dll" />
|
||||
<add name="DynamicCompressionModule" image="%IIS_BIN%\compdyn.dll" />
|
||||
<add name="StaticCompressionModule" image="%IIS_BIN%\compstat.dll" />
|
||||
<add name="DefaultDocumentModule" image="%IIS_BIN%\defdoc.dll" />
|
||||
<add name="DirectoryListingModule" image="%IIS_BIN%\dirlist.dll" />
|
||||
<add name="ProtocolSupportModule" image="%IIS_BIN%\protsup.dll" />
|
||||
<add name="HttpRedirectionModule" image="%IIS_BIN%\redirect.dll" />
|
||||
<add name="ServerSideIncludeModule" image="%IIS_BIN%\iis_ssi.dll" />
|
||||
<add name="StaticFileModule" image="%IIS_BIN%\static.dll" />
|
||||
<add name="AnonymousAuthenticationModule" image="%IIS_BIN%\authanon.dll" />
|
||||
<add name="CertificateMappingAuthenticationModule" image="%IIS_BIN%\authcert.dll" />
|
||||
<add name="UrlAuthorizationModule" image="%IIS_BIN%\urlauthz.dll" />
|
||||
<add name="BasicAuthenticationModule" image="%IIS_BIN%\authbas.dll" />
|
||||
<add name="WindowsAuthenticationModule" image="%IIS_BIN%\authsspi.dll" />
|
||||
<add name="IISCertificateMappingAuthenticationModule" image="%IIS_BIN%\authmap.dll" />
|
||||
<add name="IpRestrictionModule" image="%IIS_BIN%\iprestr.dll" />
|
||||
<add name="DynamicIpRestrictionModule" image="%IIS_BIN%\diprestr.dll" />
|
||||
<add name="RequestFilteringModule" image="%IIS_BIN%\modrqflt.dll" />
|
||||
<add name="CustomLoggingModule" image="%IIS_BIN%\logcust.dll" />
|
||||
<add name="CustomErrorModule" image="%IIS_BIN%\custerr.dll" />
|
||||
<add name="HttpLoggingModule" image="%IIS_BIN%\loghttp.dll" />
|
||||
<add name="FailedRequestsTracingModule" image="%IIS_BIN%\iisfreb.dll" />
|
||||
<add name="RequestMonitorModule" image="%IIS_BIN%\iisreqs.dll" />
|
||||
<add name="IsapiModule" image="%IIS_BIN%\isapi.dll" />
|
||||
<add name="IsapiFilterModule" image="%IIS_BIN%\filter.dll" />
|
||||
<add name="CgiModule" image="%IIS_BIN%\cgi.dll" />
|
||||
<add name="FastCgiModule" image="%IIS_BIN%\iisfcgi.dll" />
|
||||
<add name="RewriteModule" image="%IIS_BIN%\rewrite.dll" />
|
||||
<add name="ConfigurationValidationModule" image="%IIS_BIN%\validcfg.dll" />
|
||||
<add name="ApplicationInitializationModule" image="%IIS_BIN%\warmup.dll" />
|
||||
<add name="WebSocketModule" image="%IIS_BIN%\iiswsock.dll" />
|
||||
<add name="WebMatrixSupportModule" image="%IIS_BIN%\webmatrixsup.dll" />
|
||||
<add name="ManagedEngine" image="%windir%\Microsoft.NET\Framework\v2.0.50727\webengine.dll" preCondition="integratedMode,runtimeVersionv2.0,bitness32" />
|
||||
<add name="ManagedEngine64" image="%windir%\Microsoft.NET\Framework64\v2.0.50727\webengine.dll" preCondition="integratedMode,runtimeVersionv2.0,bitness64" />
|
||||
<add name="ManagedEngineV4.0_32bit" image="%windir%\Microsoft.NET\Framework\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness32" />
|
||||
<add name="ManagedEngineV4.0_64bit" image="%windir%\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll" preCondition="integratedMode,runtimeVersionv4.0,bitness64" />
|
||||
</globalModules>
|
||||
|
||||
<httpCompression directory="%TEMP%\iisexpress\IIS Temporary Compressed Files">
|
||||
<scheme name="gzip" dll="%IIS_BIN%\gzip.dll" />
|
||||
<dynamicTypes>
|
||||
<add mimeType="text/*" enabled="true" />
|
||||
<add mimeType="message/*" enabled="true" />
|
||||
<add mimeType="application/x-javascript" enabled="true" />
|
||||
<add mimeType="*/*" enabled="false" />
|
||||
</dynamicTypes>
|
||||
<staticTypes>
|
||||
<add mimeType="text/*" enabled="true" />
|
||||
<add mimeType="message/*" enabled="true" />
|
||||
<add mimeType="application/x-javascript" enabled="true" />
|
||||
<add mimeType="application/atom+xml" enabled="true" />
|
||||
<add mimeType="application/xaml+xml" enabled="true" />
|
||||
<add mimeType="*/*" enabled="false" />
|
||||
</staticTypes>
|
||||
</httpCompression>
|
||||
|
||||
<httpErrors lockAttributes="allowAbsolutePathsWhenDelegated,defaultPath">
|
||||
<error statusCode="401" prefixLanguageFilePath="%IIS_BIN%\custerr" path="401.htm" />
|
||||
<error statusCode="403" prefixLanguageFilePath="%IIS_BIN%\custerr" path="403.htm" />
|
||||
<error statusCode="404" prefixLanguageFilePath="%IIS_BIN%\custerr" path="404.htm" />
|
||||
<error statusCode="405" prefixLanguageFilePath="%IIS_BIN%\custerr" path="405.htm" />
|
||||
<error statusCode="406" prefixLanguageFilePath="%IIS_BIN%\custerr" path="406.htm" />
|
||||
<error statusCode="412" prefixLanguageFilePath="%IIS_BIN%\custerr" path="412.htm" />
|
||||
<error statusCode="500" prefixLanguageFilePath="%IIS_BIN%\custerr" path="500.htm" />
|
||||
<error statusCode="501" prefixLanguageFilePath="%IIS_BIN%\custerr" path="501.htm" />
|
||||
<error statusCode="502" prefixLanguageFilePath="%IIS_BIN%\custerr" path="502.htm" />
|
||||
</httpErrors>
|
||||
|
||||
<httpLogging dontLog="false" />
|
||||
|
||||
<httpProtocol>
|
||||
<customHeaders>
|
||||
<clear />
|
||||
<add name="X-Powered-By" value="ASP.NET" />
|
||||
</customHeaders>
|
||||
<redirectHeaders>
|
||||
<clear />
|
||||
</redirectHeaders>
|
||||
</httpProtocol>
|
||||
|
||||
<httpRedirect enabled="false" />
|
||||
|
||||
<httpTracing>
|
||||
</httpTracing>
|
||||
|
||||
<isapiFilters>
|
||||
<filter name="ASP.Net_2.0.50727-64" path="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness64,runtimeVersionv2.0" />
|
||||
<filter name="ASP.Net_2.0.50727.0" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="bitness32,runtimeVersionv2.0" />
|
||||
<filter name="ASP.Net_2.0_for_v1.1" path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_filter.dll" enableCache="true" preCondition="runtimeVersionv1.1" />
|
||||
<filter name="ASP.Net_4.0_32bit" path="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="bitness32,runtimeVersionv4.0" />
|
||||
<filter name="ASP.Net_4.0_64bit" path="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_filter.dll" enableCache="true" preCondition="bitness64,runtimeVersionv4.0" />
|
||||
</isapiFilters>
|
||||
|
||||
<odbcLogging />
|
||||
|
||||
<security>
|
||||
|
||||
<access sslFlags="None" />
|
||||
|
||||
<applicationDependencies>
|
||||
<application name="Active Server Pages" groupId="ASP" />
|
||||
</applicationDependencies>
|
||||
|
||||
<authentication>
|
||||
|
||||
<anonymousAuthentication enabled="true" userName="" />
|
||||
|
||||
<basicAuthentication enabled="false" />
|
||||
|
||||
<clientCertificateMappingAuthentication enabled="false" />
|
||||
|
||||
<digestAuthentication enabled="false" />
|
||||
|
||||
<iisClientCertificateMappingAuthentication enabled="false">
|
||||
</iisClientCertificateMappingAuthentication>
|
||||
|
||||
<windowsAuthentication enabled="false">
|
||||
<providers>
|
||||
<add value="Negotiate" />
|
||||
<add value="NTLM" />
|
||||
</providers>
|
||||
</windowsAuthentication>
|
||||
|
||||
</authentication>
|
||||
|
||||
<authorization>
|
||||
<add accessType="Allow" users="*" />
|
||||
</authorization>
|
||||
|
||||
<ipSecurity allowUnlisted="true" />
|
||||
|
||||
<isapiCgiRestriction notListedIsapisAllowed="true" notListedCgisAllowed="true">
|
||||
<add path="%windir%\Microsoft.NET\Framework64\v4.0.30319\webengine4.dll" allowed="true" groupId="ASP.NET_v4.0" description="ASP.NET_v4.0" />
|
||||
<add path="%windir%\Microsoft.NET\Framework\v4.0.30319\webengine4.dll" allowed="true" groupId="ASP.NET_v4.0" description="ASP.NET_v4.0" />
|
||||
<add path="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" allowed="true" groupId="ASP.NET v2.0.50727" description="ASP.NET v2.0.50727" />
|
||||
<add path="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" allowed="true" groupId="ASP.NET v2.0.50727" description="ASP.NET v2.0.50727" />
|
||||
</isapiCgiRestriction>
|
||||
|
||||
<requestFiltering>
|
||||
<fileExtensions allowUnlisted="true" applyToWebDAV="true">
|
||||
<add fileExtension=".asa" allowed="false" />
|
||||
<add fileExtension=".asax" allowed="false" />
|
||||
<add fileExtension=".ascx" allowed="false" />
|
||||
<add fileExtension=".master" allowed="false" />
|
||||
<add fileExtension=".skin" allowed="false" />
|
||||
<add fileExtension=".browser" allowed="false" />
|
||||
<add fileExtension=".sitemap" allowed="false" />
|
||||
<add fileExtension=".config" allowed="false" />
|
||||
<add fileExtension=".cs" allowed="false" />
|
||||
<add fileExtension=".csproj" allowed="false" />
|
||||
<add fileExtension=".vb" allowed="false" />
|
||||
<add fileExtension=".vbproj" allowed="false" />
|
||||
<add fileExtension=".webinfo" allowed="false" />
|
||||
<add fileExtension=".licx" allowed="false" />
|
||||
<add fileExtension=".resx" allowed="false" />
|
||||
<add fileExtension=".resources" allowed="false" />
|
||||
<add fileExtension=".mdb" allowed="false" />
|
||||
<add fileExtension=".vjsproj" allowed="false" />
|
||||
<add fileExtension=".java" allowed="false" />
|
||||
<add fileExtension=".jsl" allowed="false" />
|
||||
<add fileExtension=".ldb" allowed="false" />
|
||||
<add fileExtension=".dsdgm" allowed="false" />
|
||||
<add fileExtension=".ssdgm" allowed="false" />
|
||||
<add fileExtension=".lsad" allowed="false" />
|
||||
<add fileExtension=".ssmap" allowed="false" />
|
||||
<add fileExtension=".cd" allowed="false" />
|
||||
<add fileExtension=".dsprototype" allowed="false" />
|
||||
<add fileExtension=".lsaprototype" allowed="false" />
|
||||
<add fileExtension=".sdm" allowed="false" />
|
||||
<add fileExtension=".sdmDocument" allowed="false" />
|
||||
<add fileExtension=".mdf" allowed="false" />
|
||||
<add fileExtension=".ldf" allowed="false" />
|
||||
<add fileExtension=".ad" allowed="false" />
|
||||
<add fileExtension=".dd" allowed="false" />
|
||||
<add fileExtension=".ldd" allowed="false" />
|
||||
<add fileExtension=".sd" allowed="false" />
|
||||
<add fileExtension=".adprototype" allowed="false" />
|
||||
<add fileExtension=".lddprototype" allowed="false" />
|
||||
<add fileExtension=".exclude" allowed="false" />
|
||||
<add fileExtension=".refresh" allowed="false" />
|
||||
<add fileExtension=".compiled" allowed="false" />
|
||||
<add fileExtension=".msgx" allowed="false" />
|
||||
<add fileExtension=".vsdisco" allowed="false" />
|
||||
<add fileExtension=".rules" allowed="false" />
|
||||
</fileExtensions>
|
||||
<verbs allowUnlisted="true" applyToWebDAV="true" />
|
||||
<hiddenSegments applyToWebDAV="true">
|
||||
<add segment="web.config" />
|
||||
<add segment="bin" />
|
||||
<add segment="App_code" />
|
||||
<add segment="App_GlobalResources" />
|
||||
<add segment="App_LocalResources" />
|
||||
<add segment="App_WebReferences" />
|
||||
<add segment="App_Data" />
|
||||
<add segment="App_Browsers" />
|
||||
</hiddenSegments>
|
||||
</requestFiltering>
|
||||
|
||||
</security>
|
||||
|
||||
<serverSideInclude ssiExecDisable="false" />
|
||||
|
||||
<staticContent lockAttributes="isDocFooterFileName">
|
||||
<mimeMap fileExtension=".323" mimeType="text/h323" />
|
||||
<mimeMap fileExtension=".3g2" mimeType="video/3gpp2" />
|
||||
<mimeMap fileExtension=".3gp2" mimeType="video/3gpp2" />
|
||||
<mimeMap fileExtension=".3gp" mimeType="video/3gpp" />
|
||||
<mimeMap fileExtension=".3gpp" mimeType="video/3gpp" />
|
||||
<mimeMap fileExtension=".aac" mimeType="audio/aac" />
|
||||
<mimeMap fileExtension=".aaf" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".aca" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".accdb" mimeType="application/msaccess" />
|
||||
<mimeMap fileExtension=".accde" mimeType="application/msaccess" />
|
||||
<mimeMap fileExtension=".accdt" mimeType="application/msaccess" />
|
||||
<mimeMap fileExtension=".acx" mimeType="application/internet-property-stream" />
|
||||
<mimeMap fileExtension=".adt" mimeType="audio/vnd.dlna.adts" />
|
||||
<mimeMap fileExtension=".adts" mimeType="audio/vnd.dlna.adts" />
|
||||
<mimeMap fileExtension=".afm" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".ai" mimeType="application/postscript" />
|
||||
<mimeMap fileExtension=".aif" mimeType="audio/x-aiff" />
|
||||
<mimeMap fileExtension=".aifc" mimeType="audio/aiff" />
|
||||
<mimeMap fileExtension=".aiff" mimeType="audio/aiff" />
|
||||
<mimeMap fileExtension=".application" mimeType="application/x-ms-application" />
|
||||
<mimeMap fileExtension=".art" mimeType="image/x-jg" />
|
||||
<mimeMap fileExtension=".asd" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".asf" mimeType="video/x-ms-asf" />
|
||||
<mimeMap fileExtension=".asi" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".asm" mimeType="text/plain" />
|
||||
<mimeMap fileExtension=".asr" mimeType="video/x-ms-asf" />
|
||||
<mimeMap fileExtension=".asx" mimeType="video/x-ms-asf" />
|
||||
<mimeMap fileExtension=".atom" mimeType="application/atom+xml" />
|
||||
<mimeMap fileExtension=".au" mimeType="audio/basic" />
|
||||
<mimeMap fileExtension=".avi" mimeType="video/x-msvideo" />
|
||||
<mimeMap fileExtension=".axs" mimeType="application/olescript" />
|
||||
<mimeMap fileExtension=".bas" mimeType="text/plain" />
|
||||
<mimeMap fileExtension=".bcpio" mimeType="application/x-bcpio" />
|
||||
<mimeMap fileExtension=".bin" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".bmp" mimeType="image/bmp" />
|
||||
<mimeMap fileExtension=".c" mimeType="text/plain" />
|
||||
<mimeMap fileExtension=".cab" mimeType="application/vnd.ms-cab-compressed" />
|
||||
<mimeMap fileExtension=".calx" mimeType="application/vnd.ms-office.calx" />
|
||||
<mimeMap fileExtension=".cat" mimeType="application/vnd.ms-pki.seccat" />
|
||||
<mimeMap fileExtension=".cdf" mimeType="application/x-cdf" />
|
||||
<mimeMap fileExtension=".chm" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".class" mimeType="application/x-java-applet" />
|
||||
<mimeMap fileExtension=".clp" mimeType="application/x-msclip" />
|
||||
<mimeMap fileExtension=".cmx" mimeType="image/x-cmx" />
|
||||
<mimeMap fileExtension=".cnf" mimeType="text/plain" />
|
||||
<mimeMap fileExtension=".cod" mimeType="image/cis-cod" />
|
||||
<mimeMap fileExtension=".cpio" mimeType="application/x-cpio" />
|
||||
<mimeMap fileExtension=".cpp" mimeType="text/plain" />
|
||||
<mimeMap fileExtension=".crd" mimeType="application/x-mscardfile" />
|
||||
<mimeMap fileExtension=".crl" mimeType="application/pkix-crl" />
|
||||
<mimeMap fileExtension=".crt" mimeType="application/x-x509-ca-cert" />
|
||||
<mimeMap fileExtension=".csh" mimeType="application/x-csh" />
|
||||
<mimeMap fileExtension=".css" mimeType="text/css" />
|
||||
<mimeMap fileExtension=".csv" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".cur" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".dcr" mimeType="application/x-director" />
|
||||
<mimeMap fileExtension=".deploy" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".der" mimeType="application/x-x509-ca-cert" />
|
||||
<mimeMap fileExtension=".dib" mimeType="image/bmp" />
|
||||
<mimeMap fileExtension=".dir" mimeType="application/x-director" />
|
||||
<mimeMap fileExtension=".disco" mimeType="text/xml" />
|
||||
<mimeMap fileExtension=".dll" mimeType="application/x-msdownload" />
|
||||
<mimeMap fileExtension=".dll.config" mimeType="text/xml" />
|
||||
<mimeMap fileExtension=".dlm" mimeType="text/dlm" />
|
||||
<mimeMap fileExtension=".doc" mimeType="application/msword" />
|
||||
<mimeMap fileExtension=".docm" mimeType="application/vnd.ms-word.document.macroEnabled.12" />
|
||||
<mimeMap fileExtension=".docx" mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.document" />
|
||||
<mimeMap fileExtension=".dot" mimeType="application/msword" />
|
||||
<mimeMap fileExtension=".dotm" mimeType="application/vnd.ms-word.template.macroEnabled.12" />
|
||||
<mimeMap fileExtension=".dotx" mimeType="application/vnd.openxmlformats-officedocument.wordprocessingml.template" />
|
||||
<mimeMap fileExtension=".dsp" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".dtd" mimeType="text/xml" />
|
||||
<mimeMap fileExtension=".dvi" mimeType="application/x-dvi" />
|
||||
<mimeMap fileExtension=".dvr-ms" mimeType="video/x-ms-dvr" />
|
||||
<mimeMap fileExtension=".dwf" mimeType="drawing/x-dwf" />
|
||||
<mimeMap fileExtension=".dwp" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".dxr" mimeType="application/x-director" />
|
||||
<mimeMap fileExtension=".eml" mimeType="message/rfc822" />
|
||||
<mimeMap fileExtension=".emz" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".eot" mimeType="application/vnd.ms-fontobject" />
|
||||
<mimeMap fileExtension=".eps" mimeType="application/postscript" />
|
||||
<mimeMap fileExtension=".etx" mimeType="text/x-setext" />
|
||||
<mimeMap fileExtension=".evy" mimeType="application/envoy" />
|
||||
<mimeMap fileExtension=".exe" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".exe.config" mimeType="text/xml" />
|
||||
<mimeMap fileExtension=".fdf" mimeType="application/vnd.fdf" />
|
||||
<mimeMap fileExtension=".fif" mimeType="application/fractals" />
|
||||
<mimeMap fileExtension=".fla" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".flr" mimeType="x-world/x-vrml" />
|
||||
<mimeMap fileExtension=".flv" mimeType="video/x-flv" />
|
||||
<mimeMap fileExtension=".gif" mimeType="image/gif" />
|
||||
<mimeMap fileExtension=".gtar" mimeType="application/x-gtar" />
|
||||
<mimeMap fileExtension=".gz" mimeType="application/x-gzip" />
|
||||
<mimeMap fileExtension=".h" mimeType="text/plain" />
|
||||
<mimeMap fileExtension=".hdf" mimeType="application/x-hdf" />
|
||||
<mimeMap fileExtension=".hdml" mimeType="text/x-hdml" />
|
||||
<mimeMap fileExtension=".hhc" mimeType="application/x-oleobject" />
|
||||
<mimeMap fileExtension=".hhk" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".hhp" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".hlp" mimeType="application/winhlp" />
|
||||
<mimeMap fileExtension=".hqx" mimeType="application/mac-binhex40" />
|
||||
<mimeMap fileExtension=".hta" mimeType="application/hta" />
|
||||
<mimeMap fileExtension=".htc" mimeType="text/x-component" />
|
||||
<mimeMap fileExtension=".htm" mimeType="text/html" />
|
||||
<mimeMap fileExtension=".html" mimeType="text/html" />
|
||||
<mimeMap fileExtension=".htt" mimeType="text/webviewhtml" />
|
||||
<mimeMap fileExtension=".hxt" mimeType="text/html" />
|
||||
<mimeMap fileExtension=".ical" mimeType="text/calendar" />
|
||||
<mimeMap fileExtension=".icalendar" mimeType="text/calendar" />
|
||||
<mimeMap fileExtension=".ico" mimeType="image/x-icon" />
|
||||
<mimeMap fileExtension=".ics" mimeType="text/calendar" />
|
||||
<mimeMap fileExtension=".ief" mimeType="image/ief" />
|
||||
<mimeMap fileExtension=".ifb" mimeType="text/calendar" />
|
||||
<mimeMap fileExtension=".iii" mimeType="application/x-iphone" />
|
||||
<mimeMap fileExtension=".inf" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".ins" mimeType="application/x-internet-signup" />
|
||||
<mimeMap fileExtension=".isp" mimeType="application/x-internet-signup" />
|
||||
<mimeMap fileExtension=".IVF" mimeType="video/x-ivf" />
|
||||
<mimeMap fileExtension=".jar" mimeType="application/java-archive" />
|
||||
<mimeMap fileExtension=".java" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".jck" mimeType="application/liquidmotion" />
|
||||
<mimeMap fileExtension=".jcz" mimeType="application/liquidmotion" />
|
||||
<mimeMap fileExtension=".jfif" mimeType="image/pjpeg" />
|
||||
<mimeMap fileExtension=".jpb" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".jpe" mimeType="image/jpeg" />
|
||||
<mimeMap fileExtension=".jpeg" mimeType="image/jpeg" />
|
||||
<mimeMap fileExtension=".jpg" mimeType="image/jpeg" />
|
||||
<mimeMap fileExtension=".js" mimeType="application/javascript" />
|
||||
<mimeMap fileExtension=".jsx" mimeType="text/jscript" />
|
||||
<mimeMap fileExtension=".latex" mimeType="application/x-latex" />
|
||||
<mimeMap fileExtension=".lit" mimeType="application/x-ms-reader" />
|
||||
<mimeMap fileExtension=".lpk" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".lsf" mimeType="video/x-la-asf" />
|
||||
<mimeMap fileExtension=".lsx" mimeType="video/x-la-asf" />
|
||||
<mimeMap fileExtension=".lzh" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".m13" mimeType="application/x-msmediaview" />
|
||||
<mimeMap fileExtension=".m14" mimeType="application/x-msmediaview" />
|
||||
<mimeMap fileExtension=".m1v" mimeType="video/mpeg" />
|
||||
<mimeMap fileExtension=".m2ts" mimeType="video/vnd.dlna.mpeg-tts" />
|
||||
<mimeMap fileExtension=".m3u" mimeType="audio/x-mpegurl" />
|
||||
<mimeMap fileExtension=".m4a" mimeType="audio/mp4" />
|
||||
<mimeMap fileExtension=".m4v" mimeType="video/mp4" />
|
||||
<mimeMap fileExtension=".man" mimeType="application/x-troff-man" />
|
||||
<mimeMap fileExtension=".manifest" mimeType="application/x-ms-manifest" />
|
||||
<mimeMap fileExtension=".map" mimeType="text/plain" />
|
||||
<mimeMap fileExtension=".mdb" mimeType="application/x-msaccess" />
|
||||
<mimeMap fileExtension=".mdp" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".me" mimeType="application/x-troff-me" />
|
||||
<mimeMap fileExtension=".mht" mimeType="message/rfc822" />
|
||||
<mimeMap fileExtension=".mhtml" mimeType="message/rfc822" />
|
||||
<mimeMap fileExtension=".mid" mimeType="audio/mid" />
|
||||
<mimeMap fileExtension=".midi" mimeType="audio/mid" />
|
||||
<mimeMap fileExtension=".mix" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".mmf" mimeType="application/x-smaf" />
|
||||
<mimeMap fileExtension=".mno" mimeType="text/xml" />
|
||||
<mimeMap fileExtension=".mny" mimeType="application/x-msmoney" />
|
||||
<mimeMap fileExtension=".mov" mimeType="video/quicktime" />
|
||||
<mimeMap fileExtension=".movie" mimeType="video/x-sgi-movie" />
|
||||
<mimeMap fileExtension=".mp2" mimeType="video/mpeg" />
|
||||
<mimeMap fileExtension=".mp3" mimeType="audio/mpeg" />
|
||||
<mimeMap fileExtension=".mp4" mimeType="video/mp4" />
|
||||
<mimeMap fileExtension=".mp4v" mimeType="video/mp4" />
|
||||
<mimeMap fileExtension=".mpa" mimeType="video/mpeg" />
|
||||
<mimeMap fileExtension=".mpe" mimeType="video/mpeg" />
|
||||
<mimeMap fileExtension=".mpeg" mimeType="video/mpeg" />
|
||||
<mimeMap fileExtension=".mpg" mimeType="video/mpeg" />
|
||||
<mimeMap fileExtension=".mpp" mimeType="application/vnd.ms-project" />
|
||||
<mimeMap fileExtension=".mpv2" mimeType="video/mpeg" />
|
||||
<mimeMap fileExtension=".ms" mimeType="application/x-troff-ms" />
|
||||
<mimeMap fileExtension=".msi" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".mso" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".mvb" mimeType="application/x-msmediaview" />
|
||||
<mimeMap fileExtension=".mvc" mimeType="application/x-miva-compiled" />
|
||||
<mimeMap fileExtension=".nc" mimeType="application/x-netcdf" />
|
||||
<mimeMap fileExtension=".nsc" mimeType="video/x-ms-asf" />
|
||||
<mimeMap fileExtension=".nws" mimeType="message/rfc822" />
|
||||
<mimeMap fileExtension=".ocx" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".oda" mimeType="application/oda" />
|
||||
<mimeMap fileExtension=".odc" mimeType="text/x-ms-odc" />
|
||||
<mimeMap fileExtension=".ods" mimeType="application/oleobject" />
|
||||
<mimeMap fileExtension=".oga" mimeType="audio/ogg" />
|
||||
<mimeMap fileExtension=".ogg" mimeType="video/ogg" />
|
||||
<mimeMap fileExtension=".ogv" mimeType="video/ogg" />
|
||||
<mimeMap fileExtension=".ogx" mimeType="application/ogg" />
|
||||
<mimeMap fileExtension=".one" mimeType="application/onenote" />
|
||||
<mimeMap fileExtension=".onea" mimeType="application/onenote" />
|
||||
<mimeMap fileExtension=".onetoc" mimeType="application/onenote" />
|
||||
<mimeMap fileExtension=".onetoc2" mimeType="application/onenote" />
|
||||
<mimeMap fileExtension=".onetmp" mimeType="application/onenote" />
|
||||
<mimeMap fileExtension=".onepkg" mimeType="application/onenote" />
|
||||
<mimeMap fileExtension=".osdx" mimeType="application/opensearchdescription+xml" />
|
||||
<mimeMap fileExtension=".otf" mimeType="font/otf" />
|
||||
<mimeMap fileExtension=".p10" mimeType="application/pkcs10" />
|
||||
<mimeMap fileExtension=".p12" mimeType="application/x-pkcs12" />
|
||||
<mimeMap fileExtension=".p7b" mimeType="application/x-pkcs7-certificates" />
|
||||
<mimeMap fileExtension=".p7c" mimeType="application/pkcs7-mime" />
|
||||
<mimeMap fileExtension=".p7m" mimeType="application/pkcs7-mime" />
|
||||
<mimeMap fileExtension=".p7r" mimeType="application/x-pkcs7-certreqresp" />
|
||||
<mimeMap fileExtension=".p7s" mimeType="application/pkcs7-signature" />
|
||||
<mimeMap fileExtension=".pbm" mimeType="image/x-portable-bitmap" />
|
||||
<mimeMap fileExtension=".pcx" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".pcz" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".pdf" mimeType="application/pdf" />
|
||||
<mimeMap fileExtension=".pfb" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".pfm" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".pfx" mimeType="application/x-pkcs12" />
|
||||
<mimeMap fileExtension=".pgm" mimeType="image/x-portable-graymap" />
|
||||
<mimeMap fileExtension=".pko" mimeType="application/vnd.ms-pki.pko" />
|
||||
<mimeMap fileExtension=".pma" mimeType="application/x-perfmon" />
|
||||
<mimeMap fileExtension=".pmc" mimeType="application/x-perfmon" />
|
||||
<mimeMap fileExtension=".pml" mimeType="application/x-perfmon" />
|
||||
<mimeMap fileExtension=".pmr" mimeType="application/x-perfmon" />
|
||||
<mimeMap fileExtension=".pmw" mimeType="application/x-perfmon" />
|
||||
<mimeMap fileExtension=".png" mimeType="image/png" />
|
||||
<mimeMap fileExtension=".pnm" mimeType="image/x-portable-anymap" />
|
||||
<mimeMap fileExtension=".pnz" mimeType="image/png" />
|
||||
<mimeMap fileExtension=".pot" mimeType="application/vnd.ms-powerpoint" />
|
||||
<mimeMap fileExtension=".potm" mimeType="application/vnd.ms-powerpoint.template.macroEnabled.12" />
|
||||
<mimeMap fileExtension=".potx" mimeType="application/vnd.openxmlformats-officedocument.presentationml.template" />
|
||||
<mimeMap fileExtension=".ppam" mimeType="application/vnd.ms-powerpoint.addin.macroEnabled.12" />
|
||||
<mimeMap fileExtension=".ppm" mimeType="image/x-portable-pixmap" />
|
||||
<mimeMap fileExtension=".pps" mimeType="application/vnd.ms-powerpoint" />
|
||||
<mimeMap fileExtension=".ppsm" mimeType="application/vnd.ms-powerpoint.slideshow.macroEnabled.12" />
|
||||
<mimeMap fileExtension=".ppsx" mimeType="application/vnd.openxmlformats-officedocument.presentationml.slideshow" />
|
||||
<mimeMap fileExtension=".ppt" mimeType="application/vnd.ms-powerpoint" />
|
||||
<mimeMap fileExtension=".pptm" mimeType="application/vnd.ms-powerpoint.presentation.macroEnabled.12" />
|
||||
<mimeMap fileExtension=".pptx" mimeType="application/vnd.openxmlformats-officedocument.presentationml.presentation" />
|
||||
<mimeMap fileExtension=".prf" mimeType="application/pics-rules" />
|
||||
<mimeMap fileExtension=".prm" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".prx" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".ps" mimeType="application/postscript" />
|
||||
<mimeMap fileExtension=".psd" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".psm" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".psp" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".pub" mimeType="application/x-mspublisher" />
|
||||
<mimeMap fileExtension=".qt" mimeType="video/quicktime" />
|
||||
<mimeMap fileExtension=".qtl" mimeType="application/x-quicktimeplayer" />
|
||||
<mimeMap fileExtension=".qxd" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".ra" mimeType="audio/x-pn-realaudio" />
|
||||
<mimeMap fileExtension=".ram" mimeType="audio/x-pn-realaudio" />
|
||||
<mimeMap fileExtension=".rar" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".ras" mimeType="image/x-cmu-raster" />
|
||||
<mimeMap fileExtension=".rf" mimeType="image/vnd.rn-realflash" />
|
||||
<mimeMap fileExtension=".rgb" mimeType="image/x-rgb" />
|
||||
<mimeMap fileExtension=".rm" mimeType="application/vnd.rn-realmedia" />
|
||||
<mimeMap fileExtension=".rmi" mimeType="audio/mid" />
|
||||
<mimeMap fileExtension=".roff" mimeType="application/x-troff" />
|
||||
<mimeMap fileExtension=".rpm" mimeType="audio/x-pn-realaudio-plugin" />
|
||||
<mimeMap fileExtension=".rtf" mimeType="application/rtf" />
|
||||
<mimeMap fileExtension=".rtx" mimeType="text/richtext" />
|
||||
<mimeMap fileExtension=".scd" mimeType="application/x-msschedule" />
|
||||
<mimeMap fileExtension=".sct" mimeType="text/scriptlet" />
|
||||
<mimeMap fileExtension=".sea" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".setpay" mimeType="application/set-payment-initiation" />
|
||||
<mimeMap fileExtension=".setreg" mimeType="application/set-registration-initiation" />
|
||||
<mimeMap fileExtension=".sgml" mimeType="text/sgml" />
|
||||
<mimeMap fileExtension=".sh" mimeType="application/x-sh" />
|
||||
<mimeMap fileExtension=".shar" mimeType="application/x-shar" />
|
||||
<mimeMap fileExtension=".sit" mimeType="application/x-stuffit" />
|
||||
<mimeMap fileExtension=".sldm" mimeType="application/vnd.ms-powerpoint.slide.macroEnabled.12" />
|
||||
<mimeMap fileExtension=".sldx" mimeType="application/vnd.openxmlformats-officedocument.presentationml.slide" />
|
||||
<mimeMap fileExtension=".smd" mimeType="audio/x-smd" />
|
||||
<mimeMap fileExtension=".smi" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".smx" mimeType="audio/x-smd" />
|
||||
<mimeMap fileExtension=".smz" mimeType="audio/x-smd" />
|
||||
<mimeMap fileExtension=".snd" mimeType="audio/basic" />
|
||||
<mimeMap fileExtension=".snp" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".spc" mimeType="application/x-pkcs7-certificates" />
|
||||
<mimeMap fileExtension=".spl" mimeType="application/futuresplash" />
|
||||
<mimeMap fileExtension=".spx" mimeType="audio/ogg" />
|
||||
<mimeMap fileExtension=".src" mimeType="application/x-wais-source" />
|
||||
<mimeMap fileExtension=".ssm" mimeType="application/streamingmedia" />
|
||||
<mimeMap fileExtension=".sst" mimeType="application/vnd.ms-pki.certstore" />
|
||||
<mimeMap fileExtension=".stl" mimeType="application/vnd.ms-pki.stl" />
|
||||
<mimeMap fileExtension=".sv4cpio" mimeType="application/x-sv4cpio" />
|
||||
<mimeMap fileExtension=".sv4crc" mimeType="application/x-sv4crc" />
|
||||
<mimeMap fileExtension=".svg" mimeType="image/svg+xml" />
|
||||
<mimeMap fileExtension=".svgz" mimeType="image/svg+xml" />
|
||||
<mimeMap fileExtension=".swf" mimeType="application/x-shockwave-flash" />
|
||||
<mimeMap fileExtension=".t" mimeType="application/x-troff" />
|
||||
<mimeMap fileExtension=".tar" mimeType="application/x-tar" />
|
||||
<mimeMap fileExtension=".tcl" mimeType="application/x-tcl" />
|
||||
<mimeMap fileExtension=".tex" mimeType="application/x-tex" />
|
||||
<mimeMap fileExtension=".texi" mimeType="application/x-texinfo" />
|
||||
<mimeMap fileExtension=".texinfo" mimeType="application/x-texinfo" />
|
||||
<mimeMap fileExtension=".tgz" mimeType="application/x-compressed" />
|
||||
<mimeMap fileExtension=".thmx" mimeType="application/vnd.ms-officetheme" />
|
||||
<mimeMap fileExtension=".thn" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".tif" mimeType="image/tiff" />
|
||||
<mimeMap fileExtension=".tiff" mimeType="image/tiff" />
|
||||
<mimeMap fileExtension=".toc" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".tr" mimeType="application/x-troff" />
|
||||
<mimeMap fileExtension=".trm" mimeType="application/x-msterminal" />
|
||||
<mimeMap fileExtension=".ts" mimeType="video/vnd.dlna.mpeg-tts" />
|
||||
<mimeMap fileExtension=".tsv" mimeType="text/tab-separated-values" />
|
||||
<mimeMap fileExtension=".ttf" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".tts" mimeType="video/vnd.dlna.mpeg-tts" />
|
||||
<mimeMap fileExtension=".txt" mimeType="text/plain" />
|
||||
<mimeMap fileExtension=".u32" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".uls" mimeType="text/iuls" />
|
||||
<mimeMap fileExtension=".ustar" mimeType="application/x-ustar" />
|
||||
<mimeMap fileExtension=".vbs" mimeType="text/vbscript" />
|
||||
<mimeMap fileExtension=".vcf" mimeType="text/x-vcard" />
|
||||
<mimeMap fileExtension=".vcs" mimeType="text/plain" />
|
||||
<mimeMap fileExtension=".vdx" mimeType="application/vnd.ms-visio.viewer" />
|
||||
<mimeMap fileExtension=".vml" mimeType="text/xml" />
|
||||
<mimeMap fileExtension=".vsd" mimeType="application/vnd.visio" />
|
||||
<mimeMap fileExtension=".vss" mimeType="application/vnd.visio" />
|
||||
<mimeMap fileExtension=".vst" mimeType="application/vnd.visio" />
|
||||
<mimeMap fileExtension=".vsto" mimeType="application/x-ms-vsto" />
|
||||
<mimeMap fileExtension=".vsw" mimeType="application/vnd.visio" />
|
||||
<mimeMap fileExtension=".vsx" mimeType="application/vnd.visio" />
|
||||
<mimeMap fileExtension=".vtx" mimeType="application/vnd.visio" />
|
||||
<mimeMap fileExtension=".wav" mimeType="audio/wav" />
|
||||
<mimeMap fileExtension=".wax" mimeType="audio/x-ms-wax" />
|
||||
<mimeMap fileExtension=".wbmp" mimeType="image/vnd.wap.wbmp" />
|
||||
<mimeMap fileExtension=".wcm" mimeType="application/vnd.ms-works" />
|
||||
<mimeMap fileExtension=".wdb" mimeType="application/vnd.ms-works" />
|
||||
<mimeMap fileExtension=".webm" mimeType="video/webm" />
|
||||
<mimeMap fileExtension=".wks" mimeType="application/vnd.ms-works" />
|
||||
<mimeMap fileExtension=".wm" mimeType="video/x-ms-wm" />
|
||||
<mimeMap fileExtension=".wma" mimeType="audio/x-ms-wma" />
|
||||
<mimeMap fileExtension=".wmd" mimeType="application/x-ms-wmd" />
|
||||
<mimeMap fileExtension=".wmf" mimeType="application/x-msmetafile" />
|
||||
<mimeMap fileExtension=".wml" mimeType="text/vnd.wap.wml" />
|
||||
<mimeMap fileExtension=".wmlc" mimeType="application/vnd.wap.wmlc" />
|
||||
<mimeMap fileExtension=".wmls" mimeType="text/vnd.wap.wmlscript" />
|
||||
<mimeMap fileExtension=".wmlsc" mimeType="application/vnd.wap.wmlscriptc" />
|
||||
<mimeMap fileExtension=".wmp" mimeType="video/x-ms-wmp" />
|
||||
<mimeMap fileExtension=".wmv" mimeType="video/x-ms-wmv" />
|
||||
<mimeMap fileExtension=".wmx" mimeType="video/x-ms-wmx" />
|
||||
<mimeMap fileExtension=".wmz" mimeType="application/x-ms-wmz" />
|
||||
<mimeMap fileExtension=".woff" mimeType="font/x-woff" />
|
||||
<mimeMap fileExtension=".wps" mimeType="application/vnd.ms-works" />
|
||||
<mimeMap fileExtension=".wri" mimeType="application/x-mswrite" />
|
||||
<mimeMap fileExtension=".wrl" mimeType="x-world/x-vrml" />
|
||||
<mimeMap fileExtension=".wrz" mimeType="x-world/x-vrml" />
|
||||
<mimeMap fileExtension=".wsdl" mimeType="text/xml" />
|
||||
<mimeMap fileExtension=".wtv" mimeType="video/x-ms-wtv" />
|
||||
<mimeMap fileExtension=".wvx" mimeType="video/x-ms-wvx" />
|
||||
<mimeMap fileExtension=".x" mimeType="application/directx" />
|
||||
<mimeMap fileExtension=".xaf" mimeType="x-world/x-vrml" />
|
||||
<mimeMap fileExtension=".xaml" mimeType="application/xaml+xml" />
|
||||
<mimeMap fileExtension=".xap" mimeType="application/x-silverlight-app" />
|
||||
<mimeMap fileExtension=".xbap" mimeType="application/x-ms-xbap" />
|
||||
<mimeMap fileExtension=".xbm" mimeType="image/x-xbitmap" />
|
||||
<mimeMap fileExtension=".xdr" mimeType="text/plain" />
|
||||
<mimeMap fileExtension=".xht" mimeType="application/xhtml+xml" />
|
||||
<mimeMap fileExtension=".xhtml" mimeType="application/xhtml+xml" />
|
||||
<mimeMap fileExtension=".xla" mimeType="application/vnd.ms-excel" />
|
||||
<mimeMap fileExtension=".xlam" mimeType="application/vnd.ms-excel.addin.macroEnabled.12" />
|
||||
<mimeMap fileExtension=".xlc" mimeType="application/vnd.ms-excel" />
|
||||
<mimeMap fileExtension=".xlm" mimeType="application/vnd.ms-excel" />
|
||||
<mimeMap fileExtension=".xls" mimeType="application/vnd.ms-excel" />
|
||||
<mimeMap fileExtension=".xlsb" mimeType="application/vnd.ms-excel.sheet.binary.macroEnabled.12" />
|
||||
<mimeMap fileExtension=".xlsm" mimeType="application/vnd.ms-excel.sheet.macroEnabled.12" />
|
||||
<mimeMap fileExtension=".xlsx" mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.sheet" />
|
||||
<mimeMap fileExtension=".xlt" mimeType="application/vnd.ms-excel" />
|
||||
<mimeMap fileExtension=".xltm" mimeType="application/vnd.ms-excel.template.macroEnabled.12" />
|
||||
<mimeMap fileExtension=".xltx" mimeType="application/vnd.openxmlformats-officedocument.spreadsheetml.template" />
|
||||
<mimeMap fileExtension=".xlw" mimeType="application/vnd.ms-excel" />
|
||||
<mimeMap fileExtension=".xml" mimeType="text/xml" />
|
||||
<mimeMap fileExtension=".xof" mimeType="x-world/x-vrml" />
|
||||
<mimeMap fileExtension=".xpm" mimeType="image/x-xpixmap" />
|
||||
<mimeMap fileExtension=".xps" mimeType="application/vnd.ms-xpsdocument" />
|
||||
<mimeMap fileExtension=".xsd" mimeType="text/xml" />
|
||||
<mimeMap fileExtension=".xsf" mimeType="text/xml" />
|
||||
<mimeMap fileExtension=".xsl" mimeType="text/xml" />
|
||||
<mimeMap fileExtension=".xslt" mimeType="text/xml" />
|
||||
<mimeMap fileExtension=".xsn" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".xtp" mimeType="application/octet-stream" />
|
||||
<mimeMap fileExtension=".xwd" mimeType="image/x-xwindowdump" />
|
||||
<mimeMap fileExtension=".z" mimeType="application/x-compress" />
|
||||
<mimeMap fileExtension=".zip" mimeType="application/x-zip-compressed" />
|
||||
</staticContent>
|
||||
|
||||
<tracing>
|
||||
|
||||
<traceProviderDefinitions>
|
||||
<add name="WWW Server" guid="{3a2a4e84-4c21-4981-ae10-3fda0d9b0f83}">
|
||||
<areas>
|
||||
<clear />
|
||||
<add name="Authentication" value="2" />
|
||||
<add name="Security" value="4" />
|
||||
<add name="Filter" value="8" />
|
||||
<add name="StaticFile" value="16" />
|
||||
<add name="CGI" value="32" />
|
||||
<add name="Compression" value="64" />
|
||||
<add name="Cache" value="128" />
|
||||
<add name="RequestNotifications" value="256" />
|
||||
<add name="Module" value="512" />
|
||||
<add name="Rewrite" value="1024" />
|
||||
<add name="FastCGI" value="4096" />
|
||||
<add name="WebSocket" value="16384" />
|
||||
</areas>
|
||||
</add>
|
||||
<add name="ASP" guid="{06b94d9a-b15e-456e-a4ef-37c984a2cb4b}">
|
||||
<areas>
|
||||
<clear />
|
||||
</areas>
|
||||
</add>
|
||||
<add name="ISAPI Extension" guid="{a1c2040e-8840-4c31-ba11-9871031a19ea}">
|
||||
<areas>
|
||||
<clear />
|
||||
</areas>
|
||||
</add>
|
||||
<add name="ASPNET" guid="{AFF081FE-0247-4275-9C4E-021F3DC1DA35}">
|
||||
<areas>
|
||||
<add name="Infrastructure" value="1" />
|
||||
<add name="Module" value="2" />
|
||||
<add name="Page" value="4" />
|
||||
<add name="AppServices" value="8" />
|
||||
</areas>
|
||||
</add>
|
||||
</traceProviderDefinitions>
|
||||
|
||||
<traceFailedRequests>
|
||||
<add path="*">
|
||||
<traceAreas>
|
||||
<add provider="ASP" verbosity="Verbose" />
|
||||
<add provider="ASPNET" areas="Infrastructure,Module,Page,AppServices" verbosity="Verbose" />
|
||||
<add provider="ISAPI Extension" verbosity="Verbose" />
|
||||
<add provider="WWW Server" areas="Authentication,Security,Filter,StaticFile,CGI,Compression,Cache,RequestNotifications,Module,Rewrite,WebSocket" verbosity="Verbose" />
|
||||
</traceAreas>
|
||||
<failureDefinitions statusCodes="200-999" />
|
||||
</add>
|
||||
</traceFailedRequests>
|
||||
|
||||
</tracing>
|
||||
|
||||
<urlCompression />
|
||||
|
||||
<validation />
|
||||
<webdav>
|
||||
<globalSettings>
|
||||
<propertyStores>
|
||||
<add name="webdav_simple_prop" image="%IIS_BIN%\webdav_simple_prop.dll" image32="%IIS_BIN%\webdav_simple_prop.dll" />
|
||||
</propertyStores>
|
||||
<lockStores>
|
||||
<add name="webdav_simple_lock" image="%IIS_BIN%\webdav_simple_lock.dll" image32="%IIS_BIN%\webdav_simple_lock.dll" />
|
||||
</lockStores>
|
||||
|
||||
</globalSettings>
|
||||
<authoring>
|
||||
<locks enabled="true" lockStore="webdav_simple_lock" />
|
||||
</authoring>
|
||||
<authoringRules />
|
||||
</webdav>
|
||||
<applicationInitialization />
|
||||
<webSocket />
|
||||
|
||||
</system.webServer>
|
||||
<location path="" overrideMode="Allow">
|
||||
<system.webServer>
|
||||
<modules>
|
||||
<add name="DynamicCompressionModule" lockItem="true" />
|
||||
<add name="StaticCompressionModule" lockItem="true" />
|
||||
<add name="DefaultDocumentModule" lockItem="true" />
|
||||
<add name="DirectoryListingModule" lockItem="true" />
|
||||
<add name="IsapiFilterModule" lockItem="true" />
|
||||
<add name="ProtocolSupportModule" lockItem="true" />
|
||||
<add name="HttpRedirectionModule" lockItem="true" />
|
||||
<add name="ServerSideIncludeModule" lockItem="true" />
|
||||
<add name="StaticFileModule" lockItem="true" />
|
||||
<add name="AnonymousAuthenticationModule" lockItem="true" />
|
||||
<add name="CertificateMappingAuthenticationModule" lockItem="true" />
|
||||
<add name="UrlAuthorizationModule" lockItem="true" />
|
||||
<add name="BasicAuthenticationModule" lockItem="true" />
|
||||
<add name="WindowsAuthenticationModule" lockItem="true" />
|
||||
<add name="IISCertificateMappingAuthenticationModule" lockItem="true" />
|
||||
<add name="WebMatrixSupportModule" lockItem="true" />
|
||||
<add name="IpRestrictionModule" lockItem="true" />
|
||||
<add name="DynamicIpRestrictionModule" lockItem="true" />
|
||||
<add name="RequestFilteringModule" lockItem="true" />
|
||||
<add name="CustomLoggingModule" lockItem="true" />
|
||||
<add name="CustomErrorModule" lockItem="true" />
|
||||
<add name="IsapiModule" lockItem="true" />
|
||||
<add name="HttpLoggingModule" lockItem="true" />
|
||||
<add name="FailedRequestsTracingModule" lockItem="true" />
|
||||
<add name="CgiModule" lockItem="true" />
|
||||
<add name="FastCgiModule" lockItem="true" />
|
||||
<add name="RewriteModule" />
|
||||
<add name="OutputCache" type="System.Web.Caching.OutputCacheModule" preCondition="managedHandler" />
|
||||
<add name="Session" type="System.Web.SessionState.SessionStateModule" preCondition="managedHandler" />
|
||||
<add name="WindowsAuthentication" type="System.Web.Security.WindowsAuthenticationModule" preCondition="managedHandler" />
|
||||
<add name="FormsAuthentication" type="System.Web.Security.FormsAuthenticationModule" preCondition="managedHandler" />
|
||||
<add name="DefaultAuthentication" type="System.Web.Security.DefaultAuthenticationModule" preCondition="managedHandler" />
|
||||
<add name="RoleManager" type="System.Web.Security.RoleManagerModule" preCondition="managedHandler" />
|
||||
<add name="UrlAuthorization" type="System.Web.Security.UrlAuthorizationModule" preCondition="managedHandler" />
|
||||
<add name="FileAuthorization" type="System.Web.Security.FileAuthorizationModule" preCondition="managedHandler" />
|
||||
<add name="AnonymousIdentification" type="System.Web.Security.AnonymousIdentificationModule" preCondition="managedHandler" />
|
||||
<add name="Profile" type="System.Web.Profile.ProfileModule" preCondition="managedHandler" />
|
||||
<add name="UrlMappingsModule" type="System.Web.UrlMappingsModule" preCondition="managedHandler" />
|
||||
<add name="ApplicationInitializationModule" lockItem="true" />
|
||||
<add name="WebSocketModule" lockItem="true" />
|
||||
<add name="ServiceModel-4.0" type="System.ServiceModel.Activation.ServiceHttpModule,System.ServiceModel.Activation,Version=4.0.0.0,Culture=neutral,PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler,runtimeVersionv4.0" />
|
||||
<add name="ConfigurationValidationModule" lockItem="true" />
|
||||
<add name="UrlRoutingModule-4.0" type="System.Web.Routing.UrlRoutingModule" preCondition="managedHandler,runtimeVersionv4.0" />
|
||||
<add name="ScriptModule-4.0" type="System.Web.Handlers.ScriptModule, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="managedHandler,runtimeVersionv4.0" />
|
||||
<add name="ServiceModel" type="System.ServiceModel.Activation.HttpModule, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="managedHandler,runtimeVersionv2.0" />
|
||||
</modules>
|
||||
<handlers accessPolicy="Read, Script">
|
||||
<add name="AXD-ISAPI-4.0_64bit" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="PageHandlerFactory-ISAPI-4.0_64bit" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="SimpleHandlerFactory-ISAPI-4.0_64bit" path="*.ashx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="WebServiceHandlerFactory-ISAPI-4.0_64bit" path="*.asmx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="HttpRemotingHandlerFactory-rem-ISAPI-4.0_64bit" path="*.rem" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="HttpRemotingHandlerFactory-soap-ISAPI-4.0_64bit" path="*.soap" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="svc-ISAPI-4.0_64bit" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
|
||||
<add name="rules-ISAPI-4.0_64bit" path="*.rules" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
|
||||
<add name="xoml-ISAPI-4.0_64bit" path="*.xoml" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
|
||||
<add name="xamlx-ISAPI-4.0_64bit" path="*.xamlx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" />
|
||||
<add name="aspq-ISAPI-4.0_64bit" path="*.aspq" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="cshtm-ISAPI-4.0_64bit" path="*.cshtm" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="cshtml-ISAPI-4.0_64bit" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="vbhtm-ISAPI-4.0_64bit" path="*.vbhtm" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="vbhtml-ISAPI-4.0_64bit" path="*.vbhtml" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="svc-Integrated" path="*.svc" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||
<add name="svc-ISAPI-2.0" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
|
||||
<add name="xoml-Integrated" path="*.xoml" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||
<add name="xoml-ISAPI-2.0" path="*.xoml" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
|
||||
<add name="rules-Integrated" path="*.rules" verb="*" type="System.ServiceModel.Activation.HttpHandler, System.ServiceModel, Version=3.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||
<add name="rules-ISAPI-2.0" path="*.rules" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" />
|
||||
<add name="AXD-ISAPI-4.0_32bit" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="PageHandlerFactory-ISAPI-4.0_32bit" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="SimpleHandlerFactory-ISAPI-4.0_32bit" path="*.ashx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="WebServiceHandlerFactory-ISAPI-4.0_32bit" path="*.asmx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="HttpRemotingHandlerFactory-rem-ISAPI-4.0_32bit" path="*.rem" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="HttpRemotingHandlerFactory-soap-ISAPI-4.0_32bit" path="*.soap" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="svc-ISAPI-4.0_32bit" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
|
||||
<add name="rules-ISAPI-4.0_32bit" path="*.rules" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
|
||||
<add name="xoml-ISAPI-4.0_32bit" path="*.xoml" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
|
||||
<add name="xamlx-ISAPI-4.0_32bit" path="*.xamlx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" />
|
||||
<add name="aspq-ISAPI-4.0_32bit" path="*.aspq" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="cshtm-ISAPI-4.0_32bit" path="*.cshtm" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="cshtml-ISAPI-4.0_32bit" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="vbhtm-ISAPI-4.0_32bit" path="*.vbhtm" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="vbhtml-ISAPI-4.0_32bit" path="*.vbhtml" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="TraceHandler-Integrated-4.0" path="trace.axd" verb="GET,HEAD,POST,DEBUG" type="System.Web.Handlers.TraceHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="WebAdminHandler-Integrated-4.0" path="WebAdmin.axd" verb="GET,DEBUG" type="System.Web.Handlers.WebAdminHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="AssemblyResourceLoader-Integrated-4.0" path="WebResource.axd" verb="GET,DEBUG" type="System.Web.Handlers.AssemblyResourceLoader" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="PageHandlerFactory-Integrated-4.0" path="*.aspx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="SimpleHandlerFactory-Integrated-4.0" path="*.ashx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.SimpleHandlerFactory" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="WebServiceHandlerFactory-Integrated-4.0" path="*.asmx" verb="GET,HEAD,POST,DEBUG" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="HttpRemotingHandlerFactory-rem-Integrated-4.0" path="*.rem" verb="GET,HEAD,POST,DEBUG" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="HttpRemotingHandlerFactory-soap-Integrated-4.0" path="*.soap" verb="GET,HEAD,POST,DEBUG" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory, System.Runtime.Remoting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="svc-Integrated-4.0" path="*.svc" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="rules-Integrated-4.0" path="*.rules" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="xoml-Integrated-4.0" path="*.xoml" verb="*" type="System.ServiceModel.Activation.ServiceHttpHandlerFactory, System.ServiceModel.Activation, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="xamlx-Integrated-4.0" path="*.xamlx" verb="GET,HEAD,POST,DEBUG" type="System.Xaml.Hosting.XamlHttpHandlerFactory, System.Xaml.Hosting, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="aspq-Integrated-4.0" path="*.aspq" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="cshtm-Integrated-4.0" path="*.cshtm" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="cshtml-Integrated-4.0" path="*.cshtml" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="vbhtm-Integrated-4.0" path="*.vbhtm" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="vbhtml-Integrated-4.0" path="*.vbhtml" verb="GET,HEAD,POST,DEBUG" type="System.Web.HttpForbiddenHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="ScriptHandlerFactoryAppServices-Integrated-4.0" path="*_AppService.axd" verb="*" type="System.Web.Script.Services.ScriptHandlerFactory, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="ScriptResourceIntegrated-4.0" path="*ScriptResource.axd" verb="GET,HEAD" type="System.Web.Handlers.ScriptResourceHandler, System.Web.Extensions, Version=4.0.0.0, Culture=neutral, PublicKeyToken=31BF3856AD364E35" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
<add name="ASPClassic" path="*.asp" verb="GET,HEAD,POST" modules="IsapiModule" scriptProcessor="%IIS_BIN%\asp.dll" resourceType="File" />
|
||||
<add name="SecurityCertificate" path="*.cer" verb="GET,HEAD,POST" modules="IsapiModule" scriptProcessor="%IIS_BIN%\asp.dll" resourceType="File" />
|
||||
<add name="ISAPI-dll" path="*.dll" verb="*" modules="IsapiModule" resourceType="File" requireAccess="Execute" allowPathInfo="true" />
|
||||
<add name="TraceHandler-Integrated" path="trace.axd" verb="GET,HEAD,POST,DEBUG" type="System.Web.Handlers.TraceHandler" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||
<add name="WebAdminHandler-Integrated" path="WebAdmin.axd" verb="GET,DEBUG" type="System.Web.Handlers.WebAdminHandler" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||
<add name="AssemblyResourceLoader-Integrated" path="WebResource.axd" verb="GET,DEBUG" type="System.Web.Handlers.AssemblyResourceLoader" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||
<add name="PageHandlerFactory-Integrated" path="*.aspx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.PageHandlerFactory" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||
<add name="SimpleHandlerFactory-Integrated" path="*.ashx" verb="GET,HEAD,POST,DEBUG" type="System.Web.UI.SimpleHandlerFactory" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||
<add name="WebServiceHandlerFactory-Integrated" path="*.asmx" verb="GET,HEAD,POST,DEBUG" type="System.Web.Services.Protocols.WebServiceHandlerFactory,System.Web.Services,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b03f5f7f11d50a3a" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||
<add name="HttpRemotingHandlerFactory-rem-Integrated" path="*.rem" verb="GET,HEAD,POST,DEBUG" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory,System.Runtime.Remoting,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||
<add name="HttpRemotingHandlerFactory-soap-Integrated" path="*.soap" verb="GET,HEAD,POST,DEBUG" type="System.Runtime.Remoting.Channels.Http.HttpRemotingHandlerFactory,System.Runtime.Remoting,Version=2.0.0.0,Culture=neutral,PublicKeyToken=b77a5c561934e089" preCondition="integratedMode,runtimeVersionv2.0" />
|
||||
<add name="AXD-ISAPI-2.0" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="PageHandlerFactory-ISAPI-2.0" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="SimpleHandlerFactory-ISAPI-2.0" path="*.ashx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="WebServiceHandlerFactory-ISAPI-2.0" path="*.asmx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="HttpRemotingHandlerFactory-rem-ISAPI-2.0" path="*.rem" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="HttpRemotingHandlerFactory-soap-ISAPI-2.0" path="*.soap" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="svc-ISAPI-2.0-64" path="*.svc" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
|
||||
<add name="AXD-ISAPI-2.0-64" path="*.axd" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="PageHandlerFactory-ISAPI-2.0-64" path="*.aspx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="SimpleHandlerFactory-ISAPI-2.0-64" path="*.ashx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="WebServiceHandlerFactory-ISAPI-2.0-64" path="*.asmx" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="HttpRemotingHandlerFactory-rem-ISAPI-2.0-64" path="*.rem" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="HttpRemotingHandlerFactory-soap-ISAPI-2.0-64" path="*.soap" verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="rules-64-ISAPI-2.0" path="*.rules" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
|
||||
<add name="xoml-64-ISAPI-2.0" path="*.xoml" verb="*" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v2.0.50727\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv2.0,bitness64" />
|
||||
<add name="CGI-exe" path="*.exe" verb="*" modules="CgiModule" resourceType="File" requireAccess="Execute" allowPathInfo="true" />
|
||||
<add name="SSINC-stm" path="*.stm" verb="GET,HEAD,POST" modules="ServerSideIncludeModule" resourceType="File" />
|
||||
<add name="SSINC-shtm" path="*.shtm" verb="GET,HEAD,POST" modules="ServerSideIncludeModule" resourceType="File" />
|
||||
<add name="SSINC-shtml" path="*.shtml" verb="GET,HEAD,POST" modules="ServerSideIncludeModule" resourceType="File" />
|
||||
<add name="TRACEVerbHandler" path="*" verb="TRACE" modules="ProtocolSupportModule" requireAccess="None" />
|
||||
<add name="OPTIONSVerbHandler" path="*" verb="OPTIONS" modules="ProtocolSupportModule" requireAccess="None" />
|
||||
<add name="ExtensionlessUrl-ISAPI-4.0_32bit" path="*." verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness32" responseBufferLimit="0" />
|
||||
<add name="ExtensionlessUrlHandler-ISAPI-4.0_64bit" path="*." verb="GET,HEAD,POST,DEBUG" modules="IsapiModule" scriptProcessor="%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_isapi.dll" preCondition="classicMode,runtimeVersionv4.0,bitness64" responseBufferLimit="0" />
|
||||
<add name="ExtensionlessUrl-Integrated-4.0" path="*." verb="GET,HEAD,POST,DEBUG" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" responseBufferLimit="0" />
|
||||
<add name="StaticFile" path="*" verb="*" modules="StaticFileModule,DefaultDocumentModule,DirectoryListingModule" resourceType="Either" requireAccess="Read" />
|
||||
</handlers>
|
||||
</system.webServer>
|
||||
</location>
|
||||
</configuration>
|
|
@ -0,0 +1,24 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("FunctionalTests")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("FunctionalTests")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("4f802e03-8152-4930-9ebc-794e7f1e718e")]
|
||||
|
|
@ -0,0 +1,133 @@
|
|||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="TelemetryExtensions.cs" company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Functional.Helpers
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Reactive.Linq;
|
||||
|
||||
using Microsoft.Developer.Analytics.DataCollection.Model.v2;
|
||||
|
||||
public static class TelemetryExtensions
|
||||
{
|
||||
public static TelemetryItem[] ReceiveItems(
|
||||
this HttpListenerObservable listener,
|
||||
int count,
|
||||
int timeOut)
|
||||
{
|
||||
if (null == listener)
|
||||
{
|
||||
throw new ArgumentNullException("listener");
|
||||
}
|
||||
|
||||
var result = listener
|
||||
.Where(item => !(item is TelemetryItem<RemoteDependencyData>))
|
||||
.TakeUntil(DateTimeOffset.UtcNow.AddMilliseconds(timeOut))
|
||||
.Take(count)
|
||||
.ToEnumerable()
|
||||
.ToArray();
|
||||
|
||||
if (result.Length != count)
|
||||
{
|
||||
throw new InvalidDataException("Incorrect number of items. Expected: " + count + " Received: " + result.Length);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static T[] ReceiveItemsOfType<T>(
|
||||
this HttpListenerObservable listener,
|
||||
int count,
|
||||
int timeOut)
|
||||
{
|
||||
var result = listener
|
||||
.Where(item => (item is T))
|
||||
.Cast<T>()
|
||||
.TakeUntil(DateTimeOffset.UtcNow.AddMilliseconds(timeOut))
|
||||
.Take(count)
|
||||
.ToEnumerable()
|
||||
.ToArray();
|
||||
|
||||
if (result.Length != count)
|
||||
{
|
||||
throw new InvalidDataException("Incorrect number of items. Expected: " + count + " Received: " + result.Length);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static TelemetryItem[] ReceiveItemsOfTypes<T1, T2>(
|
||||
this HttpListenerObservable listener,
|
||||
int count,
|
||||
int timeOut)
|
||||
{
|
||||
var result = listener
|
||||
.Where(item => ((item is T1) || (item is T2)))
|
||||
.TakeUntil(DateTimeOffset.UtcNow.AddMilliseconds(timeOut))
|
||||
.Take(count)
|
||||
.ToEnumerable()
|
||||
.ToArray();
|
||||
|
||||
if (result.Length != count)
|
||||
{
|
||||
throw new InvalidDataException("Incorrect number of items. Expected: " + count + " Received: " + result.Length);
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
|
||||
public static TelemetryItem[] ReceiveAllItemsDuringTime(
|
||||
this HttpListenerObservable listener,
|
||||
int timeOut)
|
||||
{
|
||||
if (null == listener)
|
||||
{
|
||||
throw new ArgumentNullException("listener");
|
||||
}
|
||||
|
||||
return listener
|
||||
.Where(item => !(item is TelemetryItem<RemoteDependencyData>))
|
||||
.TakeUntil(DateTimeOffset.UtcNow.AddMilliseconds(timeOut))
|
||||
.ToEnumerable()
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
public static T[] ReceiveAllItemsDuringTimeOfType<T>(
|
||||
this HttpListenerObservable listener,
|
||||
int timeOut)
|
||||
{
|
||||
if (null == listener)
|
||||
{
|
||||
throw new ArgumentNullException("listener");
|
||||
}
|
||||
|
||||
return listener
|
||||
.TakeUntil(DateTimeOffset.UtcNow.AddMilliseconds(timeOut))
|
||||
.Where(item => (item is T))
|
||||
.Cast<T>()
|
||||
.ToEnumerable()
|
||||
.ToArray();
|
||||
}
|
||||
|
||||
public static TelemetryItem[] ReceiveAllItemsDuringTimeOfType<T1, T2>(
|
||||
this HttpListenerObservable listener,
|
||||
int timeOut)
|
||||
{
|
||||
if (null == listener)
|
||||
{
|
||||
throw new ArgumentNullException("listener");
|
||||
}
|
||||
|
||||
return listener
|
||||
.TakeUntil(DateTimeOffset.UtcNow.AddMilliseconds(timeOut))
|
||||
.Where(item => ((item is T1) || (item is T2)))
|
||||
.ToEnumerable()
|
||||
.ToArray();
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,93 @@
|
|||
namespace Functional.Serialization
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using Microsoft.Developer.Analytics.DataCollection.Model.v2;
|
||||
using Newtonsoft.Json;
|
||||
using TelemetryItem = Microsoft.Developer.Analytics.DataCollection.Model.v2.TelemetryItem;
|
||||
|
||||
internal static class TelemetryItemFactory
|
||||
{
|
||||
public static IList<TelemetryItem> GetTelemetryItems(string content)
|
||||
{
|
||||
var items = new List<TelemetryItem>();
|
||||
|
||||
if (string.IsNullOrWhiteSpace(content))
|
||||
{
|
||||
return items;
|
||||
}
|
||||
|
||||
var newLines = new [] { "\r\n", "\n" };
|
||||
|
||||
string[] lines = content.Split(newLines, StringSplitOptions.RemoveEmptyEntries);
|
||||
foreach (string line in lines)
|
||||
{
|
||||
var envelope = JsonConvert.DeserializeObject<Envelope>(line);
|
||||
var item = CreateTelemetryItem(envelope, line);
|
||||
items.Add(item);
|
||||
}
|
||||
|
||||
return items;
|
||||
}
|
||||
|
||||
private static TelemetryItem CreateTelemetryItem(
|
||||
Envelope envelope,
|
||||
string content)
|
||||
{
|
||||
TelemetryItem result;
|
||||
|
||||
switch (envelope.Data.BaseType)
|
||||
{
|
||||
case TelemetryItem.ExceptionName:
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<TelemetryItem<ExceptionData>>(content);
|
||||
break;
|
||||
}
|
||||
|
||||
case TelemetryItem.RequestName:
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<TelemetryItem<RequestData>>(content);
|
||||
break;
|
||||
}
|
||||
|
||||
case TelemetryItem.MetricName:
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<TelemetryItem<MetricData>>(content);
|
||||
break;
|
||||
}
|
||||
|
||||
case TelemetryItem.RemoteDependencyName:
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<TelemetryItem<RemoteDependencyData>>(content);
|
||||
break;
|
||||
}
|
||||
|
||||
case TelemetryItem.MessageName:
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<TelemetryItem<MessageData>>(content);
|
||||
break;
|
||||
}
|
||||
|
||||
case TelemetryItem.SessionStateName:
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<TelemetryItem<SessionStateData>>(content);
|
||||
break;
|
||||
}
|
||||
|
||||
case TelemetryItem.PerformanceCounterName:
|
||||
{
|
||||
result = JsonConvert.DeserializeObject<TelemetryItem<PerformanceCounterData>>(content);
|
||||
break;
|
||||
}
|
||||
|
||||
default:
|
||||
{
|
||||
throw new InvalidDataException("Unsupported telemetry type");
|
||||
}
|
||||
}
|
||||
|
||||
return result;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,105 @@
|
|||
using PerfCounterCollector.FunctionalTests;
|
||||
|
||||
namespace FunctionalTests
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Net.Http;
|
||||
|
||||
using Functional.Helpers;
|
||||
using Functional.IisExpress;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
public class Test40 : SingleWebHostTestBase
|
||||
{
|
||||
private const int TimeoutInMs = 10000;
|
||||
|
||||
private const string TestWebApplicaionSourcePath = @"TestApps\TestApp40\App";
|
||||
private const string TestWebApplicaionDestPath = @"TestsPerformanceCollector40";
|
||||
|
||||
[TestInitialize]
|
||||
public void TestInitialize()
|
||||
{
|
||||
var applicationDirectory = Path.Combine(
|
||||
Directory.GetCurrentDirectory(),
|
||||
TestWebApplicaionDestPath);
|
||||
|
||||
Trace.WriteLine("Application directory:" + applicationDirectory);
|
||||
|
||||
this.StartWebAppHost(
|
||||
new SingleWebHostTestConfiguration(
|
||||
new IisExpressConfiguration
|
||||
{
|
||||
ApplicationPool = IisExpressAppPools.Clr4IntegratedAppPool,
|
||||
Path = applicationDirectory,
|
||||
Port = 5679,
|
||||
})
|
||||
{
|
||||
TelemetryListenerPort = 7654,
|
||||
//AttachDebugger = Debugger.IsAttached,
|
||||
IKey = "11223344-1122-3344-1122-334411222233",
|
||||
});
|
||||
|
||||
this.LaunchAndVerifyApplication();
|
||||
}
|
||||
|
||||
[TestCleanup]
|
||||
public void TestCleanup()
|
||||
{
|
||||
this.StopWebAppHost();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Owner("alkaplan")]
|
||||
[DeploymentItem(TestWebApplicaionSourcePath, TestWebApplicaionDestPath)]
|
||||
public void DefaultCounterCollection()
|
||||
{
|
||||
CommonTests.DefaultCounterCollection(this.Listener);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Owner("alkaplan")]
|
||||
[DeploymentItem(TestWebApplicaionSourcePath, TestWebApplicaionDestPath)]
|
||||
public void CustomCounterCollection()
|
||||
{
|
||||
CommonTests.CustomCounterCollection(this.Listener);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Owner("alkaplan")]
|
||||
[DeploymentItem(TestWebApplicaionSourcePath, TestWebApplicaionDestPath)]
|
||||
public void NonExistentCounter()
|
||||
{
|
||||
CommonTests.NonExistentCounter(this.Listener);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Owner("alkaplan")]
|
||||
[DeploymentItem(TestWebApplicaionSourcePath, TestWebApplicaionDestPath)]
|
||||
public void NonParsableCounter()
|
||||
{
|
||||
CommonTests.NonParsableCounter(this.Listener);
|
||||
}
|
||||
|
||||
private void LaunchAndVerifyApplication()
|
||||
{
|
||||
const string RequestPath = "aspx/TestWebForm.aspx";
|
||||
string expectedRequestUrl = this.Config.ApplicationUri + "/" + RequestPath;
|
||||
|
||||
// spin up the application
|
||||
var client = new HttpClient();
|
||||
var requestMessage = new HttpRequestMessage { RequestUri = new Uri(expectedRequestUrl), Method = HttpMethod.Get, };
|
||||
|
||||
var responseTask = client.SendAsync(requestMessage);
|
||||
responseTask.Wait(TimeoutInMs);
|
||||
var responseTextTask = responseTask.Result.Content.ReadAsStringAsync();
|
||||
responseTextTask.Wait(TimeoutInMs);
|
||||
|
||||
// make sure it's the correct application
|
||||
Assert.AreEqual("PerformanceCollector application", responseTextTask.Result);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,108 @@
|
|||
using PerfCounterCollector.FunctionalTests;
|
||||
|
||||
namespace FunctionalTests
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net.Http;
|
||||
using System.Runtime.Versioning;
|
||||
|
||||
using Functional.Helpers;
|
||||
using Functional.IisExpress;
|
||||
using Microsoft.Developer.Analytics.DataCollection.Model.v2;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
[TestClass]
|
||||
public class Test45 : SingleWebHostTestBase
|
||||
{
|
||||
private const int TimeoutInMs = 10000;
|
||||
|
||||
private const string TestWebApplicaionSourcePath = @"TestApps\TestApp45\App";
|
||||
private const string TestWebApplicaionDestPath = @"TestsPerformanceCollector45";
|
||||
|
||||
[TestInitialize]
|
||||
public void TestInitialize()
|
||||
{
|
||||
var applicationDirectory = Path.Combine(
|
||||
Directory.GetCurrentDirectory(),
|
||||
TestWebApplicaionDestPath);
|
||||
|
||||
Trace.WriteLine("Application directory:" + applicationDirectory);
|
||||
|
||||
this.StartWebAppHost(
|
||||
new SingleWebHostTestConfiguration(
|
||||
new IisExpressConfiguration
|
||||
{
|
||||
ApplicationPool = IisExpressAppPools.Clr4IntegratedAppPool,
|
||||
Path = applicationDirectory,
|
||||
Port = 5678,
|
||||
})
|
||||
{
|
||||
TelemetryListenerPort = 4554,
|
||||
// AttachDebugger = Debugger.IsAttached,
|
||||
IKey = "00000000-D231-45B6-8DD4-D344C309AE69",
|
||||
});
|
||||
|
||||
this.LaunchAndVerifyApplication();
|
||||
}
|
||||
|
||||
[TestCleanup]
|
||||
public void TestCleanup()
|
||||
{
|
||||
this.StopWebAppHost();
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Owner("alkaplan")]
|
||||
[DeploymentItem(TestWebApplicaionSourcePath, TestWebApplicaionDestPath)]
|
||||
public void DefaultCounterCollection()
|
||||
{
|
||||
CommonTests.DefaultCounterCollection(this.Listener);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Owner("alkaplan")]
|
||||
[DeploymentItem(TestWebApplicaionSourcePath, TestWebApplicaionDestPath)]
|
||||
public void CustomCounterCollection()
|
||||
{
|
||||
CommonTests.CustomCounterCollection(this.Listener);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Owner("alkaplan")]
|
||||
[DeploymentItem(TestWebApplicaionSourcePath, TestWebApplicaionDestPath)]
|
||||
public void NonExistentCounter()
|
||||
{
|
||||
CommonTests.NonExistentCounter(this.Listener);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[Owner("alkaplan")]
|
||||
[DeploymentItem(TestWebApplicaionSourcePath, TestWebApplicaionDestPath)]
|
||||
public void NonParsableCounter()
|
||||
{
|
||||
CommonTests.NonParsableCounter(this.Listener);
|
||||
}
|
||||
|
||||
private void LaunchAndVerifyApplication()
|
||||
{
|
||||
const string RequestPath = "aspx/TestWebForm.aspx";
|
||||
string expectedRequestUrl = this.Config.ApplicationUri + "/" + RequestPath;
|
||||
|
||||
// spin up the application
|
||||
var client = new HttpClient();
|
||||
var requestMessage = new HttpRequestMessage { RequestUri = new Uri(expectedRequestUrl), Method = HttpMethod.Get, };
|
||||
|
||||
var responseTask = client.SendAsync(requestMessage);
|
||||
responseTask.Wait(TimeoutInMs);
|
||||
var responseTextTask = responseTask.Result.Content.ReadAsStringAsync();
|
||||
responseTextTask.Wait(TimeoutInMs);
|
||||
|
||||
// make sure it's the correct application
|
||||
Assert.AreEqual("PerformanceCollector application", responseTextTask.Result);
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
|
||||
<InstrumentationKey>11223344-1122-3344-1122-334411222233</InstrumentationKey>
|
||||
<TelemetryInitializers>
|
||||
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer" />
|
||||
<Add Type="Microsoft.ApplicationInsights.WindowsServer.DomainNameRoleInstanceTelemetryInitializer, Microsoft.AI.WindowsServer" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Web.OperationNameTelemetryInitializer, Microsoft.AI.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Web.OperationCorrelationTelemetryInitializer, Microsoft.AI.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Web.UserTelemetryInitializer, Microsoft.AI.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Web.SessionTelemetryInitializer, Microsoft.AI.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.WindowsServer.BuildInfoConfigComponentVersionTelemetryInitializer, Microsoft.AI.WindowsServer"/>
|
||||
</TelemetryInitializers>
|
||||
<TelemetryModules>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnosticsTelemetryModule, Microsoft.ApplicationInsights" >
|
||||
<Severity>Verbose</Severity>
|
||||
</Add>
|
||||
<Add Type="Microsoft.ApplicationInsights.Web.RequestTrackingTelemetryModule, Microsoft.AI.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Web.ExceptionTrackingTelemetryModule, Microsoft.AI.Web" />
|
||||
</TelemetryModules>
|
||||
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel">
|
||||
<EndpointAddress>http://LocalHost:7654/v2/track</EndpointAddress>
|
||||
<DeveloperMode>true</DeveloperMode>
|
||||
</TelemetryChannel>
|
||||
</ApplicationInsights>
|
|
@ -0,0 +1,11 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestWebForm.aspx.cs" Inherits="TestApp40.Aspx.TestWebForm" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>TestWebForm.aspx</title>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,15 @@
|
|||
namespace TestApp40.Aspx
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
public partial class TestWebForm : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
Response.Clear();
|
||||
Response.Write("PerformanceCollector application");
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
}
|
15
PerformanceCollector/PerformanceCollector.Tests/FunctionalTests/TestApps/TestApp40/Aspx/TestWebForm.aspx.designer.cs
сгенерированный
Normal file
15
PerformanceCollector/PerformanceCollector.Tests/FunctionalTests/TestApps/TestApp40/Aspx/TestWebForm.aspx.designer.cs
сгенерированный
Normal file
|
@ -0,0 +1,15 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace TestApp40.Aspx {
|
||||
|
||||
|
||||
public partial class TestWebForm {
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
<%@ Application Codebehind="Global.asax.cs" Inherits="TestApp40.Global" Language="C#" %>
|
|
@ -0,0 +1,88 @@
|
|||
namespace TestApp40
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
|
||||
using Microsoft.ApplicationInsights;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.Extensibility.Implementation;
|
||||
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
public class Global : System.Web.HttpApplication
|
||||
{
|
||||
|
||||
protected void Application_Start(object sender, EventArgs e)
|
||||
{
|
||||
var setting = ConfigurationManager.AppSettings["TestApp.SendTelemetyIntemOnAppStart"];
|
||||
|
||||
if (false == string.IsNullOrWhiteSpace(setting) && true == bool.Parse(setting))
|
||||
{
|
||||
new TelemetryClient().TrackTrace("Application_Start");
|
||||
}
|
||||
|
||||
var module = new PerformanceCollectorModule();
|
||||
|
||||
// set test-friendly timings
|
||||
var privateObject = new PrivateObject(module);
|
||||
privateObject.SetField("collectionPeriod", TimeSpan.FromMilliseconds(10));
|
||||
privateObject.SetField(
|
||||
"defaultCounters",
|
||||
new List<string>() { @"\Memory\Available Bytes", @"Will not parse;\Does\NotExist" });
|
||||
|
||||
module.Counters.Add(
|
||||
new PerformanceCounterCollectionRequest(@"Will not parse", "Custom counter - will not parse"));
|
||||
|
||||
module.Counters.Add(
|
||||
new PerformanceCounterCollectionRequest(@"\Does\NotExist", "Custom counter - does not exist"));
|
||||
|
||||
module.Counters.Add(
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\Process(??APP_WIN32_PROC??)\Handle Count",
|
||||
"Custom counter one"));
|
||||
|
||||
module.Counters.Add(
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\ASP.NET Applications(??APP_W3SVC_PROC??)\Anonymous Requests/Sec",
|
||||
"Custom counter two"));
|
||||
|
||||
// necessary for .NET CLR Memory counters to start reporting process ID
|
||||
GC.Collect();
|
||||
|
||||
module.Initialize(TelemetryConfiguration.Active);
|
||||
|
||||
TelemetryModules.Instance.Modules.Add(module);
|
||||
}
|
||||
|
||||
protected void Session_Start(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Application_BeginRequest(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Application_AuthenticateRequest(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Application_Error(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Session_End(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
protected void Application_End(object sender, EventArgs e)
|
||||
{
|
||||
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,184 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build;Package" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(SolutionDir)\PerformanceCollector.Tests\Test.Common.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{492D24C2-9FAA-4B00-8C4D-5719B7EAA334}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>TestApp40</RootNamespace>
|
||||
<AssemblyName>TestApp40</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<NuGetPackageImportStamp>8a9c7268</NuGetPackageImportStamp>
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..\</SolutionDir>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.AI.ServerTelemetryChannel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.2.0.0-beta4\lib\net40\Microsoft.AI.ServerTelemetryChannel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationInsights, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.2.0.0-beta4\lib\net40\Microsoft.ApplicationInsights.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.Diagnostics.Tracing.EventSource, Version=1.1.24.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\packages\Microsoft.Diagnostics.Tracing.EventSource.Redist.1.1.24\lib\net40\Microsoft.Diagnostics.Tracing.EventSource.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks">
|
||||
<HintPath>..\..\..\..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks.Extensions">
|
||||
<HintPath>..\..\..\..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Threading.Tasks.Extensions.Desktop">
|
||||
<HintPath>..\..\..\..\..\..\packages\Microsoft.Bcl.Async.1.0.168\lib\net40\Microsoft.Threading.Tasks.Extensions.Desktop.dll</HintPath>
|
||||
<Private>True</Private>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Core" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.IO">
|
||||
<HintPath>..\..\..\..\..\..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.IO.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Runtime">
|
||||
<HintPath>..\..\..\..\..\..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Runtime.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Threading.Tasks">
|
||||
<HintPath>..\..\..\..\..\..\packages\Microsoft.Bcl.1.1.8\lib\net40\System.Threading.Tasks.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Web.DynamicData" />
|
||||
<Reference Include="System.Web.Entity" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.Net.Http">
|
||||
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Net.Http.WebRequest">
|
||||
<HintPath>..\..\..\packages\Microsoft.Net.Http.2.0.20710.0\lib\net40\System.Net.Http.WebRequest.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.Web.Infrastructure, Version=1.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<Private>True</Private>
|
||||
<HintPath>..\..\..\packages\Microsoft.Web.Infrastructure.1.0.0.0\lib\net40\Microsoft.Web.Infrastructure.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Aspx\TestWebForm.aspx" />
|
||||
<Content Include="Global.asax" />
|
||||
<Content Include="ApplicationInsights.config" />
|
||||
<Content Include="Web.config" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="packages.config" />
|
||||
<None Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
<None Include="Web.Release.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="Aspx\TestWebForm.aspx.cs">
|
||||
<DependentUpon>TestWebForm.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Aspx\TestWebForm.aspx.designer.cs">
|
||||
<DependentUpon>TestWebForm.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
<Folder Include="App_Start\" />
|
||||
<Folder Include="Properties\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\Net40\Perf.Net40.csproj">
|
||||
<Project>{61fc6e01-b40d-4db2-9dab-b27b82f02244}</Project>
|
||||
<Name>Perf.Net40</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<DeployOnBuild>true</DeployOnBuild>
|
||||
<DeployTarget>PipelinePreDeployCopyAllFilesToOneFolder</DeployTarget>
|
||||
<_PackageTempDir>$(OutputPath)\App</_PackageTempDir>
|
||||
<AutoParameterizationWebConfigConnectionStrings>false</AutoParameterizationWebConfigConnectionStrings>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>False</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>17186</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:17186/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\PerformanceCollector.Tests\Test.Common.Sdk.Net40.targets" />
|
||||
<PropertyGroup Condition="$(BuildingInsideVisualStudio)!=''">
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
md "$(ProjectDir)bin"
|
||||
copy "$(TargetDir)" "$(ProjectDir)bin"
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
<Import Project="..\..\..\..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets" Condition="Exists('..\..\..\..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" />
|
||||
<Target Name="EnsureBclBuildImported" BeforeTargets="BeforeBuild" Condition="'$(BclBuildImported)' == ''">
|
||||
<Error Condition="!Exists('..\..\..\..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="This project references NuGet package(s) that are missing on this computer. Enable NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=317567." HelpKeyword="BCLBUILD2001" />
|
||||
<Error Condition="Exists('..\..\..\..\..\..\packages\Microsoft.Bcl.Build.1.0.14\tools\Microsoft.Bcl.Build.targets')" Text="The build restored NuGet packages. Build the project again to include these packages in the build. For more information, see http://go.microsoft.com/fwlink/?LinkID=317568." HelpKeyword="BCLBUILD2002" />
|
||||
</Target>
|
||||
</Project>
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an attribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an attribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation xdt:Transform="RemoveAttributes(debug)" />
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
|
@ -0,0 +1,157 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
For more information on how to configure your ASP.NET application, please visit
|
||||
http://go.microsoft.com/fwlink/?LinkId=169433
|
||||
-->
|
||||
<configuration>
|
||||
<configSections>
|
||||
<sectionGroup name="dotNetOpenAuth" type="DotNetOpenAuth.Configuration.DotNetOpenAuthSection, DotNetOpenAuth.Core">
|
||||
<section name="messaging" type="DotNetOpenAuth.Configuration.MessagingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" />
|
||||
<section name="reporting" type="DotNetOpenAuth.Configuration.ReportingElement, DotNetOpenAuth.Core" requirePermission="false" allowLocation="true" />
|
||||
<section name="oauth" type="DotNetOpenAuth.Configuration.OAuthElement, DotNetOpenAuth.OAuth" requirePermission="false" allowLocation="true" />
|
||||
<section name="openid" type="DotNetOpenAuth.Configuration.OpenIdElement, DotNetOpenAuth.OpenId" requirePermission="false" allowLocation="true" />
|
||||
</sectionGroup>
|
||||
<!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
|
||||
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
|
||||
</configSections>
|
||||
<connectionStrings>
|
||||
<add name="DefaultConnection" providerName="System.Data.SqlClient" connectionString="Data Source=(LocalDb)\v11.0;Initial Catalog=aspnet-TestApp40-20150512145711;Integrated Security=SSPI;AttachDBFilename=|DataDirectory|\aspnet-TestApp40-20150512145711.mdf" />
|
||||
</connectionStrings>
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.0" />
|
||||
<authentication mode="Forms">
|
||||
<forms loginUrl="~/Account/Login" timeout="2880" defaultUrl="~/" />
|
||||
</authentication>
|
||||
<profile defaultProvider="DefaultProfileProvider">
|
||||
<providers>
|
||||
<add name="DefaultProfileProvider" type="System.Web.Providers.DefaultProfileProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
|
||||
</providers>
|
||||
</profile>
|
||||
<membership defaultProvider="DefaultMembershipProvider">
|
||||
<providers>
|
||||
<add name="DefaultMembershipProvider" type="System.Web.Providers.DefaultMembershipProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" enablePasswordRetrieval="false" enablePasswordReset="true" requiresQuestionAndAnswer="false" requiresUniqueEmail="false" maxInvalidPasswordAttempts="5" minRequiredPasswordLength="6" minRequiredNonalphanumericCharacters="0" passwordAttemptWindow="10" applicationName="/" />
|
||||
</providers>
|
||||
</membership>
|
||||
<roleManager defaultProvider="DefaultRoleProvider">
|
||||
<providers>
|
||||
<add name="DefaultRoleProvider" type="System.Web.Providers.DefaultRoleProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" applicationName="/" />
|
||||
</providers>
|
||||
</roleManager>
|
||||
<!--
|
||||
If you are deploying to a cloud environment that has multiple web server instances,
|
||||
you should change session state mode from "InProc" to "Custom". In addition,
|
||||
change the connection string named "DefaultConnection" to connect to an instance
|
||||
of SQL Server (including SQL Azure and SQL Compact) instead of to SQL Server Express.
|
||||
-->
|
||||
<sessionState mode="InProc" customProvider="DefaultSessionProvider">
|
||||
<providers>
|
||||
<add name="DefaultSessionProvider" type="System.Web.Providers.DefaultSessionStateProvider, System.Web.Providers, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35" connectionStringName="DefaultConnection" />
|
||||
</providers>
|
||||
</sessionState>
|
||||
<httpModules>
|
||||
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
|
||||
</httpModules>
|
||||
<hostingEnvironment shadowCopyBinAssemblies="false" />
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<modules runAllManagedModulesForAllRequests="true">
|
||||
<remove name="ApplicationInsightsWebTracking" />
|
||||
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
|
||||
</modules>
|
||||
<validation validateIntegratedModeConfiguration="false" />
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="DotNetOpenAuth.Core" publicKeyToken="2780ccd10d57b246" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="DotNetOpenAuth.AspNet" publicKeyToken="2780ccd10d57b246" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-4.0.0.0" newVersion="4.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Threading.Tasks" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-2.6.8.0" newVersion="2.6.8.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Microsoft.Diagnostics.Tracing.EventSource" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-1.1.24.0" newVersion="1.1.24.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
<!-- This prevents the Windows Event Log from frequently logging that HMAC1 is being used (when the other party needs it). -->
|
||||
<legacyHMACWarning enabled="0" />
|
||||
<!-- When targeting ASP.NET MVC 3, this assemblyBinding makes MVC 1 and 2 references relink
|
||||
to MVC 3 so libraries such as DotNetOpenAuth that compile against MVC 1 will work with it.
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
-->
|
||||
</runtime>
|
||||
<system.net>
|
||||
<defaultProxy enabled="true" />
|
||||
<settings>
|
||||
<!-- This setting causes .NET to check certificate revocation lists (CRL)
|
||||
before trusting HTTPS certificates. But this setting tends to not
|
||||
be allowed in shared hosting environments. -->
|
||||
<!--<servicePointManager checkCertificateRevocationList="true"/>-->
|
||||
</settings>
|
||||
</system.net>
|
||||
<dotNetOpenAuth>
|
||||
<messaging>
|
||||
<untrustedWebRequest>
|
||||
<whitelistHosts>
|
||||
<!-- Uncomment to enable communication with localhost (should generally not activate in production!) -->
|
||||
<!--<add name="localhost" />-->
|
||||
</whitelistHosts>
|
||||
</untrustedWebRequest>
|
||||
</messaging>
|
||||
<!-- Allow DotNetOpenAuth to publish usage statistics to library authors to improve the library. -->
|
||||
<reporting enabled="true" />
|
||||
<!-- This is an optional configuration section where aspects of dotnetopenauth can be customized. -->
|
||||
<!-- For a complete set of configuration options see http://www.dotnetopenauth.net/developers/code-snippets/configuration-options/ -->
|
||||
<openid>
|
||||
<relyingParty>
|
||||
<security requireSsl="false">
|
||||
<!-- Uncomment the trustedProviders tag if your relying party should only accept positive assertions from a closed set of OpenID Providers. -->
|
||||
<!--<trustedProviders rejectAssertionsFromUntrustedProviders="true">
|
||||
<add endpoint="https://www.google.com/accounts/o8/ud" />
|
||||
</trustedProviders>-->
|
||||
</security>
|
||||
<behaviors>
|
||||
<!-- The following OPTIONAL behavior allows RPs to use SREG only, but be compatible
|
||||
with OPs that use Attribute Exchange (in various formats). -->
|
||||
<add type="DotNetOpenAuth.OpenId.RelyingParty.Behaviors.AXFetchAsSregTransform, DotNetOpenAuth.OpenId.RelyingParty" />
|
||||
</behaviors>
|
||||
</relyingParty>
|
||||
</openid>
|
||||
</dotNetOpenAuth>
|
||||
<uri>
|
||||
<!-- The uri section is necessary to turn on .NET 3.5 support for IDN (international domain names),
|
||||
which is necessary for OpenID urls with unicode characters in the domain/host name.
|
||||
It is also required to put the Uri class into RFC 3986 escaping mode, which OpenID and OAuth require. -->
|
||||
<idn enabled="All" />
|
||||
<iriParsing enabled="true" />
|
||||
</uri>
|
||||
<entityFramework>
|
||||
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
|
||||
<parameters>
|
||||
<parameter value="mssqllocaldb" />
|
||||
</parameters>
|
||||
</defaultConnectionFactory>
|
||||
<providers>
|
||||
<provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
|
||||
</providers>
|
||||
</entityFramework>
|
||||
</configuration>
|
|
@ -0,0 +1,9 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.ApplicationInsights" version="2.0.0-beta4" targetFramework="net40" />
|
||||
<package id="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" version="2.0.0-beta4" targetFramework="net40" />
|
||||
<package id="Microsoft.Bcl" version="1.1.8" targetFramework="net40" />
|
||||
<package id="Microsoft.Bcl.Async" version="1.0.168" targetFramework="net40" />
|
||||
<package id="Microsoft.Bcl.Build" version="1.0.14" targetFramework="net40" />
|
||||
<package id="Microsoft.Diagnostics.Tracing.EventSource.Redist" version="1.1.24" targetFramework="net40" />
|
||||
</packages>
|
|
@ -0,0 +1,24 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Web.Http;
|
||||
|
||||
namespace TestApp45
|
||||
{
|
||||
public static class WebApiConfig
|
||||
{
|
||||
public static void Register(HttpConfiguration config)
|
||||
{
|
||||
// Web API configuration and services
|
||||
|
||||
// Web API routes
|
||||
config.MapHttpAttributeRoutes();
|
||||
|
||||
config.Routes.MapHttpRoute(
|
||||
name: "DefaultApi",
|
||||
routeTemplate: "api/{controller}/{id}",
|
||||
defaults: new { id = RouteParameter.Optional }
|
||||
);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,23 @@
|
|||
<ApplicationInsights xmlns="http://schemas.microsoft.com/ApplicationInsights/2013/Settings">
|
||||
<InstrumentationKey>00000000-D231-45B6-8DD4-D344C309AE69</InstrumentationKey>
|
||||
<TelemetryInitializers>
|
||||
<Add Type="Microsoft.ApplicationInsights.WindowsServer.AzureRoleEnvironmentTelemetryInitializer, Microsoft.AI.WindowsServer" />
|
||||
<Add Type="Microsoft.ApplicationInsights.WindowsServer.DomainNameRoleInstanceTelemetryInitializer, Microsoft.AI.WindowsServer" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Web.OperationNameTelemetryInitializer, Microsoft.AI.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Web.OperationCorrelationTelemetryInitializer, Microsoft.AI.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Web.UserTelemetryInitializer, Microsoft.AI.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Web.SessionTelemetryInitializer, Microsoft.AI.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.WindowsServer.BuildInfoConfigComponentVersionTelemetryInitializer, Microsoft.AI.WindowsServer"/>
|
||||
</TelemetryInitializers>
|
||||
<TelemetryModules>
|
||||
<Add Type="Microsoft.ApplicationInsights.Extensibility.Implementation.Tracing.DiagnosticsTelemetryModule, Microsoft.ApplicationInsights" >
|
||||
<Severity>Verbose</Severity>
|
||||
</Add>
|
||||
<Add Type="Microsoft.ApplicationInsights.Web.RequestTrackingTelemetryModule, Microsoft.AI.Web" />
|
||||
<Add Type="Microsoft.ApplicationInsights.Web.ExceptionTrackingTelemetryModule, Microsoft.AI.Web" />
|
||||
</TelemetryModules>
|
||||
<TelemetryChannel Type="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.ServerTelemetryChannel, Microsoft.AI.ServerTelemetryChannel">
|
||||
<EndpointAddress>http://LocalHost:4554/v2/track</EndpointAddress>
|
||||
<DeveloperMode>true</DeveloperMode>
|
||||
</TelemetryChannel>
|
||||
</ApplicationInsights>
|
|
@ -0,0 +1,11 @@
|
|||
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="TestWebForm.aspx.cs" Inherits="TestApp45.Aspx.TestWebForm" %>
|
||||
|
||||
<!DOCTYPE html>
|
||||
|
||||
<html xmlns="http://www.w3.org/1999/xhtml">
|
||||
<head runat="server">
|
||||
<title>TestWebForm.aspx</title>
|
||||
</head>
|
||||
<body>
|
||||
</body>
|
||||
</html>
|
|
@ -0,0 +1,15 @@
|
|||
namespace TestApp45.Aspx
|
||||
{
|
||||
using System;
|
||||
using System.IO;
|
||||
|
||||
public partial class TestWebForm : System.Web.UI.Page
|
||||
{
|
||||
protected void Page_Load(object sender, EventArgs e)
|
||||
{
|
||||
Response.Clear();
|
||||
Response.Write("PerformanceCollector application");
|
||||
Response.End();
|
||||
}
|
||||
}
|
||||
}
|
16
PerformanceCollector/PerformanceCollector.Tests/FunctionalTests/TestApps/TestApp45/Aspx/TestWebForm.aspx.designer.cs
сгенерированный
Normal file
16
PerformanceCollector/PerformanceCollector.Tests/FunctionalTests/TestApps/TestApp45/Aspx/TestWebForm.aspx.designer.cs
сгенерированный
Normal file
|
@ -0,0 +1,16 @@
|
|||
//------------------------------------------------------------------------------
|
||||
// <auto-generated>
|
||||
// This code was generated by a tool.
|
||||
//
|
||||
// Changes to this file may cause incorrect behavior and will be lost if
|
||||
// the code is regenerated.
|
||||
// </auto-generated>
|
||||
//------------------------------------------------------------------------------
|
||||
|
||||
namespace TestApp45.Aspx
|
||||
{
|
||||
|
||||
|
||||
public partial class TestWebForm {
|
||||
}
|
||||
}
|
|
@ -0,0 +1 @@
|
|||
<%@ Application Codebehind="Global.asax.cs" Inherits="TestApp45.WebApiApplication" Language="C#" %>
|
|
@ -0,0 +1,64 @@
|
|||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Configuration;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Web;
|
||||
using System.Web.Http;
|
||||
using System.Web.Routing;
|
||||
using Microsoft.ApplicationInsights;
|
||||
using Microsoft.ApplicationInsights.Extensibility.Implementation;
|
||||
|
||||
namespace TestApp45
|
||||
{
|
||||
using Microsoft.ApplicationInsights;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
public class WebApiApplication : System.Web.HttpApplication
|
||||
{
|
||||
protected void Application_Start()
|
||||
{
|
||||
var setting = ConfigurationManager.AppSettings["TestApp.SendTelemetyIntemOnAppStart"];
|
||||
if (false == string.IsNullOrWhiteSpace(setting) && true == bool.Parse(setting))
|
||||
{
|
||||
new TelemetryClient().TrackTrace("Application_Start");
|
||||
}
|
||||
|
||||
GlobalConfiguration.Configure(WebApiConfig.Register);
|
||||
|
||||
var module = new PerformanceCollectorModule();
|
||||
|
||||
// set test-friendly timings
|
||||
var privateObject = new PrivateObject(module);
|
||||
privateObject.SetField("collectionPeriod", TimeSpan.FromMilliseconds(10));
|
||||
privateObject.SetField(
|
||||
"defaultCounters",
|
||||
new List<string>() { @"\Memory\Available Bytes", @"Will not parse;\Does\NotExist" });
|
||||
|
||||
module.Counters.Add(
|
||||
new PerformanceCounterCollectionRequest(@"Will not parse", "Custom counter - will not parse"));
|
||||
|
||||
module.Counters.Add(
|
||||
new PerformanceCounterCollectionRequest(@"\Does\NotExist", "Custom counter - does not exist"));
|
||||
|
||||
module.Counters.Add(
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\Process(??APP_WIN32_PROC??)\Handle Count",
|
||||
"Custom counter one"));
|
||||
|
||||
module.Counters.Add(
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\ASP.NET Applications(??APP_W3SVC_PROC??)\Anonymous Requests/Sec",
|
||||
"Custom counter two"));
|
||||
|
||||
// necessary for .NET CLR Memory counters to start reporting process ID
|
||||
GC.Collect();
|
||||
|
||||
module.Initialize(TelemetryConfiguration.Active);
|
||||
|
||||
TelemetryModules.Instance.Modules.Add(module);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,24 @@
|
|||
using System.Reflection;
|
||||
using System.Runtime.CompilerServices;
|
||||
using System.Runtime.InteropServices;
|
||||
|
||||
// General Information about an assembly is controlled through the following
|
||||
// set of attributes. Change these attribute values to modify the information
|
||||
// associated with an assembly.
|
||||
[assembly: AssemblyTitle("TestApp45")]
|
||||
[assembly: AssemblyDescription("")]
|
||||
[assembly: AssemblyConfiguration("")]
|
||||
[assembly: AssemblyCompany("")]
|
||||
[assembly: AssemblyProduct("TestApp45")]
|
||||
[assembly: AssemblyCopyright("Copyright © 2014")]
|
||||
[assembly: AssemblyTrademark("")]
|
||||
[assembly: AssemblyCulture("")]
|
||||
|
||||
// Setting ComVisible to false makes the types in this assembly not visible
|
||||
// to COM components. If you need to access a type in this assembly from
|
||||
// COM, set the ComVisible attribute to true on that type.
|
||||
[assembly: ComVisible(false)]
|
||||
|
||||
// The following GUID is for the ID of the typelib if this project is exposed to COM
|
||||
[assembly: Guid("745891fb-c040-4c19-8636-467e9ff9ba1e")]
|
||||
|
|
@ -0,0 +1,180 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<Project ToolsVersion="12.0" DefaultTargets="Build;Package" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
|
||||
<Import Project="$(SolutionDir)\PerformanceCollector.Tests\Test.Common.props" />
|
||||
<PropertyGroup>
|
||||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
|
||||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
|
||||
<ProductVersion>
|
||||
</ProductVersion>
|
||||
<SchemaVersion>2.0</SchemaVersion>
|
||||
<ProjectGuid>{BD4C55CF-0513-4F93-936B-6EE57497ED84}</ProjectGuid>
|
||||
<ProjectTypeGuids>{349c5851-65df-11da-9384-00065b846f21};{fae04ec0-301f-11d3-bf4b-00c04f79efbc}</ProjectTypeGuids>
|
||||
<OutputType>Library</OutputType>
|
||||
<AppDesignerFolder>Properties</AppDesignerFolder>
|
||||
<RootNamespace>TestApp45</RootNamespace>
|
||||
<AssemblyName>TestApp45</AssemblyName>
|
||||
<TargetFrameworkVersion>v4.5.1</TargetFrameworkVersion>
|
||||
<UseIISExpress>true</UseIISExpress>
|
||||
<IISExpressSSLPort />
|
||||
<IISExpressAnonymousAuthentication />
|
||||
<IISExpressWindowsAuthentication />
|
||||
<IISExpressUseClassicPipelineMode />
|
||||
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\..\..\</SolutionDir>
|
||||
<WcfConfigValidationEnabled>True</WcfConfigValidationEnabled>
|
||||
<TargetFrameworkProfile />
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<!-- Generate the BuildInfo.config file -->
|
||||
<GenerateBuildInfoConfigFile>true</GenerateBuildInfoConfigFile>
|
||||
<IncludeServerNameInBuildInfo>true</IncludeServerNameInBuildInfo>
|
||||
<VisualStudioVersion>12.0</VisualStudioVersion>
|
||||
</PropertyGroup>
|
||||
<Target Name="AfterBuild">
|
||||
<Copy SourceFiles="$(TargetDir)$(TargetName).BuildInfo.config" DestinationFiles="$(ProjectDir)BuildInfo.config" />
|
||||
</Target>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
|
||||
<DebugSymbols>true</DebugSymbols>
|
||||
<DebugType>full</DebugType>
|
||||
<Optimize>false</Optimize>
|
||||
<DefineConstants>DEBUG;TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
|
||||
<DebugType>pdbonly</DebugType>
|
||||
<Optimize>true</Optimize>
|
||||
<DefineConstants>TRACE</DefineConstants>
|
||||
<ErrorReport>prompt</ErrorReport>
|
||||
<WarningLevel>4</WarningLevel>
|
||||
</PropertyGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="Microsoft.AI.ServerTelemetryChannel, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel.2.0.0-beta4\lib\net45\Microsoft.AI.ServerTelemetryChannel.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.ApplicationInsights, Version=2.0.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35, processorArchitecture=MSIL">
|
||||
<HintPath>..\..\..\..\..\..\packages\Microsoft.ApplicationInsights.2.0.0-beta4\lib\net45\Microsoft.ApplicationInsights.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="Microsoft.CSharp" />
|
||||
<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=10.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />
|
||||
<Reference Include="Newtonsoft.Json">
|
||||
<SpecificVersion>False</SpecificVersion>
|
||||
<HintPath>$(PackagesDir)\Newtonsoft.Json.6.0.2\lib\net45\Newtonsoft.Json.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Data.DataSetExtensions" />
|
||||
<Reference Include="System.Net" />
|
||||
<Reference Include="System.Net.Http" />
|
||||
<Reference Include="System.Runtime.Serialization" />
|
||||
<Reference Include="System.ServiceModel" />
|
||||
<Reference Include="System.ServiceModel.Web" />
|
||||
<Reference Include="System.Web.DynamicData" />
|
||||
<Reference Include="System.Web.Entity" />
|
||||
<Reference Include="System.Web.ApplicationServices" />
|
||||
<Reference Include="System.ComponentModel.DataAnnotations" />
|
||||
<Reference Include="System" />
|
||||
<Reference Include="System.Data" />
|
||||
<Reference Include="System.Web.Extensions" />
|
||||
<Reference Include="System.Drawing" />
|
||||
<Reference Include="System.Web" />
|
||||
<Reference Include="System.Xml" />
|
||||
<Reference Include="System.Configuration" />
|
||||
<Reference Include="System.Web.Services" />
|
||||
<Reference Include="System.EnterpriseServices" />
|
||||
<Reference Include="System.Xml.Linq" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Reference Include="System.Net.Http.Formatting">
|
||||
<HintPath>$(PackagesDir)\Microsoft.AspNet.WebApi.Client.5.1.2\lib\net45\System.Net.Http.Formatting.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http">
|
||||
<HintPath>$(PackagesDir)\Microsoft.AspNet.WebApi.Core.5.1.2\lib\net45\System.Web.Http.dll</HintPath>
|
||||
</Reference>
|
||||
<Reference Include="System.Web.Http.WebHost">
|
||||
<HintPath>$(PackagesDir)\Microsoft.AspNet.WebApi.WebHost.5.1.2\lib\net45\System.Web.Http.WebHost.dll</HintPath>
|
||||
</Reference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="Aspx\TestWebForm.aspx" />
|
||||
<Content Include="Global.asax" />
|
||||
<Content Include="Web.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Compile Include="App_Start\WebApiConfig.cs" />
|
||||
<Compile Include="Aspx\TestWebForm.aspx.cs">
|
||||
<DependentUpon>TestWebForm.aspx</DependentUpon>
|
||||
<SubType>ASPXCodeBehind</SubType>
|
||||
</Compile>
|
||||
<Compile Include="Aspx\TestWebForm.aspx.designer.cs">
|
||||
<DependentUpon>TestWebForm.aspx</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Global.asax.cs">
|
||||
<DependentUpon>Global.asax</DependentUpon>
|
||||
</Compile>
|
||||
<Compile Include="Properties\AssemblyInfo.cs" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Content Include="packages.config">
|
||||
<SubType>Designer</SubType>
|
||||
</Content>
|
||||
<Content Include="ApplicationInsights.config">
|
||||
<SubType>Designer</SubType>
|
||||
<CopyToOutputDirectory>Always</CopyToOutputDirectory>
|
||||
</Content>
|
||||
<None Include="Web.Debug.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
<None Include="Web.Release.config">
|
||||
<DependentUpon>Web.config</DependentUpon>
|
||||
</None>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<Folder Include="App_Data\" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\..\..\..\Net45\Perf.Net45.csproj">
|
||||
<Project>{fbfcb985-bbfe-4954-a2ef-8124a42f56c7}</Project>
|
||||
<Name>Perf.Net45</Name>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<PropertyGroup>
|
||||
<VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
|
||||
<VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup>
|
||||
<DeployOnBuild>true</DeployOnBuild>
|
||||
<DeployTarget>PipelinePreDeployCopyAllFilesToOneFolder</DeployTarget>
|
||||
<_PackageTempDir>$(OutputPath)\App</_PackageTempDir>
|
||||
<AutoParameterizationWebConfigConnectionStrings>false</AutoParameterizationWebConfigConnectionStrings>
|
||||
</PropertyGroup>
|
||||
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
|
||||
<Import Project="$(VSToolsPath)\WebApplications\Microsoft.WebApplication.targets" Condition="'$(VSToolsPath)' != ''" />
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v10.0\WebApplications\Microsoft.WebApplication.targets" Condition="false" />
|
||||
<ProjectExtensions>
|
||||
<VisualStudio>
|
||||
<FlavorProperties GUID="{349c5851-65df-11da-9384-00065b846f21}">
|
||||
<WebProjectProperties>
|
||||
<UseIIS>False</UseIIS>
|
||||
<AutoAssignPort>True</AutoAssignPort>
|
||||
<DevelopmentServerPort>54437</DevelopmentServerPort>
|
||||
<DevelopmentServerVPath>/</DevelopmentServerVPath>
|
||||
<IISUrl>http://localhost:4321/</IISUrl>
|
||||
<NTLMAuthentication>False</NTLMAuthentication>
|
||||
<UseCustomServer>False</UseCustomServer>
|
||||
<CustomServerUrl>
|
||||
</CustomServerUrl>
|
||||
<SaveServerSettingsInUserFile>False</SaveServerSettingsInUserFile>
|
||||
</WebProjectProperties>
|
||||
</FlavorProperties>
|
||||
</VisualStudio>
|
||||
</ProjectExtensions>
|
||||
<Import Project="$(SolutionDir)\PerformanceCollector.Tests\Test.Common.Sdk.Net45.targets" />
|
||||
<PropertyGroup Condition="$(BuildingInsideVisualStudio)!=''">
|
||||
<RunPostBuildEvent>OnBuildSuccess</RunPostBuildEvent>
|
||||
<PostBuildEvent>
|
||||
md "$(ProjectDir)bin"
|
||||
copy "$(TargetDir)" "$(ProjectDir)bin"
|
||||
</PostBuildEvent>
|
||||
</PropertyGroup>
|
||||
</Project>
|
|
@ -0,0 +1,30 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an attribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
|
@ -0,0 +1,31 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
|
||||
<!-- For more information on using web.config transformation visit http://go.microsoft.com/fwlink/?LinkId=125889 -->
|
||||
|
||||
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
|
||||
<!--
|
||||
In the example below, the "SetAttributes" transform will change the value of
|
||||
"connectionString" to use "ReleaseSQLServer" only when the "Match" locator
|
||||
finds an attribute "name" that has a value of "MyDB".
|
||||
|
||||
<connectionStrings>
|
||||
<add name="MyDB"
|
||||
connectionString="Data Source=ReleaseSQLServer;Initial Catalog=MyReleaseDB;Integrated Security=True"
|
||||
xdt:Transform="SetAttributes" xdt:Locator="Match(name)"/>
|
||||
</connectionStrings>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation xdt:Transform="RemoveAttributes(debug)" />
|
||||
<!--
|
||||
In the example below, the "Replace" transform will replace the entire
|
||||
<customErrors> section of your web.config file.
|
||||
Note that because there is only one customErrors section under the
|
||||
<system.web> node, there is no need to use the "xdt:Locator" attribute.
|
||||
|
||||
<customErrors defaultRedirect="GenericError.htm"
|
||||
mode="RemoteOnly" xdt:Transform="Replace">
|
||||
<error statusCode="500" redirect="InternalError.htm"/>
|
||||
</customErrors>
|
||||
-->
|
||||
</system.web>
|
||||
</configuration>
|
|
@ -0,0 +1,70 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!--
|
||||
For more information on how to configure your ASP.NET application, please visit
|
||||
http://go.microsoft.com/fwlink/?LinkId=301879
|
||||
-->
|
||||
<configuration>
|
||||
<appSettings />
|
||||
<!--
|
||||
For a description of web.config changes see http://go.microsoft.com/fwlink/?LinkId=235367.
|
||||
|
||||
The following attributes can be set on the <httpRuntime> tag.
|
||||
<system.Web>
|
||||
<httpRuntime targetFramework="4.5.1" />
|
||||
</system.Web>
|
||||
-->
|
||||
<system.web>
|
||||
<compilation debug="true" targetFramework="4.5.1" />
|
||||
<httpRuntime targetFramework="4.5" />
|
||||
<webServices>
|
||||
<protocols>
|
||||
<add name="HttpGet" />
|
||||
<add name="HttpPost" />
|
||||
</protocols>
|
||||
</webServices>
|
||||
<hostingEnvironment shadowCopyBinAssemblies="false" />
|
||||
</system.web>
|
||||
<system.webServer>
|
||||
<handlers>
|
||||
<remove name="ExtensionlessUrlHandler-Integrated-4.0" />
|
||||
<remove name="OPTIONSVerbHandler" />
|
||||
<remove name="TRACEVerbHandler" />
|
||||
<add name="ExtensionlessUrlHandler-Integrated-4.0" path="*." verb="*" type="System.Web.Handlers.TransferRequestHandler" preCondition="integratedMode,runtimeVersionv4.0" />
|
||||
</handlers>
|
||||
<modules runAllManagedModulesForAllRequests="true">
|
||||
<add name="ApplicationInsightsWebTracking" type="Microsoft.ApplicationInsights.Web.ApplicationInsightsHttpModule, Microsoft.AI.Web" />
|
||||
</modules>
|
||||
</system.webServer>
|
||||
<runtime>
|
||||
<probing privatePath="bin;bin\ai_sdk" />
|
||||
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Helpers" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Mvc" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-5.1.0.0" newVersion="5.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.Optimization" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.1.0.0" newVersion="1.1.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="System.Web.WebPages" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-3.0.0.0" newVersion="3.0.0.0" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="WebGrease" publicKeyToken="31bf3856ad364e35" />
|
||||
<bindingRedirect oldVersion="1.0.0.0-1.5.2.14234" newVersion="1.5.2.14234" />
|
||||
</dependentAssembly>
|
||||
<dependentAssembly>
|
||||
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
|
||||
<bindingRedirect oldVersion="0.0.0.0-6.0.0.0" newVersion="6.0.0.0" />
|
||||
</dependentAssembly>
|
||||
</assemblyBinding>
|
||||
</runtime>
|
||||
<system.serviceModel>
|
||||
<serviceHostingEnvironment aspNetCompatibilityEnabled="true" multipleSiteBindingsEnabled="false" />
|
||||
</system.serviceModel>
|
||||
</configuration>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.ApplicationInsights" version="2.0.0-beta4" targetFramework="net451" />
|
||||
<package id="Microsoft.ApplicationInsights.WindowsServer.TelemetryChannel" version="2.0.0-beta4" targetFramework="net451" />
|
||||
<package id="Microsoft.AspNet.WebApi" version="5.1.2" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Client" version="5.1.2" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.Core" version="5.1.2" targetFramework="net45" />
|
||||
<package id="Microsoft.AspNet.WebApi.WebHost" version="5.1.2" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.2" targetFramework="net45" />
|
||||
</packages>
|
|
@ -0,0 +1,103 @@
|
|||
// --------------------------------------------------------------------------------------------------------------------
|
||||
// <copyright file="SingleWebHostTestBase.cs" company="Microsoft Corporation">
|
||||
// Copyright (c) Microsoft Corporation. All rights reserved.
|
||||
// </copyright>
|
||||
// <author>Sergei Nikitin: sergeyni@microsoft.com</author>
|
||||
// --------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
namespace Functional.Helpers
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.IO;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Xml.Linq;
|
||||
using IisExpress;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
/// <summary>
|
||||
/// Base class for single host functional test
|
||||
/// </summary>
|
||||
public abstract class SingleWebHostTestBase
|
||||
{
|
||||
protected IisExpress Server { get; private set; }
|
||||
|
||||
protected HttpClient HttpClient { get; private set; }
|
||||
|
||||
protected HttpListenerObservable Listener { get; private set; }
|
||||
|
||||
protected SingleWebHostTestConfiguration Config { get; private set; }
|
||||
|
||||
protected EtwEventSession EtwSession { get; private set; }
|
||||
|
||||
protected void StartWebAppHost(
|
||||
SingleWebHostTestConfiguration configuration)
|
||||
{
|
||||
if (null == configuration)
|
||||
{
|
||||
throw new ArgumentNullException("configuration");
|
||||
}
|
||||
|
||||
this.Config = configuration;
|
||||
|
||||
this.Server = IisExpress.Start(
|
||||
configuration.WebHostConfig,
|
||||
configuration.AttachDebugger);
|
||||
|
||||
this.HttpClient = new HttpClient
|
||||
{
|
||||
BaseAddress = new Uri(configuration.ApplicationUri)
|
||||
};
|
||||
|
||||
this.Listener = new HttpListenerObservable(configuration.TelemetryListenerUri);
|
||||
this.Listener.Start();
|
||||
|
||||
this.EtwSession = new EtwEventSession();
|
||||
this.EtwSession.Start();
|
||||
}
|
||||
|
||||
protected void StopWebAppHost(bool treatTraceErrorsAsFailures = false)
|
||||
{
|
||||
this.Listener.Stop();
|
||||
this.Server.Stop();
|
||||
this.HttpClient.Dispose();
|
||||
|
||||
if (treatTraceErrorsAsFailures && this.EtwSession.FailureDetected)
|
||||
{
|
||||
Assert.Fail("Read test output. There are errors found in application trace.");
|
||||
}
|
||||
|
||||
this.EtwSession.Stop();
|
||||
}
|
||||
|
||||
protected static void UpdateAppConfigSettings(
|
||||
IEnumerable<KeyValuePair<string, string>> settings,
|
||||
string destAppConfiguration)
|
||||
{
|
||||
var configDom = XDocument.Load(destAppConfiguration);
|
||||
var configuraitonNode = configDom.Element("configuration");
|
||||
if (null == configuraitonNode)
|
||||
{
|
||||
throw new InvalidOperationException("configuration node does not exist");
|
||||
}
|
||||
|
||||
var appSettings = configuraitonNode.Element("appSettings");
|
||||
if (null == appSettings)
|
||||
{
|
||||
appSettings = new XElement("appSettings");
|
||||
configuraitonNode.Add(appSettings);
|
||||
}
|
||||
|
||||
foreach (var setting in settings)
|
||||
{
|
||||
appSettings.Add(
|
||||
new XElement("add",
|
||||
new XAttribute("key", setting.Key),
|
||||
new XAttribute("value", setting.Value)));
|
||||
}
|
||||
|
||||
configDom.Save(destAppConfiguration);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,70 @@
|
|||
namespace Functional
|
||||
{
|
||||
using Functional.Helpers;
|
||||
using Functional.UserSessionTests;
|
||||
using System.Net;
|
||||
using Microsoft.Developer.Analytics.DataCollection.Model.v2;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
public abstract class UserSessionIsFirstIsNewTestBase : SingleWebHostTestBase
|
||||
{
|
||||
protected void ValidateIsFirstSessionTrueAndNewSessionStarted(string requestPath, int testListenerTimeoutInMs, int testRequestTimeOutInMs)
|
||||
{
|
||||
// For the first request that is being sent we create a new user and a new session
|
||||
// Check: IsFirst true; new SessionState is generated
|
||||
|
||||
Cookie[] cookies = new Cookie[0];
|
||||
var requestResponseContainer = new RequestResponseContainer(cookies, requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeOutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
TelemetryItem<RequestData> requestItem;
|
||||
TelemetryItem<SessionStateData> sessionStateItem;
|
||||
|
||||
this.ReceiveRequestAndSession(testListenerTimeoutInMs, out requestItem, out sessionStateItem);
|
||||
|
||||
Assert.IsTrue(requestItem.SessionContext.IsFirst.Value, "A new userId is associated with isFirstSession False");
|
||||
Assert.AreEqual(sessionStateItem.Data.BaseData.State, SessionState.Start);
|
||||
}
|
||||
|
||||
protected void ValidateIsFirstSessionFalseAndSessionNotStarted(string requestPath, int testListenerTimeoutInMs,
|
||||
int testRequestTimeOutInMs)
|
||||
{
|
||||
// If a second request is made with the session cookie that is obtained from the first request,
|
||||
// IsFirst is false and no SessionState telemetry is generated
|
||||
|
||||
Cookie[] cookies = new Cookie[0];
|
||||
var requestResponseContainer = new RequestResponseContainer(cookies, requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeOutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
Listener.ReceiveItemsOfType<TelemetryItem<RequestData>>(1, testListenerTimeoutInMs);
|
||||
|
||||
var sessionCookie = new Cookie(CookieNames.SessionCookie, requestResponseContainer.CookieCollection.ReceiveSessionCookie());
|
||||
|
||||
requestResponseContainer = new RequestResponseContainer(new []{sessionCookie}, requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeOutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
var items = Listener.ReceiveAllItemsDuringTimeOfType<TelemetryItem<RequestData>, TelemetryItem<SessionStateData>>(testListenerTimeoutInMs);
|
||||
Assert.AreEqual(1, items.Length, "We expected only 1 request. SessionState should not be generated.");
|
||||
var request = items[0] as TelemetryItem<RequestData>;
|
||||
Assert.IsTrue((request.SessionContext.IsFirst == null) || !request.SessionContext.IsFirst.Value, "IsFirst should be false or null because cookie existed");
|
||||
}
|
||||
|
||||
private void ReceiveRequestAndSession(
|
||||
int testListenerTimeoutInMs,
|
||||
out TelemetryItem<RequestData> requestItem,
|
||||
out TelemetryItem<SessionStateData> sessionItem)
|
||||
{
|
||||
var items = Listener.ReceiveItemsOfTypes<TelemetryItem<RequestData>, TelemetryItem<SessionStateData>>(
|
||||
2,
|
||||
testListenerTimeoutInMs);
|
||||
|
||||
// One item is request, the other one is sessionState.
|
||||
int requestItemIndex = (items[0] is TelemetryItem<RequestData>) ? 0 : 1;
|
||||
int sessionStateItemIndex = (requestItemIndex == 0) ? 1 : 0;
|
||||
|
||||
sessionItem = (TelemetryItem<SessionStateData>)items[sessionStateItemIndex];
|
||||
requestItem = (TelemetryItem<RequestData>)items[requestItemIndex];
|
||||
}
|
||||
|
||||
}
|
||||
}
|
|
@ -0,0 +1,237 @@
|
|||
namespace Functional
|
||||
{
|
||||
using Functional.Helpers;
|
||||
using Functional.UserSessionTests;
|
||||
using Microsoft.Developer.Analytics.DataCollection.Model.v2;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.IO;
|
||||
using System.Linq;
|
||||
using System.Net;
|
||||
using System.Net.Http;
|
||||
using System.Threading.Tasks;
|
||||
|
||||
public abstract class UserSessionTestBase : SingleWebHostTestBase
|
||||
{
|
||||
/// <summary>
|
||||
/// Tests the scenario when the initial request is sent without user cookie, in which case, a cookie is set by the server
|
||||
/// and we need to verify if the cookie set by the server is same as the one collected by listener.
|
||||
/// </summary>
|
||||
protected void ValidateUserIdWithoutRequestCookie(string requestPath, int testListenerTimeoutInMs, int testRequestTimeOutInMs)
|
||||
{
|
||||
Cookie[] cookies = new Cookie[0];
|
||||
var requestResponseContainer = new RequestResponseContainer(cookies, requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeOutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
var userCookie = requestResponseContainer.CookieCollection.ReceiveUserCookie();
|
||||
var item = Listener.ReceiveItemsOfType<TelemetryItem<RequestData>>(
|
||||
1,
|
||||
testListenerTimeoutInMs)[0];
|
||||
|
||||
Assert.AreEqual("OK", requestResponseContainer.ResponseTask.Result.ReasonPhrase);
|
||||
Assert.AreEqual(2, requestResponseContainer.CookieCollection.Count);
|
||||
Assert.AreNotEqual(string.Empty, userCookie);
|
||||
|
||||
Assert.AreEqual(userCookie, item.UserContext.Id + "|" + item.UserContext.AcquisitionDate.Value.ToString("O"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests the scenario when the initial request is sent without a cookie, in which case, a cookie is set by the server
|
||||
/// and we need to verify if the cookie set by the server is same as the one collected by listener.
|
||||
/// </summary>
|
||||
protected void ValidateSessionIdWithoutRequestCookie(string requestPath, int testListenerTimeoutInMs, int testRequestTimeOutInMs)
|
||||
{
|
||||
Cookie[] cookies = new Cookie[0];
|
||||
var requestResponseContainer = new RequestResponseContainer(cookies, requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeOutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
var sessionCookie = requestResponseContainer.CookieCollection.ReceiveSessionCookie();
|
||||
|
||||
var item = Listener.ReceiveItemsOfType<TelemetryItem<RequestData>>(
|
||||
1,
|
||||
testListenerTimeoutInMs)[0];
|
||||
|
||||
Assert.AreEqual("OK", requestResponseContainer.ResponseTask.Result.ReasonPhrase);
|
||||
Assert.AreNotEqual(string.Empty, sessionCookie);
|
||||
Assert.AreEqual(2, requestResponseContainer.CookieCollection.Count);
|
||||
Assert.AreEqual(sessionCookie.Substring(0, sessionCookie.IndexOf("|", StringComparison.Ordinal)), item.SessionContext.Id);
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests the scenario when the initial request contains a cookie (corresponding to user), in which case, the response should contain a similar cookie with the information
|
||||
/// replicated into the listener data.
|
||||
/// </summary>
|
||||
protected void ValidateUserIdWithRequestCookie(string requestPath, int testListenerTimeoutInMs, int testRequestTimeOutInMs, Cookie[] additionalCookies = null)
|
||||
{
|
||||
DateTimeOffset time = DateTimeOffset.UtcNow;
|
||||
List<Cookie> cookies = new List<Cookie>();
|
||||
int additionalCookiesLength = 0;
|
||||
if (null != additionalCookies)
|
||||
{
|
||||
cookies.AddRange(additionalCookies);
|
||||
additionalCookiesLength = additionalCookies.Length;
|
||||
}
|
||||
string userCookieStr = "userId|" + time.ToString("O");
|
||||
var cookie = new Cookie(CookieNames.UserCookie, userCookieStr);
|
||||
cookies.Add(cookie);
|
||||
|
||||
var requestResponseContainer = new RequestResponseContainer(cookies.ToArray(), requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeOutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
var userCookie = requestResponseContainer.CookieCollection.ReceiveUserCookie();
|
||||
var item = Listener.ReceiveItemsOfType<TelemetryItem<RequestData>>(
|
||||
1,
|
||||
testListenerTimeoutInMs)[0];
|
||||
|
||||
Assert.AreEqual("OK", requestResponseContainer.ResponseTask.Result.ReasonPhrase);
|
||||
Assert.AreEqual(2 + additionalCookiesLength, requestResponseContainer.CookieCollection.Count);
|
||||
Assert.AreEqual("userId", item.UserContext.Id);
|
||||
Assert.AreEqual(time, item.UserContext.AcquisitionDate.Value);
|
||||
Assert.AreEqual(userCookieStr, userCookie);
|
||||
Assert.AreEqual(userCookie, item.UserContext.Id + "|" + item.UserContext.AcquisitionDate.Value.ToString("O"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
/// Tests the scenario when the initial request contains a cookie (corresponding to user), in which case, the response should contain a similar cookie with the information
|
||||
/// replicated into the listener data.
|
||||
/// </summary>
|
||||
protected void ValidateSessionIdWithRequestCookie(string requestPath, int testListenerTimeoutInMs, int testRequestTimeOutInMs)
|
||||
{
|
||||
DateTime currentTime = DateTime.Now;
|
||||
string currentTimeString = currentTime.ToString("O");
|
||||
string actualCookie = "sessionId|" + currentTimeString + "|" + currentTimeString;
|
||||
|
||||
var cookie = new Cookie(CookieNames.SessionCookie, actualCookie);
|
||||
Cookie[] cookies = { cookie };
|
||||
|
||||
var requestResponseContainer = new RequestResponseContainer(cookies, requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeOutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
var sessionCookie = requestResponseContainer.CookieCollection.ReceiveSessionCookie();
|
||||
var item = Listener.ReceiveItemsOfType<TelemetryItem<RequestData>>(
|
||||
1,
|
||||
testListenerTimeoutInMs)[0];
|
||||
|
||||
Assert.AreEqual("OK", requestResponseContainer.ResponseTask.Result.ReasonPhrase);
|
||||
Assert.AreEqual(2, requestResponseContainer.CookieCollection.Count);
|
||||
Assert.AreEqual(actualCookie, sessionCookie);
|
||||
Assert.AreEqual("sessionId", item.SessionContext.Id);
|
||||
Assert.AreEqual(sessionCookie.Substring(0, sessionCookie.IndexOf("|", StringComparison.Ordinal)), item.SessionContext.Id);
|
||||
}
|
||||
|
||||
protected void CheckIfOutpuCashIsNotBroken(string requestPath, string contentMarker, int testRequestTimeoutInMs)
|
||||
{
|
||||
var responseTask1 = this.HttpClient.GetAsync(requestPath);
|
||||
this.ValidateSuccessfullRequest(contentMarker, responseTask1, testRequestTimeoutInMs);
|
||||
var header1 = responseTask1.Result.Headers.Single(i => i.Key == "Test_Random").Value.Single();
|
||||
|
||||
var responseTask2 = this.HttpClient.GetAsync(requestPath);
|
||||
this.ValidateSuccessfullRequest(contentMarker, responseTask2, testRequestTimeoutInMs);
|
||||
var header2 = responseTask2.Result.Headers.Single(i => i.Key == "Test_Random").Value.Single();
|
||||
|
||||
Assert.AreEqual(header1, header2, "Second request was supposed to be taken from cache and have same header");
|
||||
}
|
||||
|
||||
protected void CheckIfSessionIsCollectedIfResponseIsFlushedEarly(string requestPath, string contentMarker, int testListenerTimeoutInMs, int testRequestTimeoutInMs)
|
||||
{
|
||||
Cookie[] cookies = new Cookie[0];
|
||||
var requestResponseContainer = new RequestResponseContainer(cookies, requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeoutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
this.ValidateSuccessfullRequest(contentMarker, requestResponseContainer.ResponseTask, testRequestTimeoutInMs);
|
||||
var sessionCookie = requestResponseContainer.CookieCollection.ReceiveSessionCookie();
|
||||
|
||||
var item = Listener.ReceiveItemsOfType<TelemetryItem<RequestData>>(1, testListenerTimeoutInMs)[0];
|
||||
|
||||
Assert.AreEqual("OK", requestResponseContainer.ResponseTask.Result.ReasonPhrase);
|
||||
Assert.AreNotEqual(string.Empty, sessionCookie);
|
||||
Assert.AreEqual(2, requestResponseContainer.CookieCollection.Count);
|
||||
Assert.AreEqual(sessionCookie.Substring(0, sessionCookie.IndexOf("|", StringComparison.Ordinal)), item.SessionContext.Id);
|
||||
}
|
||||
|
||||
protected void CheckIfUserIsCollectedIfResponseIsFlushedEarly(string requestPath, string contentMarker, int testListenerTimeoutInMs, int testRequestTimeoutInMs)
|
||||
{
|
||||
Cookie[] cookies = new Cookie[0];
|
||||
var requestResponseContainer = new RequestResponseContainer(cookies, requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeoutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
var item = Listener.ReceiveItemsOfType<TelemetryItem<RequestData>>(1, testListenerTimeoutInMs)[0];
|
||||
|
||||
var userCookie = requestResponseContainer.CookieCollection.ReceiveUserCookie();
|
||||
Trace.Write(requestResponseContainer.ResponseData);
|
||||
|
||||
Assert.AreEqual(userCookie, item.UserContext.Id + "|" + item.UserContext.AcquisitionDate.Value.ToString("O"));
|
||||
}
|
||||
|
||||
protected void CheckIfSessionIsInitializedWhenPostResolveCacheIsSkipped(string requestPath, int testListenerTimeoutInMs, int testRequestTimeoutInMs)
|
||||
{
|
||||
Cookie[] cookies = new Cookie[0];
|
||||
var requestResponseContainer = new RequestResponseContainer(cookies, requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeoutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
this.ValidateFailedRequest(requestResponseContainer.ResponseTask, testRequestTimeoutInMs);
|
||||
|
||||
var item = Listener.ReceiveItemsOfType<TelemetryItem<RequestData>>(1, testListenerTimeoutInMs)[0];
|
||||
var sessionCookie = requestResponseContainer.CookieCollection.ReceiveSessionCookie();
|
||||
|
||||
Assert.AreNotEqual(string.Empty, sessionCookie);
|
||||
Assert.AreEqual(2, requestResponseContainer.CookieCollection.Count);
|
||||
Assert.AreEqual(sessionCookie.Substring(0, sessionCookie.IndexOf("|", StringComparison.Ordinal)), item.SessionContext.Id);
|
||||
}
|
||||
|
||||
protected void CheckIfUserIsInitializedWhenPostResolveCacheIsSkipped(string requestPath, int testListenerTimeoutInMs, int testRequestTimeoutInMs)
|
||||
{
|
||||
Cookie[] cookies = new Cookie[0];
|
||||
var requestResponseContainer = new RequestResponseContainer(cookies, requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeoutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
this.ValidateFailedRequest(requestResponseContainer.ResponseTask, testRequestTimeoutInMs);
|
||||
|
||||
var item = Listener.ReceiveItemsOfType<TelemetryItem<RequestData>>(1, testListenerTimeoutInMs)[0];
|
||||
|
||||
Assert.IsNotNull(item.UserContext.Id);
|
||||
Assert.IsNotNull(item.UserContext.AcquisitionDate.Value);
|
||||
var userCookie = requestResponseContainer.CookieCollection.ReceiveUserCookie();
|
||||
Trace.Write(requestResponseContainer.ResponseData);
|
||||
|
||||
Assert.AreEqual(userCookie, item.UserContext.Id + "|" + item.UserContext.AcquisitionDate.Value.ToString("O"));
|
||||
}
|
||||
|
||||
private void ValidateSuccessfullRequest(string contentMarker, Task<HttpResponseMessage> responseTask, int testRequestTimeoutInMs)
|
||||
{
|
||||
Assert.IsTrue(
|
||||
responseTask.Wait(testRequestTimeoutInMs),
|
||||
"Request was not executed in time");
|
||||
|
||||
Assert.IsTrue(
|
||||
responseTask.Result.IsSuccessStatusCode,
|
||||
"Request succeeded");
|
||||
|
||||
Assert.AreEqual(
|
||||
HttpStatusCode.OK,
|
||||
responseTask.Result.StatusCode,
|
||||
"Unexpected response code");
|
||||
|
||||
var responseData = responseTask.Result.Content.ReadAsStringAsync().Result;
|
||||
Trace.Write(responseData);
|
||||
|
||||
Assert.IsTrue(
|
||||
responseData.Contains(contentMarker),
|
||||
"Response content does not contain expected data: {0}",
|
||||
responseData);
|
||||
}
|
||||
|
||||
private void ValidateFailedRequest(Task<HttpResponseMessage> responseTask, int testRequestTimeoutInMs)
|
||||
{
|
||||
Assert.IsTrue(
|
||||
responseTask.Wait(testRequestTimeoutInMs),
|
||||
"Request was not executed in time");
|
||||
|
||||
Assert.IsFalse(
|
||||
responseTask.Result.IsSuccessStatusCode,
|
||||
"Request failed");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,53 @@
|
|||
namespace Functional
|
||||
{
|
||||
using Functional.Helpers;
|
||||
using Functional.UserSessionTests;
|
||||
using Microsoft.Developer.Analytics.DataCollection.Model.v2;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
using System;
|
||||
using System.Net;
|
||||
|
||||
public abstract class UserSessionWithTrackMetricBase : SingleWebHostTestBase
|
||||
{
|
||||
/// <summary>
|
||||
///Tests the scenario if user related information is present in the listener when customer invokes TrackMetric()
|
||||
///method from his application without a cookie.
|
||||
/// </summary>
|
||||
protected void ValidateUserCookieWhenTrackMetricIsInvokedWithoutCookie(string requestPath, int testListenerTimeoutInMs, int testRequestTimeOutInMs)
|
||||
{
|
||||
Cookie[] cookies = new Cookie[0];
|
||||
var requestResponseContainer = new RequestResponseContainer(cookies, requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeOutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
var userCookie = requestResponseContainer.CookieCollection.ReceiveUserCookie();
|
||||
var item = Listener.ReceiveItemsOfType<TelemetryItem<MetricData>>(
|
||||
1,
|
||||
testListenerTimeoutInMs)[0];
|
||||
|
||||
Assert.AreEqual("OK", requestResponseContainer.ResponseTask.Result.ReasonPhrase);
|
||||
Assert.AreEqual(2, requestResponseContainer.CookieCollection.Count);
|
||||
Assert.AreEqual(userCookie, item.UserContext.Id + "|" + item.UserContext.AcquisitionDate.Value.ToString("O"));
|
||||
}
|
||||
|
||||
/// <summary>
|
||||
///Tests the scenario if session related information is present in the listener when customer invokes TrackMetric()
|
||||
///method from his application without a cookie.
|
||||
/// </summary>
|
||||
protected void ValidateSessionCookieWhenTrackMetricIsInvokedWithoutCookie(string requestPath, int testListenerTimeoutInMs, int testRequestTimeOutInMs)
|
||||
{
|
||||
Cookie[] cookies = new Cookie[0];
|
||||
var requestResponseContainer = new RequestResponseContainer(cookies, requestPath, this.Config.ApplicationUri, testListenerTimeoutInMs, testRequestTimeOutInMs);
|
||||
requestResponseContainer.SendRequest();
|
||||
|
||||
var sessionCookie = requestResponseContainer.CookieCollection.ReceiveSessionCookie();
|
||||
var item = Listener.ReceiveItemsOfType<TelemetryItem<MetricData>>(
|
||||
1,
|
||||
testListenerTimeoutInMs)[0];
|
||||
|
||||
Assert.AreEqual("OK", requestResponseContainer.ResponseTask.Result.ReasonPhrase);
|
||||
Assert.AreNotEqual(string.Empty, sessionCookie);
|
||||
Assert.AreEqual(2, requestResponseContainer.CookieCollection.Count);
|
||||
Assert.AreEqual(sessionCookie.Substring(0, sessionCookie.IndexOf("|", StringComparison.Ordinal)), item.SessionContext.Id);
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,14 @@
|
|||
<?xml version="1.0" encoding="utf-8" ?>
|
||||
<configuration>
|
||||
<system.serviceModel>
|
||||
<bindings />
|
||||
<behaviors>
|
||||
<endpointBehaviors>
|
||||
<behavior name="httpBinding">
|
||||
<webHttp/>
|
||||
</behavior>
|
||||
</endpointBehaviors>
|
||||
</behaviors>
|
||||
<client />
|
||||
</system.serviceModel>
|
||||
</configuration>
|
|
@ -0,0 +1,10 @@
|
|||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<packages>
|
||||
<package id="Microsoft.ApplicationInsights.TelemetryTypes.DataPlatform" version="3.0.68-build00708" targetFramework="net45" />
|
||||
<package id="Microsoft.Diagnostics.Tracing.TraceEvent" version="1.0.29" targetFramework="net45" />
|
||||
<package id="Microsoft.Web.Xdt" version="2.1.1" targetFramework="net45" />
|
||||
<package id="Newtonsoft.Json" version="6.0.5" targetFramework="net45" />
|
||||
<package id="Rx-Core" version="2.1.30214.0" targetFramework="net45" />
|
||||
<package id="Rx-Interfaces" version="2.1.30214.0" targetFramework="net45" />
|
||||
<package id="Rx-Linq" version="2.1.30214.0" targetFramework="net45" />
|
||||
</packages>
|
|
@ -0,0 +1,30 @@
|
|||
namespace Unit.Tests
|
||||
{
|
||||
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.Implementation;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
/// <summary>
|
||||
/// PerformanceCollectorEventSource tests.
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
public class PerformanceCollectorEventSourceTests
|
||||
{
|
||||
[TestMethod]
|
||||
public void PerformanceCollectorEventSourceSanityTest()
|
||||
{
|
||||
// check for FormatExceptions and ETW exceptions
|
||||
PerformanceCollectorEventSource.Log.ModuleIsBeingInitializedEvent("Test message");
|
||||
PerformanceCollectorEventSource.Log.CounterRegisteredEvent("counter");
|
||||
PerformanceCollectorEventSource.Log.CountersRefreshedEvent(10, "values");
|
||||
PerformanceCollectorEventSource.Log.CounterRegistrationFailedEvent("Test exception", "counter");
|
||||
PerformanceCollectorEventSource.Log.CounterParsingFailedEvent("Test exception", "counter");
|
||||
PerformanceCollectorEventSource.Log.CounterReportAsStrippedEvent("Counter", "Stripped", "Original");
|
||||
PerformanceCollectorEventSource.Log.CounterCheckConfigurationEvent("1", "2", "Test message");
|
||||
PerformanceCollectorEventSource.Log.CounterCollectionAttemptEvent();
|
||||
PerformanceCollectorEventSource.Log.CounterCollectionSuccessEvent(0, 0);
|
||||
PerformanceCollectorEventSource.Log.CounterReadingFailedEvent("Test exception", "counter");
|
||||
PerformanceCollectorEventSource.Log.TelemetrySendFailedEvent("Test exception");
|
||||
PerformanceCollectorEventSource.Log.UnknownErrorEvent("Test exception");
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,102 @@
|
|||
namespace Unit.Tests
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
|
||||
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.Implementation;
|
||||
|
||||
using CounterData = System.Tuple<Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.Implementation.PerformanceCounterData, System.Collections.Generic.List<float>>;
|
||||
|
||||
/// <summary>
|
||||
/// Mock to test clients of PerformanceCollector.
|
||||
/// </summary>
|
||||
internal class PerformanceCollectorMock : IPerformanceCollector
|
||||
{
|
||||
public object Sync = new object();
|
||||
|
||||
private readonly List<CounterData> counters = new List<CounterData>();
|
||||
|
||||
public List<CounterData> Counters
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.counters;
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<PerformanceCounterData> PerformanceCounters
|
||||
{
|
||||
get
|
||||
{
|
||||
return this.counters.Select(c => c.Item1);
|
||||
}
|
||||
}
|
||||
|
||||
public void RegisterPerformanceCounter(
|
||||
string originalString,
|
||||
string reportAs,
|
||||
string categoryName,
|
||||
string counterName,
|
||||
string instanceName,
|
||||
bool usesInstanceNamePlaceholder,
|
||||
bool isCustomCounter)
|
||||
{
|
||||
lock (this.Sync)
|
||||
{
|
||||
this.counters.Add(
|
||||
Tuple.Create(
|
||||
new PerformanceCounterData(
|
||||
originalString,
|
||||
reportAs,
|
||||
new PerformanceCounter()
|
||||
{
|
||||
CategoryName = categoryName,
|
||||
CounterName = counterName,
|
||||
InstanceName = instanceName
|
||||
},
|
||||
usesInstanceNamePlaceholder,
|
||||
isCustomCounter),
|
||||
new List<float>()));
|
||||
}
|
||||
}
|
||||
|
||||
public IEnumerable<Tuple<PerformanceCounterData, float>> Collect(Action<string, Exception> onReadingFailure)
|
||||
{
|
||||
lock (this.Sync)
|
||||
{
|
||||
foreach (var counter in this.counters)
|
||||
{
|
||||
var value =
|
||||
(float)
|
||||
(counter.Item1.PerformanceCounter.CategoryName.GetHashCode() + counter.Item1.PerformanceCounter.CounterName.GetHashCode()
|
||||
+ counter.Item1.PerformanceCounter.InstanceName.GetHashCode());
|
||||
|
||||
var result =
|
||||
Tuple.Create(
|
||||
new PerformanceCounterData(
|
||||
counter.Item1.OriginalString,
|
||||
counter.Item1.ReportAs,
|
||||
new PerformanceCounter()
|
||||
{
|
||||
CategoryName = counter.Item1.PerformanceCounter.CategoryName,
|
||||
CounterName = counter.Item1.PerformanceCounter.CounterName,
|
||||
InstanceName = counter.Item1.PerformanceCounter.InstanceName
|
||||
},
|
||||
counter.Item1.UsesInstanceNamePlaceholder,
|
||||
counter.Item1.IsCustomCounter),
|
||||
value);
|
||||
|
||||
counter.Item2.Add(value);
|
||||
|
||||
yield return result;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public void RefreshPerformanceCounter(PerformanceCounterData pcd, PerformanceCounter pc)
|
||||
{
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,402 @@
|
|||
namespace Unit.Tests
|
||||
{
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Threading;
|
||||
using Microsoft.ApplicationInsights.DataContracts;
|
||||
using Microsoft.ApplicationInsights.Extensibility;
|
||||
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector;
|
||||
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.Implementation;
|
||||
using Microsoft.ApplicationInsights.TestFramework;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
/// <summary>
|
||||
/// PerformanceCollectorModules tests.
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
public class PerformanceCollectorModulesTests
|
||||
{
|
||||
[TestMethod]
|
||||
public void TimerTest()
|
||||
{
|
||||
var collector = CreatePerformanceCollector();
|
||||
var configuration = CreateTelemetryConfiguration();
|
||||
var telemetryChannel = configuration.TelemetryChannel as StubTelemetryChannel;
|
||||
|
||||
Exception assertionsFailure = null;
|
||||
|
||||
telemetryChannel.OnSend = telemetry =>
|
||||
{
|
||||
// validate that a proper telemetry item is being sent
|
||||
// module will swallow any exception that we throw here, so catch and rethrow later
|
||||
try
|
||||
{
|
||||
Assert.AreEqual(configuration.InstrumentationKey, telemetry.Context.InstrumentationKey);
|
||||
|
||||
Assert.IsInstanceOfType(telemetry, typeof(PerformanceCounterTelemetry));
|
||||
|
||||
var perfTelemetry = telemetry as PerformanceCounterTelemetry;
|
||||
|
||||
Assert.AreEqual(
|
||||
(float)(perfTelemetry.CategoryName.GetHashCode() + perfTelemetry.InstanceName.GetHashCode() + perfTelemetry.CounterName.GetHashCode()),
|
||||
perfTelemetry.Value);
|
||||
}
|
||||
catch (AssertFailedException e)
|
||||
{
|
||||
// race condition, but we don't care who wins
|
||||
assertionsFailure = e;
|
||||
}
|
||||
};
|
||||
|
||||
using (var module = CreatePerformanceCollectionModule(collector))
|
||||
{
|
||||
// start the module
|
||||
module.Initialize(configuration);
|
||||
|
||||
// wait 1s to let the module finish initializing
|
||||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
|
||||
// now wait to let the module's timer run
|
||||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
|
||||
lock (collector.Sync)
|
||||
{
|
||||
Assert.IsTrue(collector.Counters.TrueForAll(c => c.Item2.Count > 0), "Some of the counters have not been collected. Counter count: " + collector.Counters.Count + ", non-zero counter count: " + collector.Counters.Count(c => c.Item2.Count > 0));
|
||||
}
|
||||
|
||||
if (assertionsFailure != null)
|
||||
{
|
||||
throw assertionsFailure;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void ConfigurationTest()
|
||||
{
|
||||
var collector = CreatePerformanceCollector();
|
||||
|
||||
var configuration = CreateTelemetryConfiguration();
|
||||
configuration.InstrumentationKey = string.Empty;
|
||||
|
||||
using (var module = CreatePerformanceCollectionModule(collector))
|
||||
{
|
||||
// start the module
|
||||
module.Initialize(configuration);
|
||||
|
||||
// wait 1s to let the module finish initializing
|
||||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
|
||||
// now wait to let the module's timer run
|
||||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
|
||||
var privateModule = new PrivateObject(module);
|
||||
|
||||
Assert.IsNotNull(privateModule.GetField("client"));
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void DefaultCountersTest()
|
||||
{
|
||||
var collector = CreatePerformanceCollector();
|
||||
|
||||
var configuration = CreateTelemetryConfiguration();
|
||||
|
||||
using (var module = CreatePerformanceCollectionModule(collector))
|
||||
{
|
||||
// start the module
|
||||
module.Initialize(configuration);
|
||||
|
||||
// wait to let the module finish initializing
|
||||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
|
||||
// now wait to let the module's timer run
|
||||
Thread.Sleep(TimeSpan.FromSeconds(3));
|
||||
|
||||
var privateModule = new PrivateObject(module);
|
||||
|
||||
lock (collector.Sync)
|
||||
{
|
||||
// check that the default counter list has been registered
|
||||
Assert.AreEqual(
|
||||
(privateModule.GetField("defaultCounters") as List<string>).Count(),
|
||||
collector.Counters.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CustomCountersTest()
|
||||
{
|
||||
var collector = CreatePerformanceCollector();
|
||||
|
||||
var configuration = CreateTelemetryConfiguration();
|
||||
|
||||
var customCounters = new List<PerformanceCounterCollectionRequest>()
|
||||
{
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryName5(InstanceName5)\CounterName5",
|
||||
"CounterFive"),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\Process(??APP_WIN32_PROC??)\% Processor Time",
|
||||
"CounterTwo")
|
||||
};
|
||||
|
||||
using (var module = CreatePerformanceCollectionModule(collector, customCounters))
|
||||
{
|
||||
// start the module
|
||||
module.Initialize(configuration);
|
||||
|
||||
// wait 1s to let the module finish initializing
|
||||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
|
||||
// now wait to let the module's timer run
|
||||
Thread.Sleep(TimeSpan.FromSeconds(3));
|
||||
|
||||
var privateModule = new PrivateObject(module);
|
||||
|
||||
lock (collector.Sync)
|
||||
{
|
||||
// check that the configured counter list has been registered
|
||||
var defaultCounterCount = (privateModule.GetField("defaultCounters") as List<string>).Count();
|
||||
|
||||
Assert.AreEqual(customCounters.Count() + defaultCounterCount, collector.Counters.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CustomCountersDuplicatesTest()
|
||||
{
|
||||
var collector = CreatePerformanceCollector();
|
||||
|
||||
var configuration = CreateTelemetryConfiguration();
|
||||
|
||||
var customCounters = new List<PerformanceCounterCollectionRequest>()
|
||||
{
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryName1\CounterName1",
|
||||
"CounterOne"),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryName2\CounterName2",
|
||||
"CounterTwo"),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryName2\CounterName2",
|
||||
"CounterX"),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryName4\CounterName4",
|
||||
"CounterThree"),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryName3\CounterName3",
|
||||
"CounterThree"),
|
||||
};
|
||||
|
||||
using (var module = CreatePerformanceCollectionModule(collector, customCounters))
|
||||
{
|
||||
// start the module
|
||||
module.Initialize(configuration);
|
||||
|
||||
// wait 1s to let the module finish initializing
|
||||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
|
||||
// now wait to let the module's timer run
|
||||
Thread.Sleep(TimeSpan.FromSeconds(3));
|
||||
|
||||
lock (collector.Sync)
|
||||
{
|
||||
// check that the configured counter list has been registered
|
||||
Assert.AreEqual(4, module.Counters.Count());
|
||||
|
||||
Assert.AreEqual(@"\CategoryName1\CounterName1", module.Counters[0].PerformanceCounter);
|
||||
Assert.AreEqual("CounterOne", module.Counters[0].ReportAs);
|
||||
|
||||
Assert.AreEqual(@"\CategoryName2\CounterName2", module.Counters[1].PerformanceCounter);
|
||||
Assert.AreEqual("CounterTwo", module.Counters[1].ReportAs);
|
||||
|
||||
Assert.AreEqual(@"\CategoryName4\CounterName4", module.Counters[2].PerformanceCounter);
|
||||
Assert.AreEqual("CounterThree", module.Counters[2].ReportAs);
|
||||
|
||||
Assert.AreEqual(@"\CategoryName3\CounterName3", module.Counters[3].PerformanceCounter);
|
||||
Assert.AreEqual("CounterThree", module.Counters[3].ReportAs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void CustomCountersSanitizingTest()
|
||||
{
|
||||
var collector = CreatePerformanceCollector();
|
||||
|
||||
var configuration = CreateTelemetryConfiguration();
|
||||
|
||||
var customCounters = new List<PerformanceCounterCollectionRequest>()
|
||||
{
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryName1\CounterName1",
|
||||
"CounterOne"),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryNameTwo\CounterNameTwo",
|
||||
string.Empty),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryName3\CounterName3",
|
||||
null),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryName4\CounterName4",
|
||||
" Counter 4"),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryName5\CounterName5",
|
||||
" Counter5"),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\Категория6\Счетчик6",
|
||||
"Только юникод первый"),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\Категория7\Счетчик7",
|
||||
"Только юникод второй"),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryNameAnother8%\CounterNameAnother8%",
|
||||
null),
|
||||
};
|
||||
|
||||
using (var module = CreatePerformanceCollectionModule(collector, customCounters))
|
||||
{
|
||||
// start the module
|
||||
module.Initialize(configuration);
|
||||
|
||||
// wait 1s to let the module finish initializing
|
||||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
|
||||
// now wait to let the module's timer run
|
||||
Thread.Sleep(TimeSpan.FromSeconds(3));
|
||||
|
||||
lock (collector.Sync)
|
||||
{
|
||||
// check that the configured counter list has been registered
|
||||
// check sanitization rules
|
||||
Assert.AreEqual(@"\CategoryName1\CounterName1", collector.Counters[2].Item1.OriginalString);
|
||||
Assert.AreEqual("CounterOne", collector.Counters[2].Item1.ReportAs);
|
||||
|
||||
Assert.AreEqual(@"\CategoryNameTwo\CounterNameTwo", collector.Counters[3].Item1.OriginalString);
|
||||
Assert.AreEqual(@"CategoryNameTwo - CounterNameTwo", collector.Counters[3].Item1.ReportAs);
|
||||
|
||||
Assert.AreEqual(@"\CategoryName3\CounterName3", collector.Counters[4].Item1.OriginalString);
|
||||
Assert.AreEqual(@"CategoryName - CounterName", collector.Counters[4].Item1.ReportAs);
|
||||
|
||||
Assert.AreEqual(@"\CategoryName4\CounterName4", collector.Counters[5].Item1.OriginalString);
|
||||
Assert.AreEqual(@"Counter", collector.Counters[5].Item1.ReportAs);
|
||||
|
||||
Assert.AreEqual(@"\CategoryName5\CounterName5", collector.Counters[6].Item1.OriginalString);
|
||||
Assert.AreEqual(@"Counter", collector.Counters[6].Item1.ReportAs);
|
||||
|
||||
// unicode-only reportAs values are converted to "random" strings
|
||||
Assert.AreEqual(@"\Категория6\Счетчик6", collector.Counters[7].Item1.OriginalString);
|
||||
Assert.AreEqual(@"Performance counter A", collector.Counters[7].Item1.ReportAs);
|
||||
|
||||
Assert.AreEqual(@"\Категория7\Счетчик7", collector.Counters[8].Item1.OriginalString);
|
||||
Assert.AreEqual(@"Performance counter B", collector.Counters[8].Item1.ReportAs);
|
||||
|
||||
Assert.AreEqual(
|
||||
@"\CategoryNameAnother8%\CounterNameAnother8%",
|
||||
collector.Counters[9].Item1.OriginalString);
|
||||
Assert.AreEqual(@"CategoryNameAnother - CounterNameAnother", collector.Counters[9].Item1.ReportAs);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void RebindingNoPrematureRebindingTest()
|
||||
{
|
||||
var collector = CreatePerformanceCollector();
|
||||
|
||||
var configuration = CreateTelemetryConfiguration();
|
||||
|
||||
var customCounters = new List<PerformanceCounterCollectionRequest>()
|
||||
{
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\CategoryName1(InstanceName1)\CounterName1",
|
||||
null),
|
||||
new PerformanceCounterCollectionRequest(
|
||||
@"\Process(??APP_WIN32_PROC??)\% Processor Time",
|
||||
null)
|
||||
};
|
||||
|
||||
using (var module = CreatePerformanceCollectionModule(collector, customCounters))
|
||||
{
|
||||
// start the module
|
||||
module.Initialize(configuration);
|
||||
|
||||
// make the module think that initial binding has already happened and it's not time to rebind yet
|
||||
var privateObject = new PrivateObject(module);
|
||||
privateObject.SetField("lastRefreshTimestamp", DateTime.Now + TimeSpan.FromMinutes(1));
|
||||
|
||||
// wait 1s to let the module finish initializing
|
||||
Thread.Sleep(TimeSpan.FromSeconds(1));
|
||||
|
||||
// now wait to let the module's timer run
|
||||
Thread.Sleep(TimeSpan.FromSeconds(3));
|
||||
|
||||
lock (collector.Sync)
|
||||
{
|
||||
// nothing should have been registered
|
||||
Assert.AreEqual(0, collector.Counters.Count);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
public void TelemetryModuleIsNotInitializedTwiceToPreventTimerBeingRecreated()
|
||||
{
|
||||
var module = new PerformanceCollectorModule();
|
||||
PrivateObject privateObject = new PrivateObject(module);
|
||||
|
||||
module.Initialize(TelemetryConfiguration.CreateDefault());
|
||||
object config1 = privateObject.GetField("telemetryConfiguration");
|
||||
|
||||
module.Initialize(TelemetryConfiguration.CreateDefault());
|
||||
object config2 = privateObject.GetField("telemetryConfiguration");
|
||||
|
||||
Assert.AreSame(config1, config2);
|
||||
}
|
||||
|
||||
private static TelemetryConfiguration CreateTelemetryConfiguration()
|
||||
{
|
||||
var configuration = new TelemetryConfiguration();
|
||||
|
||||
configuration.InstrumentationKey = "56D500C1-0F6C-46D1-A1F2-250D65075E0F";
|
||||
configuration.TelemetryChannel = new StubTelemetryChannel();
|
||||
|
||||
return configuration;
|
||||
}
|
||||
|
||||
private static PerformanceCollectorMock CreatePerformanceCollector()
|
||||
{
|
||||
return new PerformanceCollectorMock();
|
||||
}
|
||||
|
||||
private static PerformanceCollectorModule CreatePerformanceCollectionModule(IPerformanceCollector collector, List<PerformanceCounterCollectionRequest> customCounterList = null)
|
||||
{
|
||||
var module = new PerformanceCollectorModule(collector);
|
||||
|
||||
if (customCounterList != null)
|
||||
{
|
||||
customCounterList.ForEach(module.Counters.Add);
|
||||
}
|
||||
|
||||
// set test-friendly timings
|
||||
var privateObject = new PrivateObject(module);
|
||||
privateObject.SetField("collectionPeriod", TimeSpan.FromMilliseconds(10));
|
||||
|
||||
// build agent is unable to handle performance collection, so don't put any placeholders here for unit testing
|
||||
privateObject.SetField(
|
||||
"defaultCounters",
|
||||
new List<string>()
|
||||
{
|
||||
@"\DefaultCategory1\DefaultCounter1",
|
||||
@"\DefaultCategory2(Instance2)\DefaultCounter2"
|
||||
});
|
||||
|
||||
return module;
|
||||
}
|
||||
}
|
||||
}
|
|
@ -0,0 +1,122 @@
|
|||
namespace Unit.Tests
|
||||
{
|
||||
using System;
|
||||
using System.Diagnostics;
|
||||
using System.Linq;
|
||||
using Microsoft.ApplicationInsights.Extensibility.PerfCounterCollector.Implementation;
|
||||
using Microsoft.VisualStudio.TestTools.UnitTesting;
|
||||
|
||||
/// <summary>
|
||||
/// PerformanceCollector tests.
|
||||
/// </summary>
|
||||
[TestClass]
|
||||
public class PerformanceCollectorTests
|
||||
{
|
||||
[TestMethod]
|
||||
[TestCategory("RequiresPerformanceCounters")]
|
||||
public void PerformanceCollectorSanityTest()
|
||||
{
|
||||
const int CounterCount = 3;
|
||||
const string CategoryName = "Processor";
|
||||
const string CounterName = "% Processor Time";
|
||||
const string InstanceName = "_Total";
|
||||
|
||||
IPerformanceCollector collector = new PerformanceCollector();
|
||||
|
||||
for (int i = 0; i < CounterCount; i++)
|
||||
{
|
||||
collector.RegisterPerformanceCounter(
|
||||
@"\Processor(_Total)\% Processor Time",
|
||||
null,
|
||||
CategoryName,
|
||||
CounterName,
|
||||
InstanceName,
|
||||
false,
|
||||
true);
|
||||
}
|
||||
|
||||
var results = collector.Collect().ToList();
|
||||
|
||||
Assert.AreEqual(CounterCount, results.Count);
|
||||
|
||||
foreach (var result in results)
|
||||
{
|
||||
var pc = result.Item1.PerformanceCounter;
|
||||
var value = result.Item2;
|
||||
|
||||
Assert.AreEqual(CategoryName, pc.CategoryName);
|
||||
Assert.AreEqual(CounterName, pc.CounterName);
|
||||
Assert.AreEqual(InstanceName, pc.InstanceName);
|
||||
|
||||
Assert.IsTrue(value >= 0 && value <= 100);
|
||||
}
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[TestCategory("RequiresPerformanceCounters")]
|
||||
public void PerformanceCollectorRefreshTest()
|
||||
{
|
||||
var counters = new PerformanceCounter[]
|
||||
{
|
||||
new PerformanceCounter("Processor", "% Processor Time", "_Total"),
|
||||
new PerformanceCounter("Processor", "% Processor Time", "_Total")
|
||||
};
|
||||
|
||||
var newCounter = new PerformanceCounter("Memory", "Available Bytes", string.Empty);
|
||||
|
||||
IPerformanceCollector collector = new PerformanceCollector();
|
||||
|
||||
foreach (var pc in counters)
|
||||
{
|
||||
collector.RegisterPerformanceCounter(
|
||||
PerformanceCounterUtility.FormatPerformanceCounter(pc),
|
||||
null,
|
||||
pc.CategoryName,
|
||||
pc.CounterName,
|
||||
pc.InstanceName,
|
||||
false,
|
||||
true);
|
||||
}
|
||||
|
||||
collector.RefreshPerformanceCounter(collector.PerformanceCounters.Last(), newCounter);
|
||||
|
||||
Assert.IsTrue(collector.PerformanceCounters.Last().PerformanceCounter.CategoryName == newCounter.CategoryName);
|
||||
Assert.IsTrue(collector.PerformanceCounters.Last().PerformanceCounter.CounterName == newCounter.CounterName);
|
||||
Assert.IsTrue(collector.PerformanceCounters.Last().PerformanceCounter.InstanceName == newCounter.InstanceName);
|
||||
}
|
||||
|
||||
[TestMethod]
|
||||
[TestCategory("RequiresPerformanceCounters")]
|
||||
public void PerformanceCollectorBadStateTest()
|
||||
{
|
||||
var counters = new PerformanceCounter[]
|
||||
{
|
||||
new PerformanceCounter("Processor", "% Processor Time", "_Total123blabla"),
|
||||
new PerformanceCounter("Processor", "% Processor Time", "_Total")
|
||||
};
|
||||
|
||||
IPerformanceCollector collector = new PerformanceCollector();
|
||||
|
||||
foreach (var pc in counters)
|
||||
{
|
||||
try
|
||||
{
|
||||
collector.RegisterPerformanceCounter(
|
||||
PerformanceCounterUtility.FormatPerformanceCounter(pc),
|
||||
null,
|
||||
pc.CategoryName,
|
||||
pc.CounterName,
|
||||
pc.InstanceName,
|
||||
false,
|
||||
true);
|
||||
}
|
||||
catch (Exception)
|
||||
{
|
||||
}
|
||||
}
|
||||
|
||||
Assert.IsTrue(collector.PerformanceCounters.First().IsInBadState);
|
||||
Assert.IsFalse(collector.PerformanceCounters.Last().IsInBadState);
|
||||
}
|
||||
}
|
||||
}
|
Некоторые файлы не были показаны из-за слишком большого количества измененных файлов Показать больше
Загрузка…
Ссылка в новой задаче