Skip to content

Commit

Permalink
fix build (#2229)
Browse files Browse the repository at this point in the history
  • Loading branch information
reyang authored Aug 4, 2021
1 parent 4b90945 commit dcd901e
Show file tree
Hide file tree
Showing 4 changed files with 46 additions and 88 deletions.
17 changes: 12 additions & 5 deletions src/Microsoft.AspNet.TelemetryCorrelation/AssemblyInfo.cs
Original file line number Diff line number Diff line change
Expand Up @@ -14,14 +14,21 @@
// limitations under the License.
// </copyright>

using System;
using System.Runtime.CompilerServices;
using System.Runtime.InteropServices;

[assembly: ComVisible(false)]

#if PUBLIC_RELEASE
[assembly: InternalsVisibleTo("Microsoft.AspNet.TelemetryCorrelation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100b5fc90e7027f67871e773a8fde8938c81dd402ba65b9201d60593e96c492651e889cc13f1415ebb53fac1131ae0bd333c5ee6021672d9718ea31a8aebd0da0072f25d87dba6fc90ffd598ed4da35e44c398c454307e8e33b8426143daec9f596836f97c8f74750e5975c64e2189f45def46b2a2b1247adc3652bf5c308055da9")]
[assembly: InternalsVisibleTo("Microsoft.AspNet.TelemetryCorrelation.Tests" + AssemblyInfo.PublicKey)]

#if SIGNED
internal static class AssemblyInfo
{
public const string PublicKey = ", PublicKey=002400000480000094000000060200000024000052534131000400000100010051C1562A090FB0C9F391012A32198B5E5D9A60E9B80FA2D7B434C9E5CCB7259BD606E66F9660676AFC6692B8CDC6793D190904551D2103B7B22FA636DCBB8208839785BA402EA08FC00C8F1500CCEF28BBF599AA64FFB1E1D5DC1BF3420A3777BADFE697856E9D52070A50C3EA5821C80BEF17CA3ACFFA28F89DD413F096F898";
}
#else
[assembly: InternalsVisibleTo("Microsoft.AspNet.TelemetryCorrelation.Tests, PublicKey=0024000004800000940000000602000000240000525341310004000001000100319b35b21a993df850846602dae9e86d8fbb0528a0ad488ecd6414db798996534381825f94f90d8b16b72a51c4e7e07cf66ff3293c1046c045fafc354cfcc15fc177c748111e4a8c5a34d3940e7f3789dd58a928add6160d6f9cc219680253dcea88a034e7d472de51d4989c7783e19343839273e0e63a43b99ab338149dd59f")]
#endif
internal static class AssemblyInfo
{
public const string PublicKey = "";
}
#endif
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ public void Can_Restore_First_RequestId_When_Multiple_RequestId_In_Headers()
var requestHeaders = new NameValueCollection
{
{ ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b11111.1" },
{ ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b22222.1" }
{ ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b22222.1" },
};
Assert.True(activity.Extract(requestHeaders));

Expand All @@ -61,7 +61,7 @@ public void Extract_RequestId_Is_Ignored_When_Traceparent_Is_Present()
var requestHeaders = new NameValueCollection
{
{ ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b11111.1" },
{ ActivityExtensions.TraceparentHeaderName, "00-0123456789abcdef0123456789abcdef-0123456789abcdef-00" }
{ ActivityExtensions.TraceparentHeaderName, "00-0123456789abcdef0123456789abcdef-0123456789abcdef-00" },
};
Assert.True(activity.Extract(requestHeaders));

Expand All @@ -83,7 +83,7 @@ public void Can_Extract_First_Traceparent_When_Multiple_Traceparents_In_Headers(
var requestHeaders = new NameValueCollection
{
{ ActivityExtensions.TraceparentHeaderName, "00-0123456789abcdef0123456789abcdef-0123456789abcdef-00" },
{ ActivityExtensions.TraceparentHeaderName, "00-fedcba09876543210fedcba09876543210-fedcba09876543210-01" }
{ ActivityExtensions.TraceparentHeaderName, "00-fedcba09876543210fedcba09876543210-fedcba09876543210-01" },
};
Assert.True(activity.Extract(requestHeaders));

Expand Down Expand Up @@ -121,7 +121,7 @@ public void Can_Extract_RootActivity_From_W3C_Headers_And_CC()
{
new KeyValuePair<string, string>("key1", "123"),
new KeyValuePair<string, string>("key2", "456"),
new KeyValuePair<string, string>("key3", "789")
new KeyValuePair<string, string>("key3", "789"),
};
var expectedBaggage = baggageItems.OrderBy(kvp => kvp.Key);
var actualBaggage = activity.Baggage.OrderBy(kvp => kvp.Key);
Expand Down Expand Up @@ -170,7 +170,7 @@ public void Restore_Empty_RequestId_Should_Not_Throw_Exception()
var activity = new Activity(TestActivityName);
var requestHeaders = new NameValueCollection
{
{ ActivityExtensions.RequestIdHeaderName, string.Empty }
{ ActivityExtensions.RequestIdHeaderName, string.Empty },
};
Assert.False(activity.Extract(requestHeaders));

Expand All @@ -184,7 +184,7 @@ public void Restore_Empty_Traceparent_Should_Not_Throw_Exception()
var activity = new Activity(TestActivityName);
var requestHeaders = new NameValueCollection
{
{ ActivityExtensions.TraceparentHeaderName, string.Empty }
{ ActivityExtensions.TraceparentHeaderName, string.Empty },
};
Assert.False(activity.Extract(requestHeaders));

Expand All @@ -200,7 +200,7 @@ public void Can_Restore_Baggages_When_CorrelationContext_In_Headers()
var requestHeaders = new NameValueCollection
{
{ ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b11111.1" },
{ ActivityExtensions.CorrelationContextHeaderName, "key1=123,key2=456,key3=789" }
{ ActivityExtensions.CorrelationContextHeaderName, "key1=123,key2=456,key3=789" },
};
Assert.True(activity.Extract(requestHeaders));

Expand All @@ -209,7 +209,7 @@ public void Can_Restore_Baggages_When_CorrelationContext_In_Headers()
{
new KeyValuePair<string, string>("key1", "123"),
new KeyValuePair<string, string>("key2", "456"),
new KeyValuePair<string, string>("key3", "789")
new KeyValuePair<string, string>("key3", "789"),
};
var expectedBaggage = baggageItems.OrderBy(kvp => kvp.Key);
var actualBaggage = activity.Baggage.OrderBy(kvp => kvp.Key);
Expand All @@ -225,7 +225,7 @@ public void Can_Restore_Baggages_When_Multiple_CorrelationContext_In_Headers()
{ ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b11111.1" },
{ ActivityExtensions.CorrelationContextHeaderName, "key1=123,key2=456,key3=789" },
{ ActivityExtensions.CorrelationContextHeaderName, "key4=abc,key5=def" },
{ ActivityExtensions.CorrelationContextHeaderName, "key6=xyz" }
{ ActivityExtensions.CorrelationContextHeaderName, "key6=xyz" },
};
Assert.True(activity.Extract(requestHeaders));

Expand All @@ -237,7 +237,7 @@ public void Can_Restore_Baggages_When_Multiple_CorrelationContext_In_Headers()
new KeyValuePair<string, string>("key3", "789"),
new KeyValuePair<string, string>("key4", "abc"),
new KeyValuePair<string, string>("key5", "def"),
new KeyValuePair<string, string>("key6", "xyz")
new KeyValuePair<string, string>("key6", "xyz"),
};
var expectedBaggage = baggageItems.OrderBy(kvp => kvp.Key);
var actualBaggage = activity.Baggage.OrderBy(kvp => kvp.Key);
Expand All @@ -254,7 +254,7 @@ public void Can_Restore_Baggages_When_Some_MalFormat_CorrelationContext_In_Heade
{ ActivityExtensions.CorrelationContextHeaderName, "key1=123,key2=456,key3=789" },
{ ActivityExtensions.CorrelationContextHeaderName, "key4=abc;key5=def" },
{ ActivityExtensions.CorrelationContextHeaderName, "key6????xyz" },
{ ActivityExtensions.CorrelationContextHeaderName, "key7=123=456" }
{ ActivityExtensions.CorrelationContextHeaderName, "key7=123=456" },
};
Assert.True(activity.Extract(requestHeaders));

Expand All @@ -263,7 +263,7 @@ public void Can_Restore_Baggages_When_Some_MalFormat_CorrelationContext_In_Heade
{
new KeyValuePair<string, string>("key1", "123"),
new KeyValuePair<string, string>("key2", "456"),
new KeyValuePair<string, string>("key3", "789")
new KeyValuePair<string, string>("key3", "789"),
};
var expectedBaggage = baggageItems.OrderBy(kvp => kvp.Key);
var actualBaggage = activity.Baggage.OrderBy(kvp => kvp.Key);
Expand Down Expand Up @@ -304,7 +304,7 @@ public void Validates_Correlation_Context_Length(string correlationContext, int
var requestHeaders = new NameValueCollection
{
{ ActivityExtensions.RequestIdHeaderName, "|abc.1" },
{ ActivityExtensions.CorrelationContextHeaderName, correlationContext }
{ ActivityExtensions.CorrelationContextHeaderName, correlationContext },
};
Assert.True(activity.Extract(requestHeaders));

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ public ActivityHelperTest()
{
new KeyValuePair<string, string>("TestKey1", "123"),
new KeyValuePair<string, string>("TestKey2", "456"),
new KeyValuePair<string, string>("TestKey1", "789")
new KeyValuePair<string, string>("TestKey1", "789"),
};

this.baggageInHeader = "TestKey1=123,TestKey2=456,TestKey1=789";
Expand Down Expand Up @@ -331,7 +331,7 @@ public void Can_Create_RootActivity_And_Restore_Info_From_Request_Header()
var requestHeaders = new Dictionary<string, string>
{
{ ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b2cab6.1." },
{ ActivityExtensions.CorrelationContextHeaderName, this.baggageInHeader }
{ ActivityExtensions.CorrelationContextHeaderName, this.baggageInHeader },
};

var context = HttpContextHelper.GetFakeHttpContext(headers: requestHeaders);
Expand Down Expand Up @@ -401,7 +401,7 @@ public void Can_Create_RootActivity_And_Ignore_Info_From_Request_Header_If_Parse
var requestHeaders = new Dictionary<string, string>
{
{ ActivityExtensions.RequestIdHeaderName, "|aba2f1e978b2cab6.1." },
{ ActivityExtensions.CorrelationContextHeaderName, this.baggageInHeader }
{ ActivityExtensions.CorrelationContextHeaderName, this.baggageInHeader },
};

var context = HttpContextHelper.GetFakeHttpContext(headers: requestHeaders);
Expand Down
Original file line number Diff line number Diff line change
@@ -1,82 +1,33 @@
<Project ToolsVersion="15.0" Sdk="Microsoft.NET.Sdk">
<Import Project="$([MSBuild]::GetDirectoryNameOfFileAbove($(MSBuildThisFileDirectory),Microsoft.AspNet.TelemetryCorrelation.sln))\tools\Common.props" />
<Project Sdk="Microsoft.NET.Sdk">
<PropertyGroup>
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration>
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform>
<ProjectGuid>{9FAE5C43-F56C-4D87-A23C-6D2D57B4ABED}</ProjectGuid>
<OutputType>Library</OutputType>
<TargetFrameworks>net452</TargetFrameworks>
<FileAlignment>512</FileAlignment>
<ErrorReport>prompt</ErrorReport>
<WarningLevel>4</WarningLevel>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Debug' ">
<DebugSymbols>true</DebugSymbols>
<DebugType>full</DebugType>
<Optimize>false</Optimize>
<DefineConstants>$(DefineConstants);DEBUG;TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup Condition=" '$(Configuration)' == 'Release' ">
<DebugType>pdbonly</DebugType>
<Optimize>true</Optimize>
<DefineConstants>$(DefineConstants);TRACE</DefineConstants>
</PropertyGroup>
<PropertyGroup>
<SignAssembly>true</SignAssembly>
</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>
<Description>Unit test project for ASP.NET HttpModule</Description>
<TargetFrameworks>net461</TargetFrameworks>
<IsPackable>false</IsPackable>
</PropertyGroup>

<ItemGroup>
<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>
<PackageReference Include="Microsoft.NET.Test.Sdk" Version="$(MicrosoftNETTestSdkPkgVer)" />
<PackageReference Include="Microsoft.Web.Xdt" Version="3.1.0" />
<PackageReference Include="System.Diagnostics.DiagnosticSource" Version="5.0.1" />
<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 Include="xunit" Version="$(XUnitPkgVer)" />
<PackageReference Include="xunit.runner.visualstudio" Version="$(XUnitRunnerVisualStudioPkgVer)">
<PrivateAssets>all</PrivateAssets>
<IncludeAssets>runtime; build; native; contentfiles; analyzers</IncludeAssets>
</PackageReference>
<ProjectReference Include="..\..\src\Microsoft.AspNet.TelemetryCorrelation\Microsoft.AspNet.TelemetryCorrelation.csproj">
<Project>{4c8e592c-c532-4cf2-80ef-3bdd0d788d12}</Project>
<Name>Microsoft.AspNet.TelemetryCorrelation</Name>
</ProjectReference>
<DotNetCliToolReference Include="dotnet-xunit" Version="$(DotNetXUnitCliVer)" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="..\..\src\Microsoft.AspNet.TelemetryCorrelation\web.config.install.xdt">
<ProjectReference Include="$(RepoRoot)\src\Microsoft.AspNet.TelemetryCorrelation\Microsoft.AspNet.TelemetryCorrelation.csproj" />
</ItemGroup>

<ItemGroup>
<EmbeddedResource Include="$(RepoRoot)\src\Microsoft.AspNet.TelemetryCorrelation\web.config.install.xdt">
<Link>Resources\web.config.install.xdt</Link>
</EmbeddedResource>
<EmbeddedResource Include="..\..\src\Microsoft.AspNet.TelemetryCorrelation\web.config.uninstall.xdt">
<EmbeddedResource Include="$(RepoRoot)\src\Microsoft.AspNet.TelemetryCorrelation\web.config.uninstall.xdt">
<Link>Resources\web.config.uninstall.xdt</Link>
</EmbeddedResource>
</ItemGroup>
<ItemGroup>
<Service Include="{82A7F48D-3B50-4B1E-B82E-3ADA8210C358}" />
</ItemGroup>
</Project>

0 comments on commit dcd901e

Please sign in to comment.