diff --git a/Build.cmd b/Build.cmd deleted file mode 100644 index 47cb137..0000000 --- a/Build.cmd +++ /dev/null @@ -1,28 +0,0 @@ -@ECHO OFF - -setlocal - -set EnableNuGetPackageRestore=true - -set logOptions=/flp:Summary;Verbosity=detailed;LogFile=msbuild.log /flp1:warningsonly;logfile=msbuild.wrn /flp2:errorsonly;logfile=msbuild.err - -REM Find the most recent 32bit MSBuild.exe on the system. Require v14.0 (installed with VS2015) or later. Always quote the %MSBuild% value when setting the variable and never quote %MSBuild% references. -set MSBuild="%ProgramFiles(x86)%\Microsoft Visual Studio\2017\Enterprise\MSBuild\15.0\Bin\MSBuild.exe" -if not exist %MSBuild% ( - echo Could not find msbuild.exe. Please run this from a Visual Studio developer prompt - goto BuildFail -) - -%MSBuild% "%~dp0\Microsoft.AspNet.TelemetryCorrelation.msbuild" %logOptions% /v:minimal /maxcpucount /nodeReuse:false /p:Configuration=Release /p:Platform=AnyCPU %* -if %ERRORLEVEL% neq 0 goto BuildFail -goto BuildSuccess - -:BuildFail -echo. -echo *** BUILD FAILED *** -exit /B 999 - -:BuildSuccess -echo. -echo **** BUILD SUCCESSFUL *** -exit /B 0 diff --git a/CONTRIBUTING.md b/CONTRIBUTING.md index 5e4830e..1e61cc5 100644 --- a/CONTRIBUTING.md +++ b/CONTRIBUTING.md @@ -1,4 +1,25 @@ -Contributing -====== +# Contributing -Information on contributing to this repo is in the [Contributing Guide](https://github.com/aspnet/Home/blob/dev/CONTRIBUTING.md) in the Home repo. \ No newline at end of file +Information on contributing to this repo is in the [Contributing +Guide](https://github.com/aspnet/Home/blob/master/CONTRIBUTING.md) in +the Home repo. + +## Build and test + +1. Open project in Visual Studio 2017+. +2. Build and compile run unit tests right from Visual Studio. + +Command line: + +``` +dotnet build .\Microsoft.AspNet.TelemetryCorrelation.sln +dotnet test .\Microsoft.AspNet.TelemetryCorrelation.sln +dotnet pack .\Microsoft.AspNet.TelemetryCorrelation.sln +``` + +## Manual testing + +Follow readme to install http module to your application. + +Set `set PublicRelease=True` before build to produce delay-signed +assembly with the public key matching released version of assembly. \ No newline at end of file diff --git a/Microsoft.AspNet.TelemetryCorrelation.msbuild b/Microsoft.AspNet.TelemetryCorrelation.msbuild deleted file mode 100644 index e8ba554..0000000 --- a/Microsoft.AspNet.TelemetryCorrelation.msbuild +++ /dev/null @@ -1,43 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/Microsoft.AspNet.TelemetryCorrelation.sln b/Microsoft.AspNet.TelemetryCorrelation.sln index 4154895..ade595e 100644 --- a/Microsoft.AspNet.TelemetryCorrelation.sln +++ b/Microsoft.AspNet.TelemetryCorrelation.sln @@ -11,6 +11,11 @@ Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.TelemetryC EndProject Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Microsoft.AspNet.TelemetryCorrelation.Tests", "test\Microsoft.AspNet.TelemetryCorrelation.Tests\Microsoft.AspNet.TelemetryCorrelation.Tests.csproj", "{9FAE5C43-F56C-4D87-A23C-6D2D57B4ABED}" EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Solution Items", "Solution Items", "{504D7010-38CC-4B07-BC57-D7030209D631}" + ProjectSection(SolutionItems) = preProject + README.md = README.md + EndProjectSection +EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution Debug|Any CPU = Debug|Any CPU @@ -33,4 +38,7 @@ Global {4C8E592C-C532-4CF2-80EF-3BDD0D788D12} = {CE6B50B2-34AE-44C9-940A-4E48C3E1B3BC} {9FAE5C43-F56C-4D87-A23C-6D2D57B4ABED} = {258D5057-81B9-40EC-A872-D21E27452749} EndGlobalSection + GlobalSection(ExtensibilityGlobals) = postSolution + SolutionGuid = {6E28F11C-A0D8-461B-B71F-70F348C1BB53} + EndGlobalSection EndGlobal diff --git a/README.md b/README.md index ba6422e..6b86f9c 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,59 @@ # Telemetry correlation http module -Telemetry correlation http module enables cross tier telemetry tracking. +[![NuGet](https://img.shields.io/nuget/v/Microsoft.AspNet.TelemetryCorrelation.svg)](Microsoft.AspNet.TelemetryCorrelation) -- Reads http headers +Telemetry correlation http module enables cross tier telemetry tracking. + +## Usage + +1. Install NuGet for your app. +2. Enable diagnostics source listener using code below. Note, some + telemetry vendors like Azure Application Insights will enable it + automatically. + + ``` csharp + public class NoopDiagnosticsListener : IObserver> + { + public void OnCompleted() { } + + public void OnError(Exception error) { } + + public void OnNext(KeyValuePair evnt) + { + } + } + + public class NoopSubscriber : IObserver + { + public void OnCompleted() { } + + public void OnError(Exception error) { } + + public void OnNext(DiagnosticListener listener) + { + if (listener.Name == "Microsoft.AspNet.TelemetryCorrelation" || listener.Name == "System.Net.Http" ) + { + listener.Subscribe(new NoopDiagnosticsListener()); + } + } + } + ``` +3. Double check that http module was registered in `web.config` for your + app. + +Once enabled - this http module will: + +- Reads correlation http headers - Start/Stops Activity for the http request -- Ensure the Activity ambient state is transferred thru the IIS callbacks +- Ensure the Activity ambient state is transferred thru the IIS + callbacks -See http protocol [specifications](https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/HttpCorrelationProtocol.md) for details. +See http protocol [specifications][http-protocol-specification] for +details. +This http module is used by Application Insights. See +[documentation][usage-in-ai-code-docs] and [code][usage-in-ai-code]. -This http module is used by Application Insights. See [documentation](https://docs.microsoft.com/azure/application-insights/application-insights-correlation) and [code](https://github.com/Microsoft/ApplicationInsights-dotnet-server). - +[http-protocol-specification]: https://github.com/dotnet/corefx/blob/master/src/System.Diagnostics.DiagnosticSource/src/HttpCorrelationProtocol.md +[usage-in-ai-docs]: https://docs.microsoft.com/azure/application-insights/application-insights-correlation +[usage-in-ai-code]: https://github.com/Microsoft/ApplicationInsights-dotnet-server \ No newline at end of file diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/ActivityExtensions.cs b/src/Microsoft.AspNet.TelemetryCorrelation/ActivityExtensions.cs index 26a27cb..0b05914 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/ActivityExtensions.cs +++ b/src/Microsoft.AspNet.TelemetryCorrelation/ActivityExtensions.cs @@ -67,6 +67,7 @@ namespace Microsoft.AspNet.TelemetryCorrelation if (baggages != null) { int correlationContextLength = -1; + // there may be several Correlation-Context header foreach (var item in baggages) { diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.csproj b/src/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.csproj index 75151a7..145446c 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.csproj +++ b/src/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.csproj @@ -1,105 +1,94 @@ - - - - + + - Debug - AnyCPU {4C8E592C-C532-4CF2-80EF-3BDD0D788D12} Library Properties Microsoft.AspNet.TelemetryCorrelation Microsoft.AspNet.TelemetryCorrelation - v4.5 + net45 512 true - true - $(RepositoryRoot)tools\35MSSharedLib1024.snk - SAK - SAK - SAK - SAK $(OutputPath)$(AssemblyName).xml ..\..\ - true - - - - - + Microsoft.AspNet.TelemetryCorrelation.ruleset + true + prompt + 4 true + + + true + $(RepositoryRoot)tools\35MSSharedLib1024.snk + $(DefineConstants);PUBLIC_RELEASE + + + false + $(RepositoryRoot)tools\Debug.snk + + full false - DEBUG;TRACE - prompt - 4 - Microsoft.AspNet.TelemetryCorrelation.ruleset - true + $(DefineConstants);DEBUG;TRACE - + pdbonly true - TRACE - prompt - 4 - Microsoft.AspNet.TelemetryCorrelation.ruleset - true + $(DefineConstants);TRACE - true + Microsoft Corporation + + True + True + + Microsoft.AspNet.TelemetryCorrelation + + + Microsoft,aspnet + Microsoft Asp.Net telemetry correlation + A module that instruments incoming request with System.Diagnostics.Activity and notifies listeners with DiagnosticsSource. + © Microsoft Corporation. All rights reserved. + true + http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm + http://www.asp.net/ + http://go.microsoft.com/fwlink/?LinkID=288859 + Diagnostics DiagnosticSource Correlation Activity ASP.NET + https://github.com/aspnet/Microsoft.AspNet.TelemetryCorrelation/ + Git + Dependency + content - - ..\..\packages\System.Diagnostics.DiagnosticSource.4.5.0\lib\net45\System.Diagnostics.DiagnosticSource.dll - - - - - - - - + + + All + + + All + + + All + + - - - - - - + + - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - - - - Microsoft - MsSharedLib72 - - - - - \ No newline at end of file diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/Properties/AssemblyInfo.cs b/src/Microsoft.AspNet.TelemetryCorrelation/Properties/AssemblyInfo.cs index c34e129..bef71b4 100644 --- a/src/Microsoft.AspNet.TelemetryCorrelation/Properties/AssemblyInfo.cs +++ b/src/Microsoft.AspNet.TelemetryCorrelation/Properties/AssemblyInfo.cs @@ -1,19 +1,6 @@ -using System.Reflection; -using System.Runtime.CompilerServices; +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("Microsoft.AspNet.TelemetryCorrelation")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("Microsoft Corporation")] -[assembly: AssemblyProduct("Microsoft.AspNet.TelemetryCorrelation")] -[assembly: AssemblyCopyright("\x00a9 Microsoft Corporation. All rights reserved.")] -[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. @@ -22,4 +9,8 @@ using System.Runtime.InteropServices; // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("4c8e592c-c532-4cf2-80ef-3bdd0d788d12")] -[assembly: InternalsVisibleTo("Microsoft.AspNet.TelemetryCorrelation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] \ No newline at end of file +#if PUBLIC_RELEASE +[assembly: InternalsVisibleTo("Microsoft.AspNet.TelemetryCorrelation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")] +#else +[assembly: InternalsVisibleTo("Microsoft.AspNet.TelemetryCorrelation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100319b35b21a993df850846602dae9e86d8fbb0528a0ad488ecd6414db798996534381825f94f90d8b16b72a51c4e7e07cf66ff3293c1046c045fafc354cfcc15fc177c748111e4a8c5a34d3940e7f3789dd58a928add6160d6f9cc219680253dcea88a034e7d472de51d4989c7783e19343839273e0e63a43b99ab338149dd59f")] +#endif \ No newline at end of file diff --git a/src/Microsoft.AspNet.TelemetryCorrelation/packages.config b/src/Microsoft.AspNet.TelemetryCorrelation/packages.config deleted file mode 100644 index aa2ef1c..0000000 --- a/src/Microsoft.AspNet.TelemetryCorrelation/packages.config +++ /dev/null @@ -1,7 +0,0 @@ - - - - - - - \ No newline at end of file diff --git a/src/Packages/Microsoft.AspNet.TelemetryCorrelation/content/net45/web.config.install.xdt b/src/Microsoft.AspNet.TelemetryCorrelation/web.config.install.xdt similarity index 100% rename from src/Packages/Microsoft.AspNet.TelemetryCorrelation/content/net45/web.config.install.xdt rename to src/Microsoft.AspNet.TelemetryCorrelation/web.config.install.xdt diff --git a/src/Packages/Microsoft.AspNet.TelemetryCorrelation/content/net45/web.config.uninstall.xdt b/src/Microsoft.AspNet.TelemetryCorrelation/web.config.uninstall.xdt similarity index 100% rename from src/Packages/Microsoft.AspNet.TelemetryCorrelation/content/net45/web.config.uninstall.xdt rename to src/Microsoft.AspNet.TelemetryCorrelation/web.config.uninstall.xdt diff --git a/src/Packages/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.nuproj b/src/Packages/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.nuproj deleted file mode 100644 index e6f99d8..0000000 --- a/src/Packages/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.nuproj +++ /dev/null @@ -1,39 +0,0 @@ - - - - - $(MSBuildProjectName) - $(MSBuildProjectName) - $(MSBuildProjectName).nuspec - true - - - - $(AssemblyPath) - lib\net45 - - - $(OutputPath) - lib\net45 - - - $(OutputPath) - lib\net45 - - - - content\net45 - - - - - - $(PackageOutputDir) - - - - NuGet - - - - diff --git a/src/Packages/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.nuspec b/src/Packages/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.nuspec deleted file mode 100644 index 5074b09..0000000 --- a/src/Packages/Microsoft.AspNet.TelemetryCorrelation/Microsoft.AspNet.TelemetryCorrelation.nuspec +++ /dev/null @@ -1,22 +0,0 @@ - - - - $NuGetPackageId$ - Microsoft.AspNet.TelemetryCorrelation - $NuGetPackageVersion$ - Microsoft - Microsoft,aspnet - © Microsoft Corporation. All rights reserved. - http://go.microsoft.com/fwlink/?LinkID=288859 - A module that instruments incoming request with System.Diagnostics.Activity and notifies listeners with DiagnosticsSource. - A module that instruments incoming request with System.Diagnostics.Activity and notifies listeners with DiagnosticsSource. - en-US - http://www.asp.net/ - http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm - true - Diagnostics DiagnosticSource Correlation Activity ASP.NET - - - - - \ No newline at end of file diff --git a/src/Packages/Packages.csproj b/src/Packages/Packages.csproj deleted file mode 100644 index 6d70131..0000000 --- a/src/Packages/Packages.csproj +++ /dev/null @@ -1,31 +0,0 @@ - - - - - Release - AnyCPU - true - 8.0.30703 - 2.0 - {7EC5863F-7FF1-41C7-A384-8FFF81531E7A} - SAK - SAK - SAK - SAK - - - false - - - - - - - - - - - - - - \ No newline at end of file diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj b/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj index f574e99..334f123 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj +++ b/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Microsoft.AspNet.TelemetryCorrelation.Tests.csproj @@ -1,10 +1,5 @@ - - - - - - - + + Debug AnyCPU @@ -13,81 +8,64 @@ Properties Microsoft.AspNet.TelemetryCorrelation.Tests Microsoft.AspNet.TelemetryCorrelation.Tests - v4.5.2 + net452 512 - - + prompt + 4 - + true full false - DEBUG;TRACE - prompt - 4 + $(DefineConstants);DEBUG;TRACE - + pdbonly true - TRACE - prompt - 4 + $(DefineConstants);TRACE true - - $(RepositoryRoot)tools\35MSSharedLib1024.snk - - + true + $(RepositoryRoot)tools\35MSSharedLib1024.snk + $(DefineConstants);PUBLIC_RELEASE + + + false + $(RepositoryRoot)tools\Debug.snk - - ..\..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll - - - - ..\..\packages\System.Diagnostics.DiagnosticSource.4.5.0\lib\net45\System.Diagnostics.DiagnosticSource.dll - - - ..\..\packages\System.Reactive.Core.3.1.1\lib\net45\System.Reactive.Core.dll - True - - - ..\..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll - True - - - ..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll - True - - - ..\..\packages\xunit.assert.2.3.1\lib\netstandard1.1\xunit.assert.dll - - - ..\..\packages\xunit.extensibility.core.2.3.1\lib\netstandard1.1\xunit.core.dll - - - ..\..\packages\xunit.extensibility.execution.2.3.1\lib\net452\xunit.execution.desktop.dll - - - - - - - - - - + + + + + + + + + + + + + + + + + All + + + All + {4c8e592c-c532-4cf2-80ef-3bdd0d788d12} Microsoft.AspNet.TelemetryCorrelation @@ -96,35 +74,17 @@ - + Resources\web.config.install.xdt - + Resources\web.config.uninstall.xdt - + - - - - - - - - - - - This project references NuGet package(s) that are missing on this computer. Use NuGet Package Restore to download them. For more information, see http://go.microsoft.com/fwlink/?LinkID=322105. The missing file is {0}. - - - - - - - \ No newline at end of file diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Properties/AssemblyInfo.cs b/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Properties/AssemblyInfo.cs index 5effad2..652de0f 100644 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Properties/AssemblyInfo.cs +++ b/test/Microsoft.AspNet.TelemetryCorrelation.Tests/Properties/AssemblyInfo.cs @@ -1,20 +1,6 @@ -using System.Reflection; -using System.Runtime.CompilerServices; -using System.Runtime.InteropServices; +using System.Runtime.InteropServices; using Xunit; -// 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("Microsoft.AspNet.TelemetryCorrelation.Test")] -[assembly: AssemblyDescription("")] -[assembly: AssemblyConfiguration("")] -[assembly: AssemblyCompany("")] -[assembly: AssemblyProduct("Microsoft.AspNet.TelemetryCorrelation.Test")] -[assembly: AssemblyCopyright("Copyright © 2017")] -[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. @@ -23,14 +9,4 @@ using Xunit; // The following GUID is for the ID of the typelib if this project is exposed to COM [assembly: Guid("9fae5c43-f56c-4d87-a23c-6d2d57b4abed")] -// Version information for an assembly consists of the following four values: -// -// Major Version -// Minor Version -// Build Number -// Revision -// -// You can specify all the values or you can default the Build and Revision Numbers -// by using the '*' as shown below: -// [assembly: AssemblyVersion("1.0.*")] [assembly: CollectionBehavior(DisableTestParallelization = true)] \ No newline at end of file diff --git a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/packages.config b/test/Microsoft.AspNet.TelemetryCorrelation.Tests/packages.config deleted file mode 100644 index 78f78c9..0000000 --- a/test/Microsoft.AspNet.TelemetryCorrelation.Tests/packages.config +++ /dev/null @@ -1,16 +0,0 @@ - - - - - - - - - - - - - - - - \ No newline at end of file diff --git a/tools/Debug.snk b/tools/Debug.snk new file mode 100644 index 0000000..00c211e Binary files /dev/null and b/tools/Debug.snk differ diff --git a/tools/Microsoft.AspNet.TelemetryCorrelation.Extensions.settings.targets b/tools/Microsoft.AspNet.TelemetryCorrelation.Extensions.settings.targets deleted file mode 100644 index e7a3527..0000000 --- a/tools/Microsoft.AspNet.TelemetryCorrelation.Extensions.settings.targets +++ /dev/null @@ -1,23 +0,0 @@ - - - - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.AspNet.TelemetryCorrelation.sln))\ - - - - Release - $(RepositoryRootEx)bin\ - $(RepositoryRootEx)obj\ - $(BinPath)$(Configuration)\ - $(ObjPath)$(Configuration)\$(MSBuildProjectName)\ - - - - $(CodeSignOutputPath) - $(OutputPath) - - - - $(MSBuildThisFileDirectory)Microsoft.AspNet.TelemetryCorrelation.Extensions.targets - - diff --git a/tools/Microsoft.AspNet.TelemetryCorrelation.Extensions.targets b/tools/Microsoft.AspNet.TelemetryCorrelation.Extensions.targets deleted file mode 100644 index 69a505c..0000000 --- a/tools/Microsoft.AspNet.TelemetryCorrelation.Extensions.targets +++ /dev/null @@ -1,9 +0,0 @@ - - - - - $(NuGetPackageVersion)-b$(VersionBuild) - - - - diff --git a/tools/Microsoft.AspNet.TelemetryCorrelation.settings.props b/tools/Microsoft.AspNet.TelemetryCorrelation.settings.props new file mode 100644 index 0000000..0a1f01c --- /dev/null +++ b/tools/Microsoft.AspNet.TelemetryCorrelation.settings.props @@ -0,0 +1,65 @@ + + + + $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.AspNet.TelemetryCorrelation.sln))\ + + + + Release + $(RepositoryRoot)bin\ + $(RepositoryRoot)obj\ + $(BinPath)$(Configuration)\ + $(ObjPath)$(Configuration)\$(MSBuildProjectName)\ + + + + $(CodeSignOutputPath) + $(OutputPath) + + + + + rtm + 2018 + 1 + 0 + 4 + + $([MSBuild]::Add(1, $([MSBuild]::Subtract($([System.DateTime]::Now.Year), $(VersionStartYear)))))$([System.DateTime]::Now.ToString("MMdd")) + 0 + 0 + + $(MSBuildThisFileDirectory)Microsoft.AspNet.TelemetryCorrelation.Extensions.settings.targets + $(VersionRelease)-$(BuildQuality) + + + + $(VersionMajor).$(VersionMinor).$(VersionRelease) + -$(BuildQuality) + $(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision) + $(VersionMajor).$(VersionMinor).$(VersionRelease)-$(VersionBuild) + $(VersionMajor).$(VersionMinor).$(VersionRelease).0 + + + + + + Release + $(RepositoryRoot)bin\$(Configuration)\ + $(RepositoryRoot)obj\$(Configuration)\$(MSBuildProjectName)\ + + + + + + Microsoft + + MsSharedLib72 + + + + + + + + diff --git a/tools/Microsoft.AspNet.TelemetryCorrelation.settings.targets b/tools/Microsoft.AspNet.TelemetryCorrelation.settings.targets deleted file mode 100644 index 6e8cada..0000000 --- a/tools/Microsoft.AspNet.TelemetryCorrelation.settings.targets +++ /dev/null @@ -1,47 +0,0 @@ - - - - $(MSBuildThisFileDirectory)Microsoft.AspNet.TelemetryCorrelation.Extensions.settings.targets - rtm - 2018 - 1 - 0 - 4 - $(VersionRelease)-$(BuildQuality) - - - - 4.5.0 - - - - - $([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Microsoft.AspNet.TelemetryCorrelation.sln'))\ - - - - - - Release - $(RepositoryRoot)bin\$(Configuration)\ - $(RepositoryRoot)obj\$(Configuration)\$(MSBuildProjectName)\ - - - - $(OutputPath) - $(AssemblyPath)Packages - $(AssemblyPath)\SymbolPackages - $(OutputPath)test\ - - - - $(RepositoryRoot)packages\ - true - $(RepositoryRoot)\src\$(MSBuildProjectName)\ - - - - $(RepositoryRoot)tools\Microsoft.AspNet.TelemetryCorrelation.targets - $(CustomAfterMicrosoftCommonTargets) - - diff --git a/tools/Microsoft.AspNet.TelemetryCorrelation.targets b/tools/Microsoft.AspNet.TelemetryCorrelation.targets deleted file mode 100644 index 037c809..0000000 --- a/tools/Microsoft.AspNet.TelemetryCorrelation.targets +++ /dev/null @@ -1,29 +0,0 @@ - - - - - SetNuSpecProperties;$(BuildDependsOn) - - - - - - - - $(AssemblyVersion) - - - - - - - - - - NuGetPackageVersion=$(NuGetPackageVersion); - NuGetPackageId=$(NuGetPackageId); - DiagnosticSourceNuGetPackageVersion=$(DiagnosticSourceNuGetPackageVersion) - - - - diff --git a/tools/NuGet.targets b/tools/NuGet.targets deleted file mode 100644 index f943812..0000000 --- a/tools/NuGet.targets +++ /dev/null @@ -1,144 +0,0 @@ - - - - $(MSBuildProjectDirectory)\..\ - - - false - - - false - - - true - - - false - - - - - - - - - - - $([System.IO.Path]::Combine($(SolutionDir), ".nuget")) - - - - - $(SolutionDir).nuget - - - - $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config - $(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config - - - - $(MSBuildProjectDirectory)\packages.config - $(PackagesProjectConfig) - - - - - $(NuGetToolsPath)\NuGet.exe - @(PackageSource) - - "$(NuGetExePath)" - mono --runtime=v4.0.30319 $(NuGetExePath) - - $(TargetDir.Trim('\\')) - - -RequireConsent - -NonInteractive - - "$(SolutionDir) " - "$(SolutionDir)" - - - $(NuGetCommand) install "$(PackagesConfig)" -source "$(PackageSources)" $(NonInteractiveSwitch) $(RequireConsentSwitch) -solutionDir $(PaddedSolutionDir) - $(NuGetCommand) pack "$(ProjectPath)" -Properties "Configuration=$(Configuration);Platform=$(Platform)" $(NonInteractiveSwitch) -OutputDirectory "$(PackageOutputDir)" -symbols - - - - RestorePackages; - $(BuildDependsOn); - - - - - $(BuildDependsOn); - BuildPackage; - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/NuGetProj.targets b/tools/NuGetProj.targets deleted file mode 100644 index 5f181a1..0000000 --- a/tools/NuGetProj.targets +++ /dev/null @@ -1,501 +0,0 @@ - - - - - - - Debug - bin\$(Configuration)\ - obj\$(Configuration)\ - $(IntermediateOutputPath)$(NuGetPackageLanguage)\ - - - - - - - $(MSBuildProjectName) - $(NuSpecId) - $(NuSpecVersion) - $(NuGetPackageVersion) - - - - 2 - true - false - $(MSBuildProjectDirectory)\$(NuGetPackageId).nuspec - $([System.IO.Path]::GetFileName('$(NuSpecFile)')) - true - $(IntermediateOutputPath)$(NuGetPackageId).outputs - - - - $([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileFullPath)', '.nuget\nuget.targets'))\.nuget\NuGet.exe - $([System.IO.Path]::GetDirectoryName('$(NuGetExePath)')) - $(NuGetOutputPath) - $(OutputPath)NuGet - $(PackageOutputDir.TrimEnd('\')) - $(PackageOutputDir) - $(IntermediateOutputPath)$(NuSpecFileName) - - - - $(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll - $(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath);$(MSBuildProjectFullPath) - - - - - - - $(NuGetContentSource) - $(NuGetContentDestination) - - - - - - - - - - - - - - - - - - - - $(SourceRootFullPath) - src - - - - - - - - - - - - - $(NuSpecId) - - - $(NuSpecVersion) - - - $(NuSpecTitle) - - - $(NuSpecAuthors) - - - $(NuSpecOwners) - - - $(NuSpecDescription) - - - $(NuSpecTags) - - - $(NuSpecIconUrl) - - - $(NuSpecProjectUrl) - - - $(NuSpecLicenseUrl) - - - $(NuSpecCopyright) - - - $(NuSpecRequireLicenseAcceptance) - - - $(NuSpecReleaseNotes) - - - $(NuSpecSummary) - - - $(NuSpecDevelopmentDependency) - - - $(NuSpecLanguage) - - - - - - - - - - BeforeBuild;GetNuGetContentFromProject;ValidateNuGetParams;ReadNuGetCleanOutputs;GetNuGetProjectInputs;GetNuGetProjectOutputs;ValidateOutputs;NuGetPack;WriteNuGetProjectOutputs;AfterBuild - BeforeClean;ReadNuGetCleanOutputs;CoreClean;AfterClean - Clean;Build - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - $([System.IO.Path]::GetFullPath($(SourceRootFullPath))) - - - - - - - $([System.IO.Path]::Combine($(Destination), $([MSBuild]::MakeRelative($([System.IO.Path]::GetFullPath($(SourceRootFullPath))), %(Compile.RootDir)%(Directory))))) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - @(NuSpecProperties) - -NoPackageAnalysis - -NoPackageAnalysis -symbols - - $(BuildCommand.Replace('-symbols', '')) - $(BuildCommand.Replace('/symbols', '')) - $(BuildCommand) -Properties "$(NuSpecProperties)" - $(BuildCommand) $(NuGetPackOptions) - - - - - - - - - - - - - - - - - - - - - - - $(PackageOutputDir)\$(NuGetPackageId).$(NuGetPackageVersion).nupkg - $(PackageOutputDir)\$(NuGetPackageId).$(NuGetPackageVersion).symbols.nupkg - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - 1) { - XNamespace pkgNs = "http://schemas.microsoft.com/packaging/2010/07/nuspec.xsd"; - packageNode = new XElement(pkgNs + "package", new XElement("metadata", new XAttribute("schemaVersion", SchemaVersion))); - } else { - packageNode = new XElement("package", new XElement("metadata")); - } - } - GeneratedNuSpec = Path.GetFullPath(Path.Combine(OutputDir, Path.GetFileName(NuSpecFile))); - if (File.Exists(GeneratedNuSpec)) File.Delete(GeneratedNuSpec); - XNamespace ns = packageNode.Name.Namespace; - - if(packageNode.Name.LocalName != "package") { Log.LogError("NuSpec file missing 'package' schema element. Found:'{0}'", packageNode.Name.LocalName); return false; }; - if (Files == null) Files = new TaskItem[] { }; - if (Dependencies == null) Dependencies = new TaskItem[] { }; - if (MetadataItems == null) MetadataItems = new TaskItem[] { }; - if (FrameworkAssemblies == null) FrameworkAssemblies = new TaskItem[] { }; - - // replace/add simple metadata. - XElement metadataNode = packageNode.FirstNode as XElement; - if(metadataNode == null) { Log.LogError("NuSpec file missing 'metadata' schema element"); return false; }; - foreach (var metaItem in MetadataItems) { - string name = metaItem.GetMetadata("Identity"); - string value = metaItem.GetMetadata("Value"); - XElement xnode = metadataNode.Descendants(ns + name).FirstOrDefault(); - if (xnode == null) { xnode = new XElement(name); metadataNode.Add(xnode); } - xnode.Value = value; - } - - // replaceable values for dependencies and frameworkassemblies - just replace the whole node. - var removeQ1 = from dependencyNode in packageNode.Descendants(ns + "dependency").Attributes("id") - from dependencyItem in Dependencies - where dependencyItem.GetMetadata("Identity").ToLower().Equals(dependencyNode.Value.ToLower()) - select dependencyNode.Parent; - - var removeQ2 = from assemblyNode in packageNode.Descendants(ns + "frameworkAssembly").Attributes("assemblyName") - from assemblyItem in FrameworkAssemblies - where assemblyItem.GetMetadata("Identity").ToLower().Equals(assemblyNode.Value.ToLower()) - select assemblyNode.Parent; - - foreach (var node in removeQ1.ToArray()) node.Remove(); - foreach (var node in removeQ2.ToArray()) node.Remove(); - - XElement filesNode = packageNode.Descendants(ns + "files").FirstOrDefault(); - if (filesNode == null) { - filesNode = new XElement("files"); - packageNode.Add(filesNode); - } - filesNode.Add(from fi in Files select new XElement("file", new XAttribute("src", fi.GetMetadata("FullPath")), new XAttribute("target", fi.GetMetadata("Destination")))); - - XElement frameworkAssembliesNode = packageNode.Descendants(ns + "frameworkAssemblies").FirstOrDefault(); - if (frameworkAssembliesNode == null) { - frameworkAssembliesNode = new XElement("frameworkAssemblies"); - metadataNode.Add(frameworkAssembliesNode); - } - frameworkAssembliesNode.Add(from assembly in FrameworkAssemblies select new XElement("frameworkAssembly", - new XAttribute("assemblyName", assembly.GetMetadata("Identity")), new XAttribute("targetFramework", assembly.GetMetadata("TargetFramework")))); - - XElement dependenciesNode = packageNode.Descendants(ns + "dependencies").FirstOrDefault(); - if (dependenciesNode == null) { - dependenciesNode = new XElement("dependencies"); - metadataNode.Add(dependenciesNode); - } - if(SchemaVersion > 1) { - var depGroupsQ = from dp in Dependencies group dp by dp.GetMetadata("TargetFramework"); - foreach (var dpGroup in depGroupsQ) { - XElement depGroupNode = new XElement("group"); - string targetFx = dpGroup.First().GetMetadata("TargetFramework"); - if(!string.IsNullOrEmpty(targetFx)) depGroupNode.Add(new XAttribute("targetFramework", dpGroup.First().GetMetadata("TargetFramework"))); - foreach(var depItem in dpGroup) { - XElement dependencyNode = new XElement("dependency", new XAttribute("id", depItem.GetMetadata("Identity")), new XAttribute("version", depItem.GetMetadata("Version"))); - depGroupNode.Add(dependencyNode); - } - dependenciesNode.Add(depGroupNode); - } - } else { - dependenciesNode.Add(from dp in Dependencies select new XElement("dependency", new XAttribute("id", dp.GetMetadata("Identity")), new XAttribute("version", dp.GetMetadata("Version")))); - } - - if (!Directory.Exists(OutputDir)) Directory.CreateDirectory(OutputDir); - packageNode.Save(GeneratedNuSpec); - ]]> - - - - - - - - - - - - - - - - - - - - - - diff --git a/tools/NuProj.Tasks.dll b/tools/NuProj.Tasks.dll deleted file mode 100644 index 5f5bf4b..0000000 Binary files a/tools/NuProj.Tasks.dll and /dev/null differ diff --git a/tools/NuProj.targets b/tools/NuProj.targets deleted file mode 100644 index 4e46318..0000000 --- a/tools/NuProj.targets +++ /dev/null @@ -1,129 +0,0 @@ - - - - - - - $(MSBuildProjectDirectory)\bin\ - $(MSBuildProjectDirectory)\obj\ - $(IntermediateOutputPath)$(Id).nuspec - - $(MSBuildThisFileDirectory)NuProj.Tasks.dll - $(MSBuildThisFileDirectory) - NuGet.exe - - - - - - $(OutDir)$(Id).$(Version).nupkg - - - - - - $(MSBuildAllProjects);$(MSBuildProjectFullPath) - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - <_ToBeDeleted Include="$(NuSpecPath)" /> - <_ToBeDeleted Include="$(NuGetOuputPath)" /> - - - - - - - - - \ No newline at end of file diff --git a/tools/version.targets b/tools/version.targets deleted file mode 100644 index 2043058..0000000 --- a/tools/version.targets +++ /dev/null @@ -1,113 +0,0 @@ - - - - - - - - - true - false - - - - 2016 - INVALID_VersionMajor - INVALID_VersionMinor - $([MSBuild]::Add(1, $([MSBuild]::Subtract($([System.DateTime]::Now.Year), $(VersionStartYear)))))$([System.DateTime]::Now.ToString("MMdd")) - 0 - 0 - - - - - - $(VersionMajor).$(VersionMinor).0.$(VersionRevision) - $(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision) - $(VersionMajor).$(VersionMinor).$(VersionRelease)-$(VersionBuild) - $(AssemblyFileVersion) - $(IntermediateOutputPath)$(MSBuildProjectName).version.cs - - - - $(VersionMajor).$(VersionMinor).$(VersionRelease) - $(NuGetPackageVersion)-$(BuildQuality) - - - - - - - - - - - - - $(DefineConstants);BUILD_GENERATED_VERSION - - - - - $(MSBuildAllProjects);$(MSBuildThisFileFullPath) - - - - - GenerateVersionFile;$(CompileDependsOn) - ValidateVersionValues;ShouldGenerateVersionFile;GenerateVersionFileCore - - - - - - - - - - - - - - - - - - - - - - - - - - - - @(VersionText) - !$(VersionText.Contains('$(AssemblyFileVersion)')) - - - - - - - $([System.Convert]::ToInt16('$(VersionMajor)')) - $([System.Convert]::ToInt16('$(VersionMinor)')) - $([System.Convert]::ToInt16('$(VersionBuild)')) - $([System.Convert]::ToInt16('$(VersionRevision)')) - - - -