Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add CoreWCF Services Support #5473

Open
wants to merge 11 commits into
base: main
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from 8 commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 3 additions & 1 deletion NuGet.config
Original file line number Diff line number Diff line change
@@ -1,10 +1,12 @@
<?xml version="1.0" encoding="utf-8"?>
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<packageSources>
<clear />
<add key="dotnet-eng" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-eng/nuget/v3/index.json" />
<add key="dotnet-tools" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-tools/nuget/v3/index.json" />
<add key="dotnet-public" value="https://pkgs.dev.azure.com/dnceng/public/_packaging/dotnet-public/nuget/v3/index.json" />
<add key="nuget" value="https://api.nuget.org/v3/index.json" />
<add key="CoreWCF_Dev" value="https://pkgs.dev.azure.com/dotnet/CoreWCF/_packaging/CoreWCF/nuget/v3/index.json" />
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

If I remember this correctly, this is not allowed, We should achieve this through dotnet-public.

</packageSources>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Couldn't we just use the latest CoreWCF package for this? Or perhaps this should be added to the dotnet-public?

<disabledPackageSources />
</configuration>
7 changes: 0 additions & 7 deletions System.ServiceModel.sln
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,6 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Encoding.MessageVersion.Int
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Extensibility.MessageEncoder.IntegrationTests", "src\System.Private.ServiceModel\tests\Scenarios\Extensibility\MessageEncoder\Extensibility.MessageEncoder.IntegrationTests.csproj", "{76361777-321D-4588-87F9-38992A758350}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Extensibility.MessageInterceptor.IntegrationTests", "src\System.Private.ServiceModel\tests\Scenarios\Extensibility\MessageInterceptor\Extensibility.MessageInterceptor.IntegrationTests.csproj", "{ACCCB1B8-5ABE-4F3B-BFEF-9A9C15AA1267}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Extensibility.WebSockets.IntegrationTests", "src\System.Private.ServiceModel\tests\Scenarios\Extensibility\WebSockets\Extensibility.WebSockets.IntegrationTests.csproj", "{C8CA16D3-5B1E-4EC0-A817-205A798DC272}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Infrastructure.IntegrationTests", "src\System.Private.ServiceModel\tests\Scenarios\Infrastructure\Infrastructure.IntegrationTests.csproj", "{719E874A-AEFA-44D5-9530-9C41BD0FA4E8}"
Expand Down Expand Up @@ -189,10 +187,6 @@ Global
{76361777-321D-4588-87F9-38992A758350}.Debug|Any CPU.Build.0 = Debug|Any CPU
{76361777-321D-4588-87F9-38992A758350}.Release|Any CPU.ActiveCfg = Release|Any CPU
{76361777-321D-4588-87F9-38992A758350}.Release|Any CPU.Build.0 = Release|Any CPU
{ACCCB1B8-5ABE-4F3B-BFEF-9A9C15AA1267}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{ACCCB1B8-5ABE-4F3B-BFEF-9A9C15AA1267}.Debug|Any CPU.Build.0 = Debug|Any CPU
{ACCCB1B8-5ABE-4F3B-BFEF-9A9C15AA1267}.Release|Any CPU.ActiveCfg = Release|Any CPU
{ACCCB1B8-5ABE-4F3B-BFEF-9A9C15AA1267}.Release|Any CPU.Build.0 = Release|Any CPU
{C8CA16D3-5B1E-4EC0-A817-205A798DC272}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{C8CA16D3-5B1E-4EC0-A817-205A798DC272}.Debug|Any CPU.Build.0 = Debug|Any CPU
{C8CA16D3-5B1E-4EC0-A817-205A798DC272}.Release|Any CPU.ActiveCfg = Release|Any CPU
Expand Down Expand Up @@ -289,7 +283,6 @@ Global
{48C41A27-631F-45FA-ACD5-7D7EDD4A4931} = {D6302510-AB10-4775-BCE9-98FA96FDEB76}
{36DD97F6-1F78-4843-A9C0-58C59D367603} = {D6302510-AB10-4775-BCE9-98FA96FDEB76}
{76361777-321D-4588-87F9-38992A758350} = {D6302510-AB10-4775-BCE9-98FA96FDEB76}
{ACCCB1B8-5ABE-4F3B-BFEF-9A9C15AA1267} = {D6302510-AB10-4775-BCE9-98FA96FDEB76}
{C8CA16D3-5B1E-4EC0-A817-205A798DC272} = {D6302510-AB10-4775-BCE9-98FA96FDEB76}
{719E874A-AEFA-44D5-9530-9C41BD0FA4E8} = {D6302510-AB10-4775-BCE9-98FA96FDEB76}
{E878E412-F0AB-4D87-8A7A-3114AAC48CD5} = {D6302510-AB10-4775-BCE9-98FA96FDEB76}
Expand Down
2 changes: 1 addition & 1 deletion azure-pipelines-arcade.yml
Original file line number Diff line number Diff line change
Expand Up @@ -114,4 +114,4 @@ extends:
enableSourceLinkValidation: false
SDLValidationParameters:
enable: true
params: ' -SourceToolsList @("policheck","credscan") -TsaInstanceURL $(_TsaInstanceURL) -TsaProjectName $(_TsaProjectName) -TsaNotificationEmail $(_TsaNotificationEmail) -TsaCodebaseAdmin $(_TsaCodebaseAdmin) -TsaBugAreaPath $(_TsaBugAreaPath) -TsaIterationPath $(_TsaIterationPath) -TsaRepositoryName "WCF" -TsaCodebaseName "WCF" -TsaPublish $True'
params: ' -SourceToolsList @("policheck","credscan") -TsaInstanceURL $(_TsaInstanceURL) -TsaProjectName $(_TsaProjectName) -TsaNotificationEmail $(_TsaNotificationEmail) -TsaCodebaseAdmin $(_TsaCodebaseAdmin) -TsaBugAreaPath $(_TsaBugAreaPath) -TsaIterationPath $(_TsaIterationPath) -TsaRepositoryName "WCF" -TsaCodebaseName "WCF" -TsaPublish $True'
58 changes: 51 additions & 7 deletions eng/SendToHelix.proj
Original file line number Diff line number Diff line change
@@ -1,19 +1,34 @@
<Project Sdk="Microsoft.DotNet.Helix.Sdk" DefaultTargets="Test">
<Project Sdk="Microsoft.DotNet.Helix.Sdk" InitialTargets="InstallDotNet;Test">
<PropertyGroup>
<HelixSource Condition=" '$(RunAsPublic)' == 'true' ">pr/dotnet/wcf/$(BUILD_SOURCEBRANCH)/</HelixSource>
<HelixSource Condition=" '$(RunAsInternal)' == 'true' ">official/dotnet/wcf/$(BUILD_SOURCEBRANCH)/</HelixSource>
<HelixType>test/product/</HelixType>
<HelixBuild>$(BUILD_BUILDNUMBER)</HelixBuild>
<HelixBuild Condition="'$(HelixBuild)' == ''">123460.01</HelixBuild>
<DotNetCliPackageType>sdk</DotNetCliPackageType>
<DotNetCliVersion>8.0.100</DotNetCliVersion>
<IncludeDotNetCli>true</IncludeDotNetCli>

<!-- Read global.json so we know the version of the dotnet cli we need -->
<GlobalJsonContent>$([System.IO.File]::ReadAllText('$(RepoRoot)global.json'))</GlobalJsonContent>
<DotNetCliPackageType>sdk</DotNetCliPackageType>
<DotNetCliVersion>$([System.Text.RegularExpressions.Regex]::Match($(GlobalJsonContent), '(%3F&lt;="dotnet": ").*(%3F=")'))</DotNetCliVersion>

<IncludeDotNetCli>true</IncludeDotNetCli>
<EnableAzurePipelinesReporter>true</EnableAzurePipelinesReporter>
<TestRunNamePrefix>$(AGENT_JOBNAME)</TestRunNamePrefix>

<EnableXUnitReporter>true</EnableXUnitReporter>
</PropertyGroup>

<Target Name="InstallDotNet">
<ItemGroup>
<AdditionalDotNetPackage Include="8.0.5">
<PackageType>aspnetcore-runtime</PackageType>
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This seems to be downgrade; can we use what is available provided by arcade?

<Channel>Current</Channel>
</AdditionalDotNetPackage>
</ItemGroup>
</Target>

<ItemGroup>
<ProjectsToBuild Include="..\src\System.Private.ServiceModel\tools\SelfHostedCoreWcfService\SelfHostedCoreWCFService.csproj"/>
</ItemGroup>

<ItemGroup>
<XUnitProject Include="..\src\System.Private.ServiceModel\tests\Scenarios\**\*.IntegrationTests.csproj">
Expand Down Expand Up @@ -54,19 +69,48 @@
<Creator>$(BUILD_SOURCEVERSIONAUTHOR)</Creator>
<Creator Condition=" '$(Creator)' == ''">anon</Creator>
</PropertyGroup>

<PropertyGroup>
<RunWithCoreWCFService Condition="'$(RunWithCoreWCFService)' == ''">false</RunWithCoreWCFService>
</PropertyGroup>

<PropertyGroup Condition="!$(HelixTargetQueue.StartsWith('Windows'))">
<PropertyGroup Condition="'$(TestJob)' != 'Windows'" >
<HelixPreCommands>$(HelixPreCommands);chmod a+x $HELIX_CORRELATION_PAYLOAD/InstallRootCertificate.sh</HelixPreCommands>
<HelixPreCommands>$(HelixPreCommands);sudo -E -n $HELIX_CORRELATION_PAYLOAD/InstallRootCertificate.sh --service-host $(ServiceHost) --cert-file /tmp/wcfrootca.crt</HelixPreCommands>
</PropertyGroup>

<Target Name="Pack"/>
<PropertyGroup Condition="'$(TestJob)' == 'Windows'">
<HelixPreCommands>$(HelixPreCommands);set PATH=%HELIX_CORRELATION_PAYLOAD%\dotnet-cli%3B%PATH%</HelixPreCommands>
<!-- %3B is an escaped ; -->
<HelixPreCommands>$(HelixPreCommands);set DOTNET_ROOT=%HELIX_CORRELATION_PAYLOAD%\dotnet-cli;set DOTNET_CLI_TELEMETRY_OPTOUT=1</HelixPreCommands>
<HelixPreCommands>$(HelixPreCommands);set DOTNET_CLI_HOME=%HELIX_WORKITEM_ROOT%\.dotnet</HelixPreCommands>
<HelixPreCommands>$(HelixPreCommands);set NUGET_PACKAGES=%HELIX_WORKITEM_ROOT%\.nuget</HelixPreCommands>
<HelixPreCommands>$(HelixPreCommands);set ServiceUri=localhost</HelixPreCommands>
<HelixPreCommands>$(HelixPreCommands);%HELIX_CORRELATION_PAYLOAD%\SelfHostedCoreWCFService\$(Configuration)\net8.0\SelfHostedCoreWCFService bootstrap:true</HelixPreCommands>
</PropertyGroup>

<PropertyGroup Condition="'$(TestJob)' != 'Windows'">
<HelixPreCommands>$(HelixPreCommands);export PATH=$HELIX_CORRELATION_PAYLOAD/dotnet-cli:$PATH</HelixPreCommands>
<HelixPreCommands>$(HelixPreCommands);export DOTNET_ROOT=$HELIX_CORRELATION_PAYLOAD/dotnet-cli;export DOTNET_CLI_TELEMETRY_OPTOUT=1</HelixPreCommands>
<HelixPreCommands>$(HelixPreCommands);export DOTNET_CLI_HOME=$HELIX_WORKITEM_ROOT/.dotnet</HelixPreCommands>
<HelixPreCommands>$(HelixPreCommands);export NUGET_PACKAGES=$HELIX_WORKITEM_ROOT/.nuget</HelixPreCommands>
<HelixPreCommands>$(HelixPreCommands);export ServiceUri=localhost</HelixPreCommands>
<HelixPreCommands>$(HelixPreCommands);dotnet exec --roll-forward Major $HELIX_CORRELATION_PAYLOAD/SelfHostedCoreWCFService/$(Configuration)/net8.0/SelfHostedCoreWCFService.dll bootstrap:true</HelixPreCommands>
</PropertyGroup>

<Target Name="BuildProjects">
<MSBuild Targets="Publish" Projects="@(ProjectsToBuild)" Properties="PublishDir='$(MSBuildThisFileDirectory)\..\artifacts\bin\SelfHostedCoreWCFService'" />
</Target>

<ItemGroup>
<!-- Directory that is zipped up and sent as a correlation payload to Helix -->
<HelixCorrelationPayload Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\src\System.Private.ServiceModel\tools\scripts'))" >
<PayloadDirectory>%(Identity)</PayloadDirectory>
</HelixCorrelationPayload>

<HelixCorrelationPayload Include="$([System.IO.Path]::GetFullPath('$(MSBuildThisFileDirectory)\..\artifacts\bin\SelfHostedCoreWCFService'))" >
<Destination>SelfHostedCoreWCFService</Destination>
</HelixCorrelationPayload>
</ItemGroup>

<PropertyGroup>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -535,7 +535,14 @@ public static string GetResourceFromServiceAsString(string resource)
using (HttpClient httpClient = new HttpClient())
{
HttpResponseMessage response = httpClient.GetAsync(requestUri).GetAwaiter().GetResult();
return response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
if (response.IsSuccessStatusCode)
{
return response.Content.ReadAsStringAsync().GetAwaiter().GetResult();
}
else
{
throw new Exception($"Got Status code {response.StatusCode} from {requestUri}.");
}
}
}

Expand All @@ -547,7 +554,14 @@ public static byte[] GetResourceFromServiceAsByteArray(string resource)
using (HttpClient httpClient = new HttpClient())
{
HttpResponseMessage response = httpClient.GetAsync(requestUri).GetAwaiter().GetResult();
return response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult();
if (response.IsSuccessStatusCode)
{
return response.Content.ReadAsByteArrayAsync().GetAwaiter().GetResult();
}
else
{
throw new Exception($"Got Status code {response.StatusCode} from {requestUri}.");
}
}
}

Expand All @@ -559,7 +573,14 @@ public static async Task<byte[]> GetResourceFromServiceAsByteArrayAsync(string r
using (HttpClient httpClient = new HttpClient())
{
HttpResponseMessage response = await httpClient.GetAsync(requestUri);
return await response.Content.ReadAsByteArrayAsync();
if (response.IsSuccessStatusCode)
{
return await response.Content.ReadAsByteArrayAsync();
}
else
{
throw new Exception($"Got Status code {response.StatusCode} from {requestUri}.");
}
}
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
</PropertyGroup>

<PropertyGroup Condition="'$(ServiceTcpPort)' == ''">
<ServiceTcpPort>809</ServiceTcpPort>
<ServiceTcpPort>8808</ServiceTcpPort>
</PropertyGroup>

<PropertyGroup Condition="'$(ServiceWebSocketPort)' == ''">
Expand Down
Loading
Loading