Convert to modern csproj files and a bit of clean up (#38)

This commit is contained in:
Sergey Kanzhelev 2018-08-31 15:17:06 -07:00 коммит произвёл Liudmila Molkova
Родитель 7b9d807a97
Коммит 59c8735622
28 изменённых файлов: 256 добавлений и 1380 удалений

Просмотреть файл

@ -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

Просмотреть файл

@ -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.
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.

Просмотреть файл

@ -1,43 +0,0 @@
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<ItemGroup>
<AssemblyProject Include="src\Microsoft.AspNet.TelemetryCorrelation\Microsoft.AspNet.TelemetryCorrelation.csproj" />
</ItemGroup>
<ItemGroup>
<PackageProject Include="src\Packages\Packages.csproj" />
</ItemGroup>
<Target Name="Build" DependsOnTargets="BuildAssemblies;BuildPackages" />
<Target Name="Clean" DependsOnTargets="CleanPackages;CleanAssemblies" />
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
<!-- Core build-->
<Target Name="BuildAssemblies" DependsOnTargets="RestorePackages">
<MSBuild Targets="Build" Projects="@(AssemblyProject)" />
</Target>
<Target Name="CleanAssemblies">
<MSBuild Targets="Clean" Projects="@(AssemblyProject)" />
</Target>
<Target Name="RebuildAssemblies" DependsOnTargets="Clean;Build" />
<!-- Packages build -->
<Target Name="BuildPackages" DependsOnTargets="RestorePackages">
<MSBuild Targets="" Projects="@(PackageProject)" />
</Target>
<Target Name="CleanPackages">
<MSBuild Targets="Clean" Projects="@(PackageProject)" />
</Target>
<Target Name="RebuildPackages" DependsOnTargets="CleanPackages;BuildPackages" />
<Target Name="RestorePackages">
<Exec Command=".nuget\NuGet.exe restore" />
</Target>
<Import Project="tools\Microsoft.AspNet.TelemetryCorrelation.targets" />
</Project>

Просмотреть файл

@ -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

Просмотреть файл

@ -1,13 +1,59 @@
# Telemetry correlation http module
[![NuGet](https://img.shields.io/nuget/v/Microsoft.AspNet.TelemetryCorrelation.svg)](Microsoft.AspNet.TelemetryCorrelation)
Telemetry correlation http module enables cross tier telemetry tracking.
- Reads http headers
## 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<KeyValuePair<string, object>>
{
public void OnCompleted() { }
public void OnError(Exception error) { }
public void OnNext(KeyValuePair<string, object> evnt)
{
}
}
public class NoopSubscriber : IObserver<DiagnosticListener>
{
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

Просмотреть файл

@ -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)
{

Просмотреть файл

@ -1,105 +1,94 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="15.0" 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($(MSBuildThisFileDirectory),Microsoft.AspNet.TelemetryCorrelation.sln))\tools\Microsoft.AspNet.TelemetryCorrelation.settings.targets" />
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.AspNet.TelemetryCorrelation.sln))\tools\Microsoft.AspNet.TelemetryCorrelation.settings.props" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{4C8E592C-C532-4CF2-80EF-3BDD0D788D12}</ProjectGuid>
<OutputType>Library</OutputType>
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.TelemetryCorrelation</RootNamespace>
<AssemblyName>Microsoft.AspNet.TelemetryCorrelation</AssemblyName>
<TargetFrameworkVersion>v4.5</TargetFrameworkVersion>
<TargetFrameworks>net45</TargetFrameworks>
<FileAlignment>512</FileAlignment>
<SignAssembly>true</SignAssembly>
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>$(RepositoryRoot)tools\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
<DocumentationFile>$(OutputPath)$(AssemblyName).xml</DocumentationFile>
<SolutionDir Condition="$(SolutionDir) == '' Or $(SolutionDir) == '*Undefined*'">..\..\</SolutionDir>
<RestorePackages>true</RestorePackages>
<TargetFrameworkProfile />
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<CodeAnalysisRuleSet>Microsoft.AspNet.TelemetryCorrelation.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DebugSymbols>true</DebugSymbols>
</PropertyGroup>
<PropertyGroup Condition=" '$(PublicRelease)' == 'True' ">
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>$(RepositoryRoot)tools\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
<DefineConstants>$(DefineConstants);PUBLIC_RELEASE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(PublicRelease)' != 'True' ">
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>$(RepositoryRoot)tools\Debug.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>Microsoft.AspNet.TelemetryCorrelation.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis>
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<CodeAnalysisRuleSet>Microsoft.AspNet.TelemetryCorrelation.ruleset</CodeAnalysisRuleSet>
<RunCodeAnalysis>true</RunCodeAnalysis>
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<DebugSymbols>true</DebugSymbols>
<Company>Microsoft Corporation</Company>
<!--https://docs.microsoft.com/en-us/nuget/schema/msbuild-targets-->
<GeneratePackageOnBuild>True</GeneratePackageOnBuild>
<IncludeSymbols>True</IncludeSymbols>
<!--PackageOutputPath>Defined in Directory.Build.props</PackageOutputPath-->
<PackageId>Microsoft.AspNet.TelemetryCorrelation</PackageId>
<!--PackageVersion is defined in from VersionPrefix and VersionSuffix -->
<!--PackageVersion></PackageVersion-->
<Authors>Microsoft,aspnet</Authors>
<Title>Microsoft Asp.Net telemetry correlation</Title>
<Description>A module that instruments incoming request with System.Diagnostics.Activity and notifies listeners with DiagnosticsSource.</Description>
<Copyright>© Microsoft Corporation. All rights reserved.</Copyright>
<PackageRequireLicenseAcceptance>true</PackageRequireLicenseAcceptance>
<PackageLicenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</PackageLicenseUrl>
<PackageProjectUrl>http://www.asp.net/</PackageProjectUrl>
<PackageIconUrl>http://go.microsoft.com/fwlink/?LinkID=288859</PackageIconUrl>
<PackageTags>Diagnostics DiagnosticSource Correlation Activity ASP.NET</PackageTags>
<RepositoryUrl>https://github.com/aspnet/Microsoft.AspNet.TelemetryCorrelation/</RepositoryUrl>
<RepositoryType>Git</RepositoryType>
<PackageType>Dependency</PackageType>
<ContentTargetFolders>content</ContentTargetFolders>
</PropertyGroup>
<ItemGroup>
<Reference Include="System" />
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Diagnostics.DiagnosticSource.4.5.0\lib\net45\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
</ItemGroup>
<ItemGroup>
<Compile Include="ActivityExtensions.cs" />
<Compile Include="ActivityHelper.cs" />
<Compile Include="TelemetryCorrelationHttpModule.cs" />
<Compile Include="AspNetTelemetryCorrelationEventSource.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<!--
<PackageReference Include="Desktop.Analyzers" Version="1.1.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
-->
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="MicroBuild.Core" Version="0.3.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="Microsoft.Diagnostics.Tracing.EventRegister" Version="1.1.28" Condition="$(OS) == 'Windows_NT'">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0" />
</ItemGroup>
<ItemGroup>
<None Include="Microsoft.AspNet.TelemetryCorrelation.ruleset" />
<None Include="packages.config"/>
</ItemGroup>
<ItemGroup>
<None Include="35MSSharedLib1024.snk" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\Newtonsoft.Json.dll" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.CodeFixes.dll" />
<Analyzer Include="..\..\packages\StyleCop.Analyzers.1.0.0\analyzers\dotnet\cs\StyleCop.Analyzers.dll" />
<Content Include="web.config.install.xdt"/>
<Content Include="web.config.uninstall.xdt"/>
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Import Project="..\..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.1.28\build\Microsoft.Diagnostics.Tracing.EventRegister.targets" Condition="Exists('..\..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.1.28\build\Microsoft.Diagnostics.Tracing.EventRegister.targets')" />
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.1.28\build\Microsoft.Diagnostics.Tracing.EventRegister.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\Microsoft.Diagnostics.Tracing.EventRegister.1.1.28\build\Microsoft.Diagnostics.Tracing.EventRegister.targets'))" />
<Error Condition="!Exists('..\..\packages\MicroBuild.Core.0.3.0\build\MicroBuild.Core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MicroBuild.Core.0.3.0\build\MicroBuild.Core.props'))" />
<Error Condition="!Exists('..\..\packages\MicroBuild.Core.0.3.0\build\MicroBuild.Core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\MicroBuild.Core.0.3.0\build\MicroBuild.Core.targets'))" />
</Target>
<Import Project="..\..\packages\MicroBuild.Core.0.3.0\build\MicroBuild.Core.targets" Condition="Exists('..\..\packages\MicroBuild.Core.0.3.0\build\MicroBuild.Core.targets')" />
<Target Name="AddToSign" AfterTargets="AfterBuild">
<ItemGroup>
<FilesToSign Include="$(TargetPath)" Condition="'$(SignAssembly)' == 'true'">
<Authenticode>Microsoft</Authenticode>
<StrongName>MsSharedLib72</StrongName>
</FilesToSign>
</ItemGroup>
<Message Text="FilesToSign: %(FilesToSign.Identity); %(FilesToSign.Authenticode); %(FilesToSign.StrongName)" Importance="high"/>
</Target>
</Project>

Просмотреть файл

@ -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")]
#if PUBLIC_RELEASE
[assembly: InternalsVisibleTo("Microsoft.AspNet.TelemetryCorrelation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
#else
[assembly: InternalsVisibleTo("Microsoft.AspNet.TelemetryCorrelation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100319b35b21a993df850846602dae9e86d8fbb0528a0ad488ecd6414db798996534381825f94f90d8b16b72a51c4e7e07cf66ff3293c1046c045fafc354cfcc15fc177c748111e4a8c5a34d3940e7f3789dd58a928add6160d6f9cc219680253dcea88a034e7d472de51d4989c7783e19343839273e0e63a43b99ab338149dd59f")]
#endif

Просмотреть файл

@ -1,7 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="MicroBuild.Core" version="0.3.0" targetFramework="net45" developmentDependency="true" />
<package id="Microsoft.Diagnostics.Tracing.EventRegister" version="1.1.28" targetFramework="net45" />
<package id="StyleCop.Analyzers" version="1.0.0" targetFramework="net45" developmentDependency="true" />
<package id="System.Diagnostics.DiagnosticSource" version="4.5.0" targetFramework="net45" />
</packages>

Просмотреть файл

@ -1,39 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.AspNet.TelemetryCorrelation.sln))\tools\Microsoft.AspNet.TelemetryCorrelation.settings.targets" />
<PropertyGroup>
<AssemblyName>$(MSBuildProjectName)</AssemblyName>
<NuGetPackageId>$(MSBuildProjectName)</NuGetPackageId>
<NuSpecFile>$(MSBuildProjectName).nuspec</NuSpecFile>
<IsPackage>true</IsPackage>
</PropertyGroup>
<ItemGroup>
<NuGetContent Include="$(AssemblyName).dll">
<Source>$(AssemblyPath)</Source>
<Destination>lib\net45</Destination>
</NuGetContent>
<NuGetContent Include="$(AssemblyName).xml">
<Source>$(OutputPath)</Source>
<Destination>lib\net45</Destination>
</NuGetContent>
<NuGetContent Include="$(AssemblyName).pdb" Condition="'$(NuGetPackSymbols)' == 'true'">
<Source>$(OutputPath)</Source>
<Destination>lib\net45</Destination>
</NuGetContent>
<NuGetContentProject Include="$(RepositoryRoot)\src\$(MSBuildProjectName)\$(MSBuildProjectName).csproj" Condition="'$(NuGetPackSymbols)' == 'true'" />
<NuGetContent Include="content\net45\*">
<Destination>content\net45</Destination>
</NuGetContent>
</ItemGroup>
<Import Project="$(RepositoryRoot)tools\NuGetProj.targets"/>
<Target Name="AfterBuild">
<PropertyGroup>
<OutDir>$(PackageOutputDir)</OutDir>
</PropertyGroup>
<ItemGroup>
<FilesToSign Include="$(NuGetPackTargetFile)" Condition="'$(SignAssembly)' == 'true'">
<Authenticode>NuGet</Authenticode>
</FilesToSign>
</ItemGroup>
</Target>
</Project>

Просмотреть файл

@ -1,22 +0,0 @@
<?xml version="1.0"?>
<package xmlns="http://schemas.microsoft.com/packaging/2012/06/nuspec.xsd">
<metadata>
<id>$NuGetPackageId$</id>
<title>Microsoft.AspNet.TelemetryCorrelation</title>
<version>$NuGetPackageVersion$</version>
<authors>Microsoft</authors>
<owners>Microsoft,aspnet</owners>
<copyright>&#169; Microsoft Corporation. All rights reserved.</copyright>
<iconUrl>http://go.microsoft.com/fwlink/?LinkID=288859</iconUrl>
<description>A module that instruments incoming request with System.Diagnostics.Activity and notifies listeners with DiagnosticsSource.</description>
<summary>A module that instruments incoming request with System.Diagnostics.Activity and notifies listeners with DiagnosticsSource.</summary>
<language>en-US</language>
<projectUrl>http://www.asp.net/</projectUrl>
<licenseUrl>http://www.microsoft.com/web/webpi/eula/net_library_eula_ENU.htm</licenseUrl>
<requireLicenseAcceptance>true</requireLicenseAcceptance>
<tags>Diagnostics DiagnosticSource Correlation Activity ASP.NET</tags>
<dependencies>
<dependency id="System.Diagnostics.DiagnosticSource" version="$DiagnosticSourceNuGetPackageVersion$" />
</dependencies>
</metadata>
</package>

Просмотреть файл

@ -1,31 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.AspNet.TelemetryCorrelation.sln))\tools\Microsoft.AspNet.TelemetryCorrelation.settings.targets" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Release</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<SkipCopyBuildProduct>true</SkipCopyBuildProduct>
<ProductVersion>8.0.30703</ProductVersion>
<SchemaVersion>2.0</SchemaVersion>
<ProjectGuid>{7EC5863F-7FF1-41C7-A384-8FFF81531E7A}</ProjectGuid>
<SccProjectName>SAK</SccProjectName>
<SccLocalPath>SAK</SccLocalPath>
<SccAuxPath>SAK</SccAuxPath>
<SccProvider>SAK</SccProvider>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<UseVSHostingProcess>false</UseVSHostingProcess>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' " />
<ItemGroup>
<NuGetProject Include="Microsoft.AspNet.TelemetryCorrelation\Microsoft.AspNet.TelemetryCorrelation.nuproj" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<Target Name="Build">
<MSBuild Projects="@(NuGetProject)" Targets="Build" />
</Target>
<Target Name="Clean">
<MSBuild Projects="@(NuGetProject)" Targets="Clean" />
</Target>
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
</Project>

Просмотреть файл

@ -1,10 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="14.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="..\..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props" Condition="Exists('..\..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props')" />
<Import Project="..\..\packages\xunit.core.2.3.1\build\xunit.core.props" Condition="Exists('..\..\packages\xunit.core.2.3.1\build\xunit.core.props')" />
<Import Project="..\..\packages\xunit.runner.msbuild.2.2.0\build\net452\xunit.runner.msbuild.props" Condition="Exists('..\..\packages\xunit.runner.msbuild.2.2.0\build\net452\xunit.runner.msbuild.props')" />
<Import Project="$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props" Condition="Exists('$(MSBuildExtensionsPath)\$(MSBuildToolsVersion)\Microsoft.Common.props')" />
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.AspNet.TelemetryCorrelation.sln))\tools\Microsoft.AspNet.TelemetryCorrelation.settings.targets" />
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.AspNet.TelemetryCorrelation.sln))\tools\Microsoft.AspNet.TelemetryCorrelation.settings.props" />
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
@ -13,81 +8,64 @@
<AppDesignerFolder>Properties</AppDesignerFolder>
<RootNamespace>Microsoft.AspNet.TelemetryCorrelation.Tests</RootNamespace>
<AssemblyName>Microsoft.AspNet.TelemetryCorrelation.Tests</AssemblyName>
<TargetFrameworkVersion>v4.5.2</TargetFrameworkVersion>
<TargetFrameworks>net452</TargetFrameworks>
<FileAlignment>512</FileAlignment>
<NuGetPackageImportStamp>
</NuGetPackageImportStamp>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' ">
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>DEBUG;TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' ">
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>TRACE</DefineConstants>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</PropertyGroup>
<PropertyGroup>
<AssemblyOriginatorKeyFile>$(RepositoryRoot)tools\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<PropertyGroup>
<PropertyGroup Condition=" '$(PublicRelease)' == 'True' ">
<DelaySign>true</DelaySign>
<AssemblyOriginatorKeyFile>$(RepositoryRoot)tools\35MSSharedLib1024.snk</AssemblyOriginatorKeyFile>
<DefineConstants>$(DefineConstants);PUBLIC_RELEASE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(PublicRelease)' != 'True' ">
<DelaySign>false</DelaySign>
<AssemblyOriginatorKeyFile>$(RepositoryRoot)tools\Debug.snk</AssemblyOriginatorKeyFile>
</PropertyGroup>
<ItemGroup>
<Reference Include="Microsoft.Web.XmlTransform, Version=2.1.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<HintPath>..\..\packages\Microsoft.Web.Xdt.2.1.1\lib\net40\Microsoft.Web.XmlTransform.dll</HintPath>
</Reference>
<Reference Include="System" />
<Reference Include="System.Diagnostics.DiagnosticSource, Version=4.0.3.0, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Diagnostics.DiagnosticSource.4.5.0\lib\net45\System.Diagnostics.DiagnosticSource.dll</HintPath>
</Reference>
<Reference Include="System.Reactive.Core, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.Core.3.1.1\lib\net45\System.Reactive.Core.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Reactive.Interfaces, Version=3.0.1000.0, Culture=neutral, PublicKeyToken=94bc3704cddfc263, processorArchitecture=MSIL">
<HintPath>..\..\packages\System.Reactive.Interfaces.3.1.1\lib\net45\System.Reactive.Interfaces.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="System.Web" />
<Reference Include="System.Xml.Linq" />
<Reference Include="System.Data.DataSetExtensions" />
<Reference Include="Microsoft.CSharp" />
<Reference Include="System.Net.Http" />
<Reference Include="System.Xml" />
<Reference Include="xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.abstractions.2.0.1\lib\net35\xunit.abstractions.dll</HintPath>
<Private>True</Private>
</Reference>
<Reference Include="xunit.assert, Version=2.3.1.3858, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.assert.2.3.1\lib\netstandard1.1\xunit.assert.dll</HintPath>
</Reference>
<Reference Include="xunit.core, Version=2.3.1.3858, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.extensibility.core.2.3.1\lib\netstandard1.1\xunit.core.dll</HintPath>
</Reference>
<Reference Include="xunit.execution.desktop, Version=2.3.1.3858, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c, processorArchitecture=MSIL">
<HintPath>..\..\packages\xunit.extensibility.execution.2.3.1\lib\net452\xunit.execution.desktop.dll</HintPath>
</Reference>
</ItemGroup>
<ItemGroup>
<Compile Include="ActivityExtensionsTest.cs" />
<Compile Include="ActivityHelperTest.cs" />
<Compile Include="HttpContextHelper.cs" />
<Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="TestDiagnosticListener.cs" />
<Compile Include="WebConfigWithLocaltionTagTransformTest.cs" />
<Compile Include="WebConfigTransformTest.cs" />
</ItemGroup>
<ItemGroup>
<PackageReference Include="Microsoft.Web.Xdt" Version="2.1.1" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="4.5.0"/>
<PackageReference Include="System.Reactive.Core" Version="3.1.1"/>
<PackageReference Include="System.Reactive.Interfaces" Version="3.1.1"/>
<PackageReference Include="xunit" Version="2.3.1"/>
<PackageReference Include="xunit.abstractions" Version="2.0.1"/>
<PackageReference Include="xunit.analyzers" Version="0.7.0"/>
<PackageReference Include="xunit.assert" Version="2.3.1"/>
<PackageReference Include="xunit.core" Version="2.3.1"/>
<PackageReference Include="xunit.extensibility.core" Version="2.3.1"/>
<PackageReference Include="xunit.extensibility.execution" Version="2.3.1"/>
<PackageReference Include="xunit.runner.msbuild" Version="2.2.0"/>
<PackageReference Include="xunit.runner.visualstudio" Version="2.3.1"/>
<PackageReference Include="MicroBuild.Core" Version="0.3.0">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<PackageReference Include="StyleCop.Analyzers" Version="1.0.2">
<PrivateAssets>All</PrivateAssets>
</PackageReference>
<ProjectReference Include="..\..\src\Microsoft.AspNet.TelemetryCorrelation\Microsoft.AspNet.TelemetryCorrelation.csproj">
<Project>{4c8e592c-c532-4cf2-80ef-3bdd0d788d12}</Project>
<Name>Microsoft.AspNet.TelemetryCorrelation</Name>
@ -96,10 +74,10 @@
<ItemGroup>
<None Include="35MSSharedLib1024.snk" />
<None Include="packages.config" />
<EmbeddedResource Include="..\..\src\Packages\Microsoft.AspNet.TelemetryCorrelation\content\net45\web.config.install.xdt">
<EmbeddedResource Include="..\..\src\Microsoft.AspNet.TelemetryCorrelation\web.config.install.xdt">
<Link>Resources\web.config.install.xdt</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\..\src\Packages\Microsoft.AspNet.TelemetryCorrelation\content\net45\web.config.uninstall.xdt">
<EmbeddedResource Include="..\..\src\Microsoft.AspNet.TelemetryCorrelation\web.config.uninstall.xdt">
<Link>Resources\web.config.uninstall.xdt</Link>
</EmbeddedResource>
</ItemGroup>
@ -109,22 +87,4 @@
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
<ItemGroup>
<Analyzer Include="..\..\packages\xunit.analyzers.0.7.0\analyzers\dotnet\cs\xunit.analyzers.dll" />
</ItemGroup>
<Import Project="$(MSBuildToolsPath)\Microsoft.CSharp.targets" />
<UsingTask AssemblyFile="$(OutputPath)xunit.runner.msbuild.dll" TaskName="Xunit.Runner.MSBuild.xunit" />
<Target Name="AfterBuild">
<xunit Assemblies="$(OutputPath)Microsoft.AspNet.TelemetryCorrelation.Tests.dll" />
</Target>
<Target Name="EnsureNuGetPackageBuildImports" BeforeTargets="PrepareForBuild">
<PropertyGroup>
<ErrorText>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}.</ErrorText>
</PropertyGroup>
<Error Condition="!Exists('..\..\packages\xunit.runner.msbuild.2.2.0\build\net452\xunit.runner.msbuild.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.runner.msbuild.2.2.0\build\net452\xunit.runner.msbuild.props'))" />
<Error Condition="!Exists('..\..\packages\xunit.core.2.3.1\build\xunit.core.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.3.1\build\xunit.core.props'))" />
<Error Condition="!Exists('..\..\packages\xunit.core.2.3.1\build\xunit.core.targets')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.core.2.3.1\build\xunit.core.targets'))" />
<Error Condition="!Exists('..\..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props')" Text="$([System.String]::Format('$(ErrorText)', '..\..\packages\xunit.runner.visualstudio.2.3.1\build\net20\xunit.runner.visualstudio.props'))" />
</Target>
<Import Project="..\..\packages\xunit.core.2.3.1\build\xunit.core.targets" Condition="Exists('..\..\packages\xunit.core.2.3.1\build\xunit.core.targets')" />
</Project>

Просмотреть файл

@ -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)]

Просмотреть файл

@ -1,16 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<packages>
<package id="Microsoft.Web.Xdt" version="2.1.1" targetFramework="net452" />
<package id="System.Diagnostics.DiagnosticSource" version="4.5.0" targetFramework="net452" />
<package id="System.Reactive.Core" version="3.1.1" targetFramework="net452" />
<package id="System.Reactive.Interfaces" version="3.1.1" targetFramework="net452" />
<package id="xunit" version="2.3.1" targetFramework="net452" />
<package id="xunit.abstractions" version="2.0.1" targetFramework="net452" />
<package id="xunit.analyzers" version="0.7.0" targetFramework="net452" />
<package id="xunit.assert" version="2.3.1" targetFramework="net452" />
<package id="xunit.core" version="2.3.1" targetFramework="net452" />
<package id="xunit.extensibility.core" version="2.3.1" targetFramework="net452" />
<package id="xunit.extensibility.execution" version="2.3.1" targetFramework="net452" />
<package id="xunit.runner.msbuild" version="2.2.0" targetFramework="net452" developmentDependency="true" />
<package id="xunit.runner.visualstudio" version="2.3.1" targetFramework="net452" developmentDependency="true" />
</packages>

Двоичные данные
tools/Debug.snk Normal file

Двоичный файл не отображается.

Просмотреть файл

@ -1,23 +0,0 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RepositoryRootEx Condition="'$(RepositoryRootEx)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.AspNet.TelemetryCorrelation.sln))\</RepositoryRootEx>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<BinPath>$(RepositoryRootEx)bin\</BinPath>
<ObjPath>$(RepositoryRootEx)obj\</ObjPath>
<OutputPath>$(BinPath)$(Configuration)\</OutputPath>
<IntermediateOutputPath>$(ObjPath)$(Configuration)\$(MSBuildProjectName)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup>
<AssemblyPath Condition="'$(CodeSignEnabled)' == 'true'">$(CodeSignOutputPath)</AssemblyPath>
<AssemblyPath Condition="'$(AssemblyPath)' == ''">$(OutputPath)</AssemblyPath>
</PropertyGroup>
<PropertyGroup>
<CustomAfterProjectTargets>$(MSBuildThisFileDirectory)Microsoft.AspNet.TelemetryCorrelation.Extensions.targets</CustomAfterProjectTargets>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1,9 +0,0 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Update NuGet Package version for nightly build-->
<PropertyGroup Condition="'$(MSBuildProjectExtension)' == '.nuproj'">
<NuGetPackageVersion Condition="'$(UpdateNightlyPackages)' == 'true'">$(NuGetPackageVersion)-b$(VersionBuild)</NuGetPackageVersion>
</PropertyGroup>
</Project>

Просмотреть файл

@ -0,0 +1,65 @@
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<RepositoryRoot Condition="'$(RepositoryRoot)' == ''">$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.AspNet.TelemetryCorrelation.sln))\</RepositoryRoot>
</PropertyGroup>
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<BinPath>$(RepositoryRoot)bin\</BinPath>
<ObjPath>$(RepositoryRoot)obj\</ObjPath>
<OutputPath>$(BinPath)$(Configuration)\</OutputPath>
<IntermediateOutputPath>$(ObjPath)$(Configuration)\$(MSBuildProjectName)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup>
<AssemblyPath Condition="'$(CodeSignEnabled)' == 'true'">$(CodeSignOutputPath)</AssemblyPath>
<AssemblyPath Condition="'$(AssemblyPath)' == ''">$(OutputPath)</AssemblyPath>
</PropertyGroup>
<PropertyGroup>
<BuildQuality Condition="'$(BuildQuality)' == ''">rtm</BuildQuality>
<VersionStartYear>2018</VersionStartYear>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<VersionRelease>4</VersionRelease>
<VersionBuild Condition="'$(VersionBuild)' == '' OR '$(VersionBuild)' == '0'">$([MSBuild]::Add(1, $([MSBuild]::Subtract($([System.DateTime]::Now.Year), $(VersionStartYear)))))$([System.DateTime]::Now.ToString("MMdd"))</VersionBuild>
<VersionRevision Condition="'$(VersionRevision)' == ''">0</VersionRevision>
<VersionRelease Condition="'$(VersionRelease)' == ''">0</VersionRelease>
<CustomBeforeProjectTargets>$(MSBuildThisFileDirectory)Microsoft.AspNet.TelemetryCorrelation.Extensions.settings.targets</CustomBeforeProjectTargets>
<VersionRelease Condition="'$(BuildQuality)' != 'rtm'">$(VersionRelease)-$(BuildQuality)</VersionRelease>
</PropertyGroup>
<PropertyGroup>
<VersionPrefix>$(VersionMajor).$(VersionMinor).$(VersionRelease)</VersionPrefix>
<VersionSuffix Condition="'$(BuildQuality)' != 'rtm'">-$(BuildQuality)</VersionSuffix>
<FileVersion>$(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision)</FileVersion>
<InformationalVersion>$(VersionMajor).$(VersionMinor).$(VersionRelease)-$(VersionBuild)</InformationalVersion>
<AssemblyVersion>$(VersionMajor).$(VersionMinor).$(VersionRelease).0</AssemblyVersion>
</PropertyGroup>
<Import Project="$(CustomBeforeProjectTargets)" Condition="Exists('$(CustomBeforeProjectTargets)')" Label="Pre-targets Build Extensibility Point"/>
<PropertyGroup Label="Common Configuration">
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<OutputPath>$(RepositoryRoot)bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>$(RepositoryRoot)obj\$(Configuration)\$(MSBuildProjectName)\</IntermediateOutputPath>
</PropertyGroup>
<ItemDefinitionGroup>
<FilesToSign>
<!-- Microsoft authenticode certificate for all file types -->
<Authenticode Condition="'%(FilesToSign.Authenticode)' == ''">Microsoft</Authenticode>
<!-- Microsoft strong-name key for managed assemblies -->
<StrongName Condition="'$(TargetExt)' == '.winmdobj' OR '$(TargetExt)' == '.dll' OR '$(TargetExt)' == '.exe'">MsSharedLib72</StrongName>
</FilesToSign>
</ItemDefinitionGroup>
<ItemGroup>
<!-- Automatically sign binary generated by the project that imports Signing.props -->
<FilesToSign Include="$(TargetPath)" />
</ItemGroup>
</Project>

Просмотреть файл

@ -1,47 +0,0 @@
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<PropertyGroup>
<CustomBeforeProjectTargets>$(MSBuildThisFileDirectory)Microsoft.AspNet.TelemetryCorrelation.Extensions.settings.targets</CustomBeforeProjectTargets>
<BuildQuality Condition="'$(BuildQuality)' == ''">rtm</BuildQuality>
<VersionStartYear>2018</VersionStartYear>
<VersionMajor>1</VersionMajor>
<VersionMinor>0</VersionMinor>
<VersionRelease>4</VersionRelease>
<VersionRelease Condition="'$(BuildQuality)' != 'rtm'">$(VersionRelease)-$(BuildQuality)</VersionRelease>
</PropertyGroup>
<PropertyGroup Label="NuGet package dependencies">
<DiagnosticSourceNuGetPackageVersion>4.5.0</DiagnosticSourceNuGetPackageVersion>
</PropertyGroup>
<PropertyGroup>
<RepositoryRoot>$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory), 'Microsoft.AspNet.TelemetryCorrelation.sln'))\</RepositoryRoot>
</PropertyGroup>
<Import Project="$(CustomBeforeProjectTargets)" Condition="Exists('$(CustomBeforeProjectTargets)')" Label="Pre-targets Build Extensibility Point"/>
<PropertyGroup Label="Common Configuration">
<Configuration Condition="'$(Configuration)' == ''">Release</Configuration>
<OutputPath>$(RepositoryRoot)bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath>$(RepositoryRoot)obj\$(Configuration)\$(MSBuildProjectName)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup>
<AssemblyPath Condition="'$(AssemblyPath)' == ''">$(OutputPath)</AssemblyPath>
<NuGetOutputPath>$(AssemblyPath)Packages</NuGetOutputPath>
<NuGetSymbolsOutputPath>$(AssemblyPath)\SymbolPackages</NuGetSymbolsOutputPath>
<TestOutputPath>$(OutputPath)test\</TestOutputPath>
</PropertyGroup>
<PropertyGroup>
<ReferencePackagesPath>$(RepositoryRoot)packages\</ReferencePackagesPath>
<NuGetPackSymbols Condition="'$(NuGetPackSymbols)' == ''">true</NuGetPackSymbols>
<SourceRootFullPath>$(RepositoryRoot)\src\$(MSBuildProjectName)\</SourceRootFullPath>
</PropertyGroup>
<PropertyGroup>
<CustomAfterMicrosoftCommonTargets>$(RepositoryRoot)tools\Microsoft.AspNet.TelemetryCorrelation.targets</CustomAfterMicrosoftCommonTargets>
<CustomAfterNuGetProjTargets>$(CustomAfterMicrosoftCommonTargets)</CustomAfterNuGetProjTargets>
</PropertyGroup>
</Project>

Просмотреть файл

@ -1,29 +0,0 @@
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Build order -->
<PropertyGroup>
<BuildDependsOn>SetNuSpecProperties;$(BuildDependsOn)</BuildDependsOn>
</PropertyGroup>
<Import Project="$(MSBuildThisFileDirectory)version.targets"/>
<!-- Post-targets computed properties. -->
<PropertyGroup>
<SatelliteContractVersion Condition="'$(SatelliteContractVersion)' == ''">$(AssemblyVersion)</SatelliteContractVersion>
</PropertyGroup>
<Import Project="$(CustomAfterProjectTargets)" Condition="Exists('$(CustomAfterProjectTargets)')" Label="Post-targets Build Extensibility Point" />
<!-- Target definitions -->
<Target Name="SetNuSpecProperties">
<PropertyGroup>
<NuSpecProperties>
NuGetPackageVersion=$(NuGetPackageVersion);
NuGetPackageId=$(NuGetPackageId);
DiagnosticSourceNuGetPackageVersion=$(DiagnosticSourceNuGetPackageVersion)
</NuSpecProperties>
</PropertyGroup>
</Target>
</Project>

Просмотреть файл

@ -1,144 +0,0 @@
<?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>$([System.IO.Path]::Combine($(SolutionDir), ".nuget"))</NuGetToolsPath>
</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>
</PropertyGroup>
<PropertyGroup>
<PackagesProjectConfig Condition=" '$(OS)' == 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName.Replace(' ', '_')).config</PackagesProjectConfig>
<PackagesProjectConfig Condition=" '$(OS)' != 'Windows_NT'">$(MSBuildProjectDirectory)\packages.$(MSBuildProjectName).config</PackagesProjectConfig>
</PropertyGroup>
<PropertyGroup>
<PackagesConfig Condition="Exists('$(MSBuildProjectDirectory)\packages.config')">$(MSBuildProjectDirectory)\packages.config</PackagesConfig>
<PackagesConfig Condition="Exists('$(PackagesProjectConfig)')">$(PackagesProjectConfig)</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>

Просмотреть файл

@ -1,501 +0,0 @@
<!--
****************************************************************************************************
Project global nuget targets.
Relevant parameters:
* NuSpecFile property:
The name of the project's nuspec file, relative to the project or with full path.
* NuSpecCreateOnMissing property:
When true and the NuSpecFile does not exists, one can be created from params defined by the project.
* NuGetContent, NuSpecMetadata, NuSpecDependency and NuSpecFrameworkAssembly item groups:
Represent the nuspec schema. See item definitions.
* NuGetContentProject: Item containing the project path and used to add Compile (source) items into
the NuGetContent collection for symbol packages.
* SourceRootFullPath: Default value for the NuGetFromProject corresponding item metadata.
* NuSpec[metadataName] property: Following this property name pattern NuSpec metadata items can be
defined in the project, a nuspec file could be fully generated this way.
* NuSpecProperties property:
NuGet supports property replacement in the nuspec file using the '$value$' token notation.
* Note: If NuSpecFile is provided and the project defines some nuspec parameters, values from both are
merged, with precedense taken by the provided parameters. This allows for parameterization of the file.
* NuGetPackOptions property:
Represents the options passed to the NuGet.exe tool in the command line.
* NuGetPackSymbols property:
Determines whether symbols package is built. Ignored if NuGetPackOptions is defined.
* NuGetOutputPath property:
Represents the directory where the package is to be created.
* NuSpecSchemaVersion: represents the nuspec file xml schema version.
****************************************************************************************************-->
<Project DefaultTargets="Build" ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<Import Project="$(CustomBeforeNuGetProjTargets)" Condition="Exists('$(CustomBeforeNuGetProjTargets)')"/>
<PropertyGroup>
<Configuration Condition="'$(Configuration)' == ''">Debug</Configuration>
<OutputPath Condition="'$(OutputPath)' == ''">bin\$(Configuration)\</OutputPath>
<IntermediateOutputPath Condition="'$(IntermediateOutputPath)' == ''">obj\$(Configuration)\</IntermediateOutputPath>
<IntermediateOutputPath Condition="'$(NuGetPackageLanguage)' != ''">$(IntermediateOutputPath)$(NuGetPackageLanguage)\</IntermediateOutputPath>
</PropertyGroup>
<PropertyGroup>
<!-- The NuGet package name inlcudes the nusepc id and version which are ultimately taken from the NuSpec file. -->
<!-- The nuspec metadata is usually specified in the nuspec file (if provided). When NuSpec<metaName> props are specified they overwrite the nuspec items. -->
<!-- NuGetPackageID and NuSpecID should have the same value, the former is kept for legacy reasons (same for version properties). -->
<NuSpecId Condition="'$(NuSpecId)' == ''">$(MSBuildProjectName)</NuSpecId>
<NuGetPackageId Condition="'$(NuGetPackageId)' == ''">$(NuSpecId)</NuGetPackageId>
<NuGetPackageVersion Condition="'$(NuGetPackageVersion)' == ''">$(NuSpecVersion)</NuGetPackageVersion>
<NuSpecVersion Condition="'$(NuSpecVersion)' == ''">$(NuGetPackageVersion)</NuSpecVersion>
</PropertyGroup>
<PropertyGroup>
<NuSpecSchemaVersion Condition="'$(NuSpecSchemaVersion)' == ''">2</NuSpecSchemaVersion>
<NuGetPackSymbols Condition="'$(NuGetPackOptions.ToLower().Contains(symbols))'">true</NuGetPackSymbols>
<NuGetPackSymbols Condition="'$(NuGetPackSymbols)' == ''">false</NuGetPackSymbols>
<NuSpecFile Condition="'$(NuSpecFile)' == ''">$(MSBuildProjectDirectory)\$(NuGetPackageId).nuspec</NuSpecFile>
<NuSpecFileName>$([System.IO.Path]::GetFileName('$(NuSpecFile)'))</NuSpecFileName>
<NuSpecCreateOnMissing Condition="'$(NuSpecCreateOnMissing)' == ''">true</NuSpecCreateOnMissing>
<NuGetProjectOutputsFile>$(IntermediateOutputPath)$(NuGetPackageId).outputs</NuGetProjectOutputsFile>
</PropertyGroup>
<PropertyGroup Label="NuGet.targets inputs">
<NuGetExePath Condition="!Exists('$(NuGetExePath)')">$([MSBuild]::GetDirectoryNameOfFileAbove('$(MSBuildThisFileFullPath)', '.nuget\nuget.targets'))\.nuget\NuGet.exe</NuGetExePath>
<NuGetInstallPath>$([System.IO.Path]::GetDirectoryName('$(NuGetExePath)'))</NuGetInstallPath>
<PackageOutputDir Condition="'$(NuGetOutputPath)' != ''">$(NuGetOutputPath)</PackageOutputDir>
<PackageOutputDir Condition="'$(PackageOutputDir)' == ''">$(OutputPath)NuGet</PackageOutputDir>
<PackageOutputDir>$(PackageOutputDir.TrimEnd('\'))</PackageOutputDir>
<NuGetOutputPath Condition="'$(NuGetOutputPath)' == ''">$(PackageOutputDir)</NuGetOutputPath>
<ProjectPath>$(IntermediateOutputPath)$(NuSpecFileName)</ProjectPath>
</PropertyGroup>
<PropertyGroup>
<CodeTaskFactoryAssemblyFile Condition=" '$(CodeTaskFactoryAssemblyFile)' == '' And '$(MSBuildToolsVersion)' == '12.0' ">$(MSBuildToolsPath)\Microsoft.Build.Tasks.v12.0.dll</CodeTaskFactoryAssemblyFile>
<CodeTaskFactoryAssemblyFile Condition=" '$(CodeTaskFactoryAssemblyFile)' == '' ">$(MSBuildToolsPath)\Microsoft.Build.Tasks.v4.0.dll</CodeTaskFactoryAssemblyFile>
</PropertyGroup>
<PropertyGroup>
<!--Force a rebuild if this file is changed -->
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath);$(MSBuildProjectFullPath)</MSBuildAllProjects>
</PropertyGroup>
<!--
NuGet package layout conventions http://docs.nuget.org/docs/creating-packages/creating-and-publishing-a-package#Package_Conventions
NuSpec metadata schema https://nuget.codeplex.com/wikipage?title=.nuspec%20v1.2%20Format
-->
<ItemDefinitionGroup>
<!-- NuGetContent represents the files to be packed (dll, exe, pdb, .cs, content, etc). -->
<NuGetContent>
<Source>$(NuGetContentSource)</Source>
<Destination>$(NuGetContentDestination)</Destination>
</NuGetContent>
<!-- NuSpecMetadata represents the simple items under the 'metadata' schema element (title, version, etc.) -->
<NuSpecMetadata>
<Value/>
</NuSpecMetadata>
<!-- NuSpecDependency represents the child element of the complex 'metadata/dependencies' schema element. -->
<NuSpecDependency>
<Version/>
<TargetFramework/>
</NuSpecDependency>
<!-- NuSpecFrameworkAssembly represents the child element of the complex 'metadata/frameworkAssemblies' schema element. -->
<NuSpecFrameworkAssembly>
<TargetFramework/>
</NuSpecFrameworkAssembly>
</ItemDefinitionGroup>
<!--
NuGetContentFromProject: Defines content from the Compile item collection (source files) from projects into the NuGetContent item.
-->
<ItemDefinitionGroup>
<NuGetContentProject>
<SourceRootFullPath>$(SourceRootFullPath)</SourceRootFullPath>
<Destination>src</Destination>
</NuGetContentProject>
</ItemDefinitionGroup>
<ItemGroup>
<!-- NuSpec file added by default. -->
<NuGetContent Include="$(ProjectPath)" />
</ItemGroup>
<!-- Optional NuSpec file metadata items. When provided, items are used for generating the final nuspec file. -->
<!-- http://docs.nuget.org/docs/reference/nuspec-reference -->
<ItemGroup>
<NuSpecMetadata Include="id" Condition="'$(NuSpecId)' != ''">
<Value>$(NuSpecId)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="version" Condition="'$(NuSpecVersion)' != ''">
<Value>$(NuSpecVersion)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="title" Condition="'$(NuSpecTitle)' != ''">
<Value>$(NuSpecTitle)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="authors" Condition="'$(NuSpecAuthors)' != ''">
<Value>$(NuSpecAuthors)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="owners" Condition="'$(NuSpecOwners)' != ''">
<Value>$(NuSpecOwners)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="description" Condition="'$(NuSpecDescription)' != ''">
<Value>$(NuSpecDescription)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="tags" Condition="'$(NuSpecTags)' != ''">
<Value>$(NuSpecTags)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="iconUrl" Condition="'$(NuSpecIconUrl)' != ''">
<Value>$(NuSpecIconUrl)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="projectUrl" Condition="'$(NuSpecProjectUrl)' != ''">
<Value>$(NuSpecProjectUrl)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="licenseUrl" Condition="'$(NuSpecLicenseUrl)' != ''">
<Value>$(NuSpecLicenseUrl)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="copyright" Condition="'$(NuSpecCopyright)' != ''">
<Value>$(NuSpecCopyright)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="requireLicenseAcceptance" Condition="'$(NuSpecRequireLicenseAcceptance)' != ''">
<Value>$(NuSpecRequireLicenseAcceptance)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="releaseNotes" Condition="'$(NuSpecReleaseNotes)' != ''">
<Value>$(NuSpecReleaseNotes)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="summary" Condition="'$(NuSpecSummary)' != ''">
<Value>$(NuSpecSummary)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="developmentDependency" Condition="'$(NuSpecDevelopmentDependency)' != ''">
<Value>$(NuSpecDevelopmentDependency)</Value>
</NuSpecMetadata>
<NuSpecMetadata Include="language" Condition="'$(NuSpecLanguage)' != ''">
<Value>$(NuSpecLanguage)</Value>
</NuSpecMetadata>
</ItemGroup>
<ItemGroup>
<Clean Include="$(NuGetProjectOutputsFile)" />
</ItemGroup>
<!--
****************************************************************************************************
Common build targets overwrites.
**************************************************************************************************** -->
<PropertyGroup>
<BuildDependsOn>BeforeBuild;GetNuGetContentFromProject;ValidateNuGetParams;ReadNuGetCleanOutputs;GetNuGetProjectInputs;GetNuGetProjectOutputs;ValidateOutputs;NuGetPack;WriteNuGetProjectOutputs;AfterBuild</BuildDependsOn>
<CleanDependsOn>BeforeClean;ReadNuGetCleanOutputs;CoreClean;AfterClean</CleanDependsOn>
<RebuildDependsOn>Clean;Build</RebuildDependsOn>
</PropertyGroup>
<Target Name="BeforeBuild" />
<Target Name="Build" DependsOnTargets="$(BuildDependsOn)" />
<Target Name="AfterBuild" />
<Target Name="BeforeClean" />
<Target Name="Clean" DependsOnTargets="$(CleanDependsOn)"/>
<Target Name="AfterClean" />
<Target Name="CoreClean">
<Delete Files="@(Clean)" />
<ItemGroup>
<Clean Remove="@(Clean)" />
</ItemGroup>
</Target>
<Target Name="Rebuild" DependsOnTargets="$(RebuildDependsOn)" />
<!--
****************************************************************************************************
GetNuGetContentFromProject: Gets Compile item collection (source files) from projects into the NuGetContent item.
Input: NuGetContentProject and SourceRootFullPath
**************************************************************************************************** -->
<Target Name="GetNuGetContentFromProject" Condition="'@(NuGetContentProject)' != ''">
<MSBuild Projects="$(MSBuildProjectFullPath)" Targets="GetNuGetContentFromProjectCore"
Properties="NuGetContentProject=%(NuGetContentProject.FullPath);SourceRootFullPath=%(SourceRootFullPath);Destination=%(Destination)" >
<Output TaskParameter="TargetOutputs" ItemName="NuGetContent" />
</MSBuild>
</Target>
<Target Name="GetNuGetContentFromProjectCore" Outputs="@(NuGetContent)">
<Error Condition="'$(SourceRootFullPath)' == ''" Text="NuGetContentProject item does not define 'SourceRootFullPath' metadata: $(NuGetContentProject)" />
<PropertyGroup>
<!-- Normalize path (remove extra back-slashes and trim) -->
<SourceRootFullPath>$([System.IO.Path]::GetFullPath($(SourceRootFullPath)))</SourceRootFullPath>
</PropertyGroup>
<MSBuild Projects="$(NuGetContentProject)" Targets="GetCompile" RebaseOutputs="true">
<Output TaskParameter="TargetOutputs" ItemName="Compile" />
</MSBuild>
<ItemGroup>
<NugetContent Include="%(Compile.FullPath)" Condition="$([System.String]::Concat(%(FullPath)).ToLower().Contains($(SourceRootFullPath.ToLower())))">
<Destination>$([System.IO.Path]::Combine($(Destination), $([MSBuild]::MakeRelative($([System.IO.Path]::GetFullPath($(SourceRootFullPath))), %(Compile.RootDir)%(Directory)))))</Destination>
</NugetContent>
</ItemGroup>
</Target>
<!--
****************************************************************************************************
ValidateNuGetParams: validate input params.
****************************************************************************************************-->
<Target Name="ValidateNuGetParams">
<ItemGroup>
<PropMismatch Include="NuSpecID=$(NuSpecID) and NuGetPackageID=$(NuGetPackageID)"
Condition="'$(NuSpecId)' != '' AND '$(NuGetPackageID)' != '' AND '$(NuSpecId)' != '$(NuGetPackageID)'" />
<PropMismatch Include="NuSpecVersion=$(NuSpecVersion) and NuGetPackageVersion=$(NuGetPackageVersion)"
Condition="'$(NuSpecVersion)' != '' AND '$(NuGetPackageVersion)' != '' AND '$(NuSpecVersion)' != '$(NuGetPackageVersion)'" />
</ItemGroup>
<Warning Text="No content was specified " Condition="'@(NuGetContent)' == '' AND '$(DisableNoNuGetContentWarning)' != 'true'" />
<Error Text="@(PropMismatch -> '%(Identity) are different, this is an indication of an authoring error!', '%0A')" Condition="'@(PropMismatch)' != ''" />
<Error Text="Could not find nuspec file: $(NuSpecFile)" Condition="!Exists('$(NuSpecFile)') AND '$(NuSpecCreateOnMissing)' == 'false'" />
</Target>
<!--
****************************************************************************************************
ValidateOutputs: checks whether outputs are up-to-date with respect to the inputs to avoid rebuilding
if not needed and play nicely when building incrementally.
**************************************************************************************************** -->
<Target Name="ValidateOutputs" Inputs="@(NuGetProjectInput);$(MSBuildAllProjects)" Outputs="@(NuGetProjectOutput)">
<CreateProperty Value="true">
<Output TaskParameter="ValueSetByTask" PropertyName="OutputsOutdated"/>
</CreateProperty>
</Target>
<!--
****************************************************************************************************
NuGetPack: Creates a nuget package.
**************************************************************************************************** -->
<Target Name="NuGetPack" DependsOnTargets="GenerateNuSpecFile" Condition="'$(OutputsOutdated)' == 'true'">
<ItemGroup>
<!-- Normalize comman-separated property string (removes new lines and trims string)-->
<NuSpecProperties Include="$(NuSpecProperties)" />
</ItemGroup>
<PropertyGroup>
<NuSpecProperties>@(NuSpecProperties)</NuSpecProperties>
<NuGetPackOptions Condition="'$(NuGetPackOptions)' == '' AND '$(NuGetPackSymbols)' != 'true'">-NoPackageAnalysis</NuGetPackOptions>
<NuGetPackOptions Condition="'$(NuGetPackOptions)' == '' AND '$(NuGetPackSymbols)' == 'true'">-NoPackageAnalysis -symbols</NuGetPackOptions>
<!-- BuildCommand is defined in nuget.targets file -->
<BuildCommand>$(BuildCommand.Replace('-symbols', ''))</BuildCommand>
<BuildCommand>$(BuildCommand.Replace('/symbols', ''))</BuildCommand>
<BuildCommand Condition="'$(NuSpecProperties)' != ''">$(BuildCommand) -Properties "$(NuSpecProperties)"</BuildCommand>
<BuildCommand Condition="'$(NuGetPackOptions)' != ''">$(BuildCommand) $(NuGetPackOptions)</BuildCommand>
</PropertyGroup>
<!-- Invalidate outputs to force a full build in case of failure -->
<Delete Files="$(NuGetPackTargetFile)" />
<MakeDir Directories="$(PackageOutputDir)" />
<Exec Command="$(BuildCommand)" StandardOutputImportance="high" StandardErrorImportance="high" WorkingDirectory="$(MSBuildProjectDirectory)" CustomErrorRegularExpression="invalid"/>
<ItemGroup>
<Clean Include="$(PackageOutputDir)\$(NuGetPackageId).$(NuGetPackageVersion)*.nupkg" />
</ItemGroup>
<!-- This target can fail preventing outputs file from being updated, neet to account for that. -->
<OnError ExecuteTargets="WriteNuGetProjectOutputs" />
</Target>
<!--
****************************************************************************************************
GetNuGetProjectInputs: get the project inputs.
**************************************************************************************************** -->
<Target Name="GetNuGetProjectInputs">
<NormalizeNuGetContent NuGetContent="@(NuGetContent)">
<Output TaskParameter="NuGetContentNormalized" ItemName="NuGetProjectInput" />
</NormalizeNuGetContent>
</Target>
<!--
****************************************************************************************************
GetNuGetProjectOutputs: Reads build-generated files from outputs file.
**************************************************************************************************** -->
<Target Name="GetNuGetProjectOutputs">
<PropertyGroup>
<NuGetPackTargetFile>$(PackageOutputDir)\$(NuGetPackageId).$(NuGetPackageVersion).nupkg</NuGetPackTargetFile>
<NuGetSymbolPackTargetFile Condition="'$(NuGetPackSymbols)' == 'true'">$(PackageOutputDir)\$(NuGetPackageId).$(NuGetPackageVersion).symbols.nupkg</NuGetSymbolPackTargetFile>
</PropertyGroup>
<ItemGroup>
<NuGetProjectOutput Include="$(NuGetPackTargetFile)" />
<NuGetProjectOutput Include="$(NuGetSymbolPackTargetFile)" Condition="'$(NuGetSymbolPackTargetFile)' != ''" />
<NuGetProjectOutput Include="$(NuGetProjectOutputsFile)" />
</ItemGroup>
</Target>
<!--
****************************************************************************************************
ReadNuGetCleanOutputs: Reads build-generated files from outputs file into Clean item collection to
get them re-written into outputs file so they can be cleaned up later.
**************************************************************************************************** -->
<Target Name="ReadNuGetCleanOutputs">
<ReadLinesFromFile File="$(NuGetProjectOutputsFile)">
<Output TaskParameter="Lines" ItemName="Clean" />
</ReadLinesFromFile>
</Target>
<!--
****************************************************************************************************
WriteNuGetProjectOutputs: write the list of build-generated files into outputs file which is used for
cleaning and incremental build.
**************************************************************************************************** -->
<Target Name="WriteNuGetProjectOutputs" Condition="'$(OutputsOutdated)' == 'true'">
<ItemGroup>
<NuGetProjectOutput Include="@(Clean->Distinct())" />
</ItemGroup>
<WriteLinesToFile File="$(NuGetProjectOutputsFile)" Lines="@(NuGetProjectOutput->Distinct())" Overwrite="true" Condition="'@(NuGetProjectOutput)' != ''" />
</Target>
<!--
****************************************************************************************************
GenerateNuSpecFile: generates the final nuspec file for the package.
**************************************************************************************************** -->
<Target Name="GenerateNuSpecFile" DependsOnTargets="GetNuGetProjectInputs" Condition="'$(OutputsOutdated)' == 'true'">
<GenerateNuSpecFile NuSpecFile="$(NuSpecFile)" OutputDir="$(IntermediateOutputPath)" CreateNuSpec="$(NuSpecCreateOnMissing)" MetadataItems="@(NuSpecMetadata)"
Files="@(NuGetProjectInput);@(NuGetContentFromPdb)" FrameworkAssemblies="@(NuSpecFrameworkAssembly)" Dependencies="@(NuSpecDependency)" SchemaVersion="$(NuSpecSchemaVersion)">
<Output TaskParameter="GeneratedNuSpec" PropertyName="GeneratedNuSpec" />
</GenerateNuSpecFile>
<ItemGroup>
<Clean Include="$(GeneratedNuSpec)" />
</ItemGroup>
<Message Text="Generated NuSpec file: $(GeneratedNuSpec)" />
</Target>
<!--
==================================================================================================
Generates final nuspec file combining/replacing values from project nuspec file if provided.
==================================================================================================-->
<UsingTask TaskName="GenerateNuSpecFile" TaskFactory="CodeTaskFactory" AssemblyFile="$(CodeTaskFactoryAssemblyFile)">
<ParameterGroup>
<NuSpecFile Required="true" ParameterType="System.String" />
<MetadataItems Required="false" ParameterType="Microsoft.Build.Framework.ITaskItem[]" />
<Files Required="true" ParameterType="Microsoft.Build.Framework.ITaskItem[]" />
<FrameworkAssemblies Required="false" ParameterType="Microsoft.Build.Framework.ITaskItem[]" />
<Dependencies Required="false" ParameterType="Microsoft.Build.Framework.ITaskItem[]" />
<OutputDir Required="true" ParameterType="System.String" />
<CreateNuSpec Required="false" ParameterType="System.Boolean" />
<SchemaVersion Required="true" ParameterType="System.Int32" />
<GeneratedNuSpec Output="true" ParameterType="System.String" />
</ParameterGroup>
<Task>
<Reference Include="System.Xml" />
<Reference Include="System.Xml.Linq" />
<Using Namespace="System.Linq" />
<Using Namespace="System.IO" />
<Using Namespace="System.Xml.Linq" />
<Code Type="Fragment" Language="cs">
<![CDATA[
XElement packageNode = null;
if (File.Exists(NuSpecFile)) {
packageNode = XElement.Load(NuSpecFile);
} else {
if (!CreateNuSpec) { Log.LogError("NuSpec file does not exist: {0}", NuSpecFile); return false; }
if(SchemaVersion > 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<XElement>();
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<XElement>()) node.Remove();
foreach (var node in removeQ2.ToArray<XElement>()) node.Remove();
XElement filesNode = packageNode.Descendants(ns + "files").FirstOrDefault<XElement>();
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<XElement>();
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<XElement>();
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);
]]>
</Code>
</Task>
</UsingTask>
<!--
****************************************************************************************************
NormalizeNuGetContent: Normalize NuGetContent items full path and destination for packing.
****************************************************************************************************-->
<UsingTask TaskName="NormalizeNuGetContent" TaskFactory="CodeTaskFactory" AssemblyFile="$(CodeTaskFactoryAssemblyFile)">
<ParameterGroup>
<NuGetContent Required="true" ParameterType="Microsoft.Build.Framework.ITaskItem[]" />
<NuGetContentNormalized Output="true" ParameterType="Microsoft.Build.Framework.ITaskItem[]" />
</ParameterGroup>
<Task>
<Using Namespace="System.IO" />
<Code Type="Fragment" Language="cs">
<![CDATA[
NuGetContentNormalized = new TaskItem[NuGetContent.Length];
for (int idx = 0; idx < NuGetContent.Length; idx++) {
string src = NuGetContent[idx].GetMetadata("Source");
string id = NuGetContent[idx].GetMetadata("Identity");
if (!string.IsNullOrEmpty(src) && !Path.IsPathRooted(id)) {
NuGetContentNormalized[idx] = new TaskItem(Path.Combine(src, id));
}
else {
NuGetContentNormalized[idx] = new TaskItem(NuGetContent[idx].GetMetadata("FullPath"));
}
NuGetContentNormalized[idx].SetMetadata("Destination", NuGetContent[idx].GetMetadata("Destination"));
}
]]>
</Code>
</Task>
</UsingTask>
<Import Project="$(NuGetInstallPath)\nuget.targets" />
<Import Project="$(CustomAfterNuGetProjTargets)" Condition="Exists('$(CustomAfterNuGetProjTargets)')"/>
</Project>

Двоичные данные
tools/NuProj.Tasks.dll

Двоичный файл не отображается.

Просмотреть файл

@ -1,129 +0,0 @@
<?xml version="1.0" encoding="utf-8"?>
<Project ToolsVersion="4.0" DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!--
DEFAULTS
Those can be overriden.
-->
<PropertyGroup>
<OutDir Condition=" '$(OutDir)' == ''" >$(MSBuildProjectDirectory)\bin\</OutDir>
<IntermediateOutputPath Condition=" '$(IntermediateOutputPath)' == '' ">$(MSBuildProjectDirectory)\obj\</IntermediateOutputPath>
<NuSpecPath Condition=" '$(NuSpecPath)' == '' ">$(IntermediateOutputPath)$(Id).nuspec</NuSpecPath>
<NuProjTasksPath Condition=" '$(NuProjTasksPath)' == '' ">$(MSBuildThisFileDirectory)NuProj.Tasks.dll</NuProjTasksPath>
<NuGetToolPath Condition=" '$(NuGetToolPath)' == '' ">$(MSBuildThisFileDirectory)</NuGetToolPath>
<NuGetToolExe Condition=" '$(NuGetToolExe)' == '' ">NuGet.exe</NuGetToolExe>
</PropertyGroup>
<!--
OUPUT PATH
This property isn't passed to NuGet.exe - it's implicit. However, we need to know the ouput path
at several occasions (e.g. incremental build or clean up) so we want a central spot to capture it.
-->
<PropertyGroup>
<NuGetOuputPath>$(OutDir)$(Id).$(Version).nupkg</NuGetOuputPath>
</PropertyGroup>
<!--
MSBuildAllProjects is used to keep track of all projects the build depends on.
We make all targets depending on it to make sure everything rebuilds.
-->
<PropertyGroup>
<MSBuildAllProjects Condition="Exists('$(MSBuildProjectFullPath)')">$(MSBuildAllProjects);$(MSBuildProjectFullPath)</MSBuildAllProjects>
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<!--
CUSTOM TASKS
-->
<UsingTask TaskName="GenerateNuSpec" AssemblyFile="$(NuProjTasksPath)" />
<UsingTask TaskName="NuGetPack" AssemblyFile="$(NuProjTasksPath)" />
<!--
CONVERT ITEMS
-->
<Target Name="ConvertItems">
<CreateItem Include="@(Library)"
AdditionalMetadata="TargetPath=lib\%(Library.TargetFramework)">
<Output TaskParameter="Include"
ItemName="File"/>
</CreateItem>
<CreateItem Include="@(Content)"
AdditionalMetadata="TargetPath=content\%(Content.TargetPath)">
<Output TaskParameter="Include"
ItemName="File"/>
</CreateItem>
</Target>
<!--
GENERATE NU SPEC
-->
<Target Name="GenerateNuSpec"
Inputs="$(MSBuildAllProjects)"
Outputs="$(NuSpecPath)"
DependsOnTargets="ConvertItems">
<GenerateNuSpec OutputFileName="$(NuSpecPath)"
Id="$(Id)"
Version="$(Version)"
Title="$(Title)"
Authors="$(Authors)"
Owners="$(Owners)"
Description="$(Description)"
ReleaseNotes="$(ReleaseNotes)"
Summary="$(Summary)"
Language="$(Language)"
ProjectUrl="$(ProjectUrl)"
IconUrl="$(IconUrl)"
LicenseUrl="$(LicenseUrl)"
Copyright="$(Copyright)"
RequireLicenseAcceptance="$(RequireLicenseAcceptance)"
Tags="$(Tags)"
Dependencies="@(Dependency)"
References="@(Reference)"
FrameworkReferences="@(FrameworkReference)"
Files="@(File)"/>
</Target>
<!--
CREATE PACKAGE
-->
<Target Name="CreatePackage"
Inputs="$(MSBuildAllProjects);
$(NuSpecPath);
@(File)"
Outputs="$(NuGetOuputPath)"
DependsOnTargets="GenerateNuSpec">
<MakeDir Directories="$(OutDir)"
Condition="!Exists('$(OutDir)')" />
<NuGetPack OutputDirectory="$(OutDir)"
ToolPath="$(NuGetToolPath)"
ToolExe="$(NuGetToolExe)"
NuSpecPath="$(NuSpecPath)"/>
</Target>
<!--
STANDARD BUILD TARGETS
-->
<Target Name="Clean">
<ItemGroup>
<_ToBeDeleted Include="$(NuSpecPath)" />
<_ToBeDeleted Include="$(NuGetOuputPath)" />
</ItemGroup>
<Delete Files="@(_ToBeDeleted)" />
</Target>
<Target Name="Build" DependsOnTargets="CreatePackage" />
<Target Name="Rebuild" DependsOnTargets="Clean;Build" />
</Project>

Просмотреть файл

@ -1,113 +0,0 @@
<!--
****************************************************************************************************
Project global versioning targets.
****************************************************************************************************-->
<Project ToolsVersion="4.0" xmlns="http://schemas.microsoft.com/developer/msbuild/2003">
<!-- Input parameters -->
<!-- NOTE: The VersionFileAttribute ItemGroup can be used to add assembly-level attributes to the generated version file, ex:
<VersionFileAttribute Include="[assembly: System.Diagnostics.CodeAnalysis.SuppressMessage(&quot;Microsoft.Usage&quot;, &quot;CA2243:AttributeStringLiteralsShouldParseCorrectly&quot;, Justification = &quot;Justification here&quot;)]" />
-->
<PropertyGroup>
<VersionFileGenerationEnabled Condition="'$(VersionFileGenerationEnabled)' == '' AND '$(MSBuildProjectExtension)' == '.csproj'">true</VersionFileGenerationEnabled>
<VersionFileGenerationEnabled Condition="'$(VersionFileGenerationEnabled)' == ''">false</VersionFileGenerationEnabled>
</PropertyGroup>
<PropertyGroup>
<VersionStartYear Condition="'$(VersionStartYear)' == ''">2016</VersionStartYear>
<VersionMajor Condition="'$(VersionMajor)' == ''">INVALID_VersionMajor</VersionMajor>
<VersionMinor Condition="'$(VersionMinor)' == ''">INVALID_VersionMinor</VersionMinor>
<VersionBuild Condition="'$(VersionBuild)' == '' OR '$(VersionBuild)' == '0'">$([MSBuild]::Add(1, $([MSBuild]::Subtract($([System.DateTime]::Now.Year), $(VersionStartYear)))))$([System.DateTime]::Now.ToString("MMdd"))</VersionBuild>
<VersionRevision Condition="'$(VersionRevision)' == ''">0</VersionRevision>
<VersionRelease Condition="'$(VersionRelease)' == ''">0</VersionRelease>
</PropertyGroup>
<!-- Comptued parameters -->
<PropertyGroup>
<AssemblyVersion>$(VersionMajor).$(VersionMinor).0.$(VersionRevision)</AssemblyVersion>
<AssemblyFileVersion>$(VersionMajor).$(VersionMinor).$(VersionBuild).$(VersionRevision)</AssemblyFileVersion>
<AssemblyInfoVersion Condition="'$(VersionRelease)' != ''">$(VersionMajor).$(VersionMinor).$(VersionRelease)-$(VersionBuild)</AssemblyInfoVersion>
<AssemblyInfoVersion Condition="'$(AssemblyInfoVersion)' == ''">$(AssemblyFileVersion)</AssemblyInfoVersion>
<AssemblyVersionFile>$(IntermediateOutputPath)$(MSBuildProjectName).version.cs</AssemblyVersionFile>
</PropertyGroup>
<PropertyGroup>
<NuGetPackageVersion Condition="'$(NuGetPackageVersion)' == ''">$(VersionMajor).$(VersionMinor).$(VersionRelease)</NuGetPackageVersion>
<NuGetPackageVersion Condition="'$(BuildQuality)' != 'rtm'">$(NuGetPackageVersion)-$(BuildQuality)</NuGetPackageVersion>
</PropertyGroup>
<ItemGroup Condition="'$(VersionFileGenerationEnabled)' == 'true'">
<Compile Include="$(AssemblyVersionFile)" />
</ItemGroup>
<ItemGroup>
<Clean Include="$(AssemblyVersionFile)" Condition="'$(MSBuildProjectExtension)' == '.csproj'"/>
</ItemGroup>
<PropertyGroup Condition="'$(VersionFileGenerationEnabled)' == 'true'">
<!-- Disable assembly version defined in CommonAssemblyInfo.cs file -->
<DefineConstants>$(DefineConstants);BUILD_GENERATED_VERSION</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<!--Force a rebuild if this file is changed -->
<MSBuildAllProjects>$(MSBuildAllProjects);$(MSBuildThisFileFullPath)</MSBuildAllProjects>
</PropertyGroup>
<!--
==================================================================================================
GenerateVersionFile target: generates assembly attributes into a source file that is included
in the items to compile.
================================================================================================== -->
<PropertyGroup Condition="'$(VersionFileGenerationEnabled)' == 'true'">
<CompileDependsOn>GenerateVersionFile;$(CompileDependsOn)</CompileDependsOn>
<GenerateVersionFileDependsOn>ValidateVersionValues;ShouldGenerateVersionFile;GenerateVersionFileCore</GenerateVersionFileDependsOn>
</PropertyGroup>
<Target Name="GenerateVersionFile" DependsOnTargets="$(GenerateVersionFileDependsOn)" />
<Target Name="GenerateVersionFileCore" Condition="'$(ShouldGenerateVersionFile)' == 'true'">
<ItemGroup>
<LinesToWrite Include="// $(SourceFileCopyright)" Condition="'$(SourceFileCopyright)' != ''"/>
<LinesToWrite Include="// &lt;auto-generated&gt;" />
<LinesToWrite Include="// This code was generated by a tool." />
<LinesToWrite Include="// &lt;/auto-generated&gt;" />
<LinesToWrite Include="[assembly: System.Reflection.AssemblyCompany(&quot;$(AssemblyCompany)&quot;)]" Condition="'$(AssemblyCompany)' != ''"/>
<LinesToWrite Include="[assembly: System.Reflection.AssemblyCopyright(&quot;$(AssemblyCopyright)&quot;)]" Condition="'$(AssemblyCopyright)' != ''"/>
<LinesToWrite Include="[assembly: System.Reflection.AssemblyVersion(&quot;$(AssemblyVersion)&quot;)]" Condition="'$(AssemblyVersion)' != ''"/>
<LinesToWrite Include="[assembly: System.Reflection.AssemblyFileVersion(&quot;$(AssemblyFileVersion)&quot;)]" Condition="'$(AssemblyFileVersion)' != ''"/>
<LinesToWrite Include="[assembly: System.Reflection.AssemblyInformationalVersion(&quot;$(AssemblyInfoVersion)&quot;)]" Condition="'$(AssemblyInfoVersion)' != ''" />
<LinesToWrite Include="[assembly: System.Resources.SatelliteContractVersionAttribute(&quot;$(SatelliteContractVersion)&quot;)]" Condition="'$(SatelliteContractVersion)' != ''"/>
<LinesToWrite Include="@(VersionFileAttribute)" Condition="'@(VersionFileAttribute)' != ''" />
</ItemGroup>
<WriteLinesToFile File="$(AssemblyVersionFile)" Lines="@(LinesToWrite)" Overwrite="true" Encoding="Unicode"/>
<Message Text="Assembly Version File: $(AssemblyVersionFile)" />
</Target>
<!--
==================================================================================================
ShouldGenerateVersionFile target: determines whether a version needs to be generated.
================================================================================================== -->
<Target Name="ShouldGenerateVersionFile">
<ReadLinesFromFile File="$(AssemblyVersionFile)" Condition="Exists('$(AssemblyVersionFile)')">
<Output ItemName="VersionText" TaskParameter="Lines"/>
</ReadLinesFromFile>
<PropertyGroup>
<VersionText>@(VersionText)</VersionText>
<ShouldGenerateVersionFile>!$(VersionText.Contains('$(AssemblyFileVersion)'))</ShouldGenerateVersionFile>
</PropertyGroup>
</Target>
<Target Name="ValidateVersionValues">
<!-- Throw if any of the version values is not int16 -->
<PropertyGroup>
<VersionMajor>$([System.Convert]::ToInt16('$(VersionMajor)'))</VersionMajor>
<VersionMinor>$([System.Convert]::ToInt16('$(VersionMinor)'))</VersionMinor>
<VersionBuild>$([System.Convert]::ToInt16('$(VersionBuild)'))</VersionBuild>
<VersionRevision>$([System.Convert]::ToInt16('$(VersionRevision)'))</VersionRevision>
</PropertyGroup>
</Target>
</Project>