Skip to content

Commit

Permalink
Added back support for netstandard2.0 and netfx
Browse files Browse the repository at this point in the history
Adding System.ServiceModel.dll shim to Primitives lib/net8.0
Add placeholder file to stop package being used on older runtimes
Adding System.ServiceModel.dll shim to Primitives lib/net8.0
  • Loading branch information
mconnew committed Nov 8, 2024
1 parent 1634b13 commit 0011928
Show file tree
Hide file tree
Showing 63 changed files with 9,715 additions and 1,477 deletions.
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ build/
bld/
[Bb]in/
[Oo]bj/
msbuild.binlog
*.binlog
msbuild.log
msbuild.err
msbuild.wrn
Expand Down
15 changes: 8 additions & 7 deletions Directory.Build.props
Original file line number Diff line number Diff line change
Expand Up @@ -9,17 +9,18 @@
<Ship_SvcUtilXmlSerPackages Condition="'$(Ship_SvcUtilXmlSerPackages)'==''">false</Ship_SvcUtilXmlSerPackages>
<Ship_SvcUtilPackages Condition="'$(Ship_SvcUtilPackages)'==''">false</Ship_SvcUtilPackages>
<Ship_WcfPackages Condition="'$(Ship_WcfPackages)'==''">true</Ship_WcfPackages>
<PlaceholderFile>$(RepositoryEngineeringDir)_._</PlaceholderFile>
</PropertyGroup>

<!-- Include license and third party files to packages -->
<ItemGroup>
<Content Include="$(RepoRoot)THIRD-PARTY-NOTICES.TXT" Pack="true" PackagePath="\" />
<Content Include="$(RepoRoot)LICENSE.TXT" Pack="true" PackagePath="\" />
</ItemGroup>
<PropertyGroup>
<NetFrameworkVersion>net462</NetFrameworkVersion>
<DotNetVersion>net8.0</DotNetVersion>
</PropertyGroup>

<PropertyGroup>
<IsPartialFacadeAssembly Condition="'$(IsPartialFacadeAssembly)'=='' AND ($(MSBuildProjectName.EndsWith('.Facade')))">true</IsPartialFacadeAssembly>
<IsReferenceAssembly Condition="'$(IsReferenceAssembly)'=='' AND ($(MSBuildProjectName.EndsWith('.Ref')))">true</IsReferenceAssembly>
<IsReferenceAssembly Condition="'$(IsReferenceAssembly)' == '' and ($(MSBuildProjectName.EndsWith('.Ref')))">true</IsReferenceAssembly>
<HasReferenceAssembly Condition="'$(IsReferenceAssembly)' != 'true' AND Exists('..\ref\$([System.IO.Path]::GetFileNameWithoutExtension($(MSBuildProjectFile))).Ref.csproj')">true</HasReferenceAssembly>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -52,7 +53,7 @@

<ItemGroup Condition="'$(IsTestProject)' == 'true'">
<!-- Microsoft.NET.Test.Sdk package defaults to restore the minimum supported version for its dependency Newtonsoft.Json, here force test project to reference higher version for security reason. -->
<PackageReference Include="Newtonsoft.Json" Version="13.0.2" />
<PackageReference Include="Newtonsoft.Json" Version="$(NewtonsoftJsonPackageVersion)" />
</ItemGroup>

</Project>
16 changes: 14 additions & 2 deletions Directory.Build.targets
Original file line number Diff line number Diff line change
Expand Up @@ -2,15 +2,26 @@
<Project>

<Import Project="Sdk.targets" Sdk="Microsoft.DotNet.Arcade.Sdk" />
<Import Project="eng\FacadeAssemblies.targets" Condition="'$(IsPartialFacadeAssembly)' == 'true'" />
<!-- <Import Project="eng\FacadeAssemblies.targets" Condition="'$(IsPartialFacadeAssembly)' == 'true'" /> -->
<Import Project="eng\GenRefAssembly.targets" Condition="'$(HasReferenceAssembly)' == 'true'" />
<Import Project="eng\ReferenceAssembly.targets" Condition="'$(IsReferenceAssembly)' == 'true'" />
<Import Project="eng\testing\runsettings.targets" Condition="'$(EnableRunSettingsSupport)' == 'true'" />

<!-- Include license and third party files to packages -->
<ItemGroup Condition="'$(IsShippingPackage)' != 'false'">
<Content Include="$(RepoRoot)THIRD-PARTY-NOTICES.TXT" Pack="true" PackagePath="\" />
<Content Include="$(RepoRoot)LICENSE.TXT" Pack="true" PackagePath="\" />
</ItemGroup>

<PropertyGroup>
<!-- Disable some standard properties for building our projects -->
<GenerateTargetFrameworkAttribute>true</GenerateTargetFrameworkAttribute>
<GenerateAssemblyConfigurationAttribute>false</GenerateAssemblyConfigurationAttribute>
<!-- [todo:arcade] This attribute exists in our previously shipped S.P.SM assembly but not in all the Facade assemblies. For now removing accross all assemblies. -->
<GenerateNeutralResourcesLanguageAttribute>false</GenerateNeutralResourcesLanguageAttribute>
<!-- We only want to ensure direct dependencies don't have a vulnerability for our packages,
but for unit tests, we want to make sure we aren't using vulnerable versions at runtime -->
<NuGetAuditMode Condition="'$(IsTestProject)' != 'true'">direct</NuGetAuditMode>
</PropertyGroup>

<PropertyGroup>
Expand Down Expand Up @@ -46,5 +57,6 @@
<_Parameter1>true</_Parameter1>
</AssemblyAttribute>
</ItemGroup>


<Import Project="eng\RuntimePackages.targets" Condition="'$(StrongNameKeyId)' == 'Microsoft'" />
</Project>
9 changes: 7 additions & 2 deletions NuGet.config
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,13 @@
<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" />
</packageSources>
<disabledPackageSources />
<auditSources>
<clear />
<add key="nuget.org" value="https://api.nuget.org/v3/index.json" />
</auditSources>
<disabledPackageSources>
<clear />
</disabledPackageSources>
</configuration>
42 changes: 42 additions & 0 deletions System.ServiceModel.sln
Original file line number Diff line number Diff line change
Expand Up @@ -91,6 +91,24 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Binding.UDS.IntegrationTest
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.ServiceModel.NetNamedPipe.Tests", "src\System.ServiceModel.NetNamedPipe\tests\System.ServiceModel.NetNamedPipe.Tests.csproj", "{FD188537-21AF-48C5-84FF-F8758F4C42A8}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.ServiceModel.Http.Ref", "src\System.ServiceModel.Http\ref\System.ServiceModel.Http.Ref.csproj", "{34CCEAC9-43B1-4654-BF2F-0B40EC7AD016}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.ServiceModel.NetTcp.Ref", "src\System.ServiceModel.NetTcp\ref\System.ServiceModel.NetTcp.Ref.csproj", "{81843CB2-E128-427B-9920-EEDBBBD4CB0B}"
EndProject
Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build Files", "Build Files", "{E7BC33F3-6B4C-44A1-9427-10312E1EAB26}"
ProjectSection(SolutionItems) = preProject
Directory.Build.props = Directory.Build.props
Directory.Build.targets = Directory.Build.targets
EndProjectSection
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.ServiceModel.Duplex", "src\System.ServiceModel.Duplex\src\System.ServiceModel.Duplex.csproj", "{1B2CC303-9D61-4A2E-9B9F-BD92294411E9}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.ServiceModel.Security", "src\System.ServiceModel.Security\src\System.ServiceModel.Security.csproj", "{DFABBE15-01CF-473A-8BD4-A7F374371E4C}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.ServiceModel.Shim", "src\System.ServiceModel.Shim\System.ServiceModel.Shim.csproj", "{1C5A7A17-E06D-4F19-B18B-C5AAE512AF59}"
EndProject
Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "System.ServiceModel.NetFramingBase.Ref", "src\System.ServiceModel.NetFramingBase\ref\System.ServiceModel.NetFramingBase.Ref.csproj", "{09D0456B-C1C6-40E4-AE8E-64D60189A7B2}"
EndProject
Global
GlobalSection(SolutionConfigurationPlatforms) = preSolution
Debug|Any CPU = Debug|Any CPU
Expand Down Expand Up @@ -265,6 +283,30 @@ Global
{FD188537-21AF-48C5-84FF-F8758F4C42A8}.Debug|Any CPU.Build.0 = Debug|Any CPU
{FD188537-21AF-48C5-84FF-F8758F4C42A8}.Release|Any CPU.ActiveCfg = Release|Any CPU
{FD188537-21AF-48C5-84FF-F8758F4C42A8}.Release|Any CPU.Build.0 = Release|Any CPU
{34CCEAC9-43B1-4654-BF2F-0B40EC7AD016}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{34CCEAC9-43B1-4654-BF2F-0B40EC7AD016}.Debug|Any CPU.Build.0 = Debug|Any CPU
{34CCEAC9-43B1-4654-BF2F-0B40EC7AD016}.Release|Any CPU.ActiveCfg = Release|Any CPU
{34CCEAC9-43B1-4654-BF2F-0B40EC7AD016}.Release|Any CPU.Build.0 = Release|Any CPU
{81843CB2-E128-427B-9920-EEDBBBD4CB0B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{81843CB2-E128-427B-9920-EEDBBBD4CB0B}.Debug|Any CPU.Build.0 = Debug|Any CPU
{81843CB2-E128-427B-9920-EEDBBBD4CB0B}.Release|Any CPU.ActiveCfg = Release|Any CPU
{81843CB2-E128-427B-9920-EEDBBBD4CB0B}.Release|Any CPU.Build.0 = Release|Any CPU
{1B2CC303-9D61-4A2E-9B9F-BD92294411E9}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1B2CC303-9D61-4A2E-9B9F-BD92294411E9}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1B2CC303-9D61-4A2E-9B9F-BD92294411E9}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1B2CC303-9D61-4A2E-9B9F-BD92294411E9}.Release|Any CPU.Build.0 = Release|Any CPU
{DFABBE15-01CF-473A-8BD4-A7F374371E4C}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{DFABBE15-01CF-473A-8BD4-A7F374371E4C}.Debug|Any CPU.Build.0 = Debug|Any CPU
{DFABBE15-01CF-473A-8BD4-A7F374371E4C}.Release|Any CPU.ActiveCfg = Release|Any CPU
{DFABBE15-01CF-473A-8BD4-A7F374371E4C}.Release|Any CPU.Build.0 = Release|Any CPU
{1C5A7A17-E06D-4F19-B18B-C5AAE512AF59}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{1C5A7A17-E06D-4F19-B18B-C5AAE512AF59}.Debug|Any CPU.Build.0 = Debug|Any CPU
{1C5A7A17-E06D-4F19-B18B-C5AAE512AF59}.Release|Any CPU.ActiveCfg = Release|Any CPU
{1C5A7A17-E06D-4F19-B18B-C5AAE512AF59}.Release|Any CPU.Build.0 = Release|Any CPU
{09D0456B-C1C6-40E4-AE8E-64D60189A7B2}.Debug|Any CPU.ActiveCfg = Debug|Any CPU
{09D0456B-C1C6-40E4-AE8E-64D60189A7B2}.Debug|Any CPU.Build.0 = Debug|Any CPU
{09D0456B-C1C6-40E4-AE8E-64D60189A7B2}.Release|Any CPU.ActiveCfg = Release|Any CPU
{09D0456B-C1C6-40E4-AE8E-64D60189A7B2}.Release|Any CPU.Build.0 = Release|Any CPU
EndGlobalSection
GlobalSection(SolutionProperties) = preSolution
HideSolutionNode = FALSE
Expand Down
7 changes: 5 additions & 2 deletions eng/FacadeAssemblies.targets
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,11 @@
</PropertyGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.GenFacades" Version="$(MicrosoftDotNetGenFacadesPackageVersion)" PrivateAssets="All" />

<PackageReference Include="Microsoft.DotNet.GenFacades"
Version="$(MicrosoftDotNetGenFacadesVersion)"
PrivateAssets="all"
IsImplicitlyDefined="true" />

<ContractProjectReference Include="..\ref\$(AssemblyName).Ref.csproj"
Condition="'@(ContractProjectReference)' == '' AND '$(HasReferenceAssembly)' == 'true'" />
</ItemGroup>
Expand Down
37 changes: 37 additions & 0 deletions eng/GenRefAssembly.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,37 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<PropertyGroup>
<ProduceReferenceAssembly>false</ProduceReferenceAssembly>
<GenAPIGenerateReferenceAssemblySource Condition="'$(GenAPIGenerateReferenceAssemblySource)' == ''">true</GenAPIGenerateReferenceAssemblySource>
<GenAPITargetPath>..\ref\$(AssemblyName).cs</GenAPITargetPath>
<RefAssemblyProjectReference>$(MSBuildProjectDirectory)\..\ref\$(AssemblyName).Ref.csproj</RefAssemblyProjectReference>
<RefAssemblyProjectReference>$([System.IO.Path]::GetFullPath($(RefAssemblyProjectReference)))</RefAssemblyProjectReference>
<GenAPIExcludeApiList Condition="Exists('ReferenceAssemblyExclusions.txt')">ReferenceAssemblyExclusions.txt</GenAPIExcludeApiList>
<!-- <RefAssemblyProjectReference Condition="'$(RefAssemblyProjectReference)' == '' AND '$(HasReferenceAssembly)' == 'true'">$([System.IO.Path]::GetFullPath($(MSBuildProjectDirectory)\..\ref\$(AssemblyName).Ref.csproj)</RefAssemblyProjectReference> -->
</PropertyGroup>

<ItemGroup>
<None Include="ReferenceAssemblyExclusions.txt" Condition="Exists('ReferenceAssemblyExclusions.txt')" />
</ItemGroup>

<ItemGroup>
<PackageReference Include="Microsoft.DotNet.GenAPI"
version="$(MicrosoftDotNetGenApiPackageVersion)"
PrivateAssets="all"
IsImplicitlyDefined="true"/>
<ProjectReference Include="$(RefAssemblyProjectReference)">
<ReferenceOutputAssembly>false</ReferenceOutputAssembly>
<OutputItemType>ResolvedReferenceAssemblyReference</OutputItemType>
</ProjectReference>
</ItemGroup>

<PropertyGroup Condition="'$(HasReferenceAssembly)' == 'true'">
<TargetsForTfmSpecificContentInPackage>$(TargetsForTfmSpecificContentInPackage);AddReferenceAssemblyToPackage</TargetsForTfmSpecificContentInPackage>
</PropertyGroup>

<Target Name="AddReferenceAssemblyToPackage" AfterTargets="AssignTargetPaths">
<ItemGroup>
<TfmSpecificPackageFile Include="@(ResolvedReferenceAssemblyReference)" PackagePath="ref/$(TargetFramework)" />
</ItemGroup>
</Target>
</Project>
30 changes: 30 additions & 0 deletions eng/ReferenceAssembly.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,30 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup Condition="'$(TargetFramework)' == '$(NetFrameworkVersion)'">
<None Include="@(Compile)" />
<Compile Remove="@(Compile)" />
<Reference Include="System" />
<Reference Include="System.IdentityModel" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Xml" />
</ItemGroup>

<ItemGroup Condition="'$(IsPartialFacadeAssembly)' != 'true' and '$(EnableDefaultCompileItems)' != 'false'">
<ProjectReference Include="..\..\System.ServiceModel.Primitives\ref\System.ServiceModel.Primitives.Ref.csproj" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' and Exists('netstandard.cs')">
<None Include="@(Compile)" />
<Compile Remove="@(Compile)" />
<None Condition="Exists('netstandard.cs')" Remove="netstandard.cs" />
<Compile Condition="Exists('netstandard.cs')" Include="netstandard.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(DotNetVersion)' and '$(EnableDefaultCompileItems)' != 'false'">
<None Include="@(Compile)" />
<Compile Remove="@(Compile)" />
<None Condition="Exists('$(AssemblyName).cs')" Remove="$(AssemblyName).cs" />
<Compile Condition="Exists('$(AssemblyName).cs')" Include="$(AssemblyName).cs" />
</ItemGroup>
</Project>
Empty file added eng/RuntimePackages.props
Empty file.
59 changes: 59 additions & 0 deletions eng/RuntimePackages.targets
Original file line number Diff line number Diff line change
@@ -0,0 +1,59 @@
<?xml version="1.0" encoding="utf-8"?>
<Project>
<ItemGroup Condition="'$(IncludeSRCommonCode)' != 'false' and '$(IsReferenceAssembly)' != 'true'">
<Compile Include="..\..\Common\src\System\SR.cs">
<Link>Common\System\SR.cs</Link>
</Compile>
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(NetFrameworkVersion)'">
<PackageReference Include="Microsoft.NETFramework.ReferenceAssemblies" Version="1.0.3" PrivateAssets="All" IsImplicitlyDefined="true" />
<Reference Include="System" />
<Reference Include="System.IdentityModel" />
<Reference Include="System.Runtime.Serialization" />
<Reference Include="System.ServiceModel" />
<Reference Include="System.Xml" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(NetFrameworkVersion)' and Exists('NetFxTypeForwards.cs')">
<None Include="@(Compile)" />
<Compile Remove="@(Compile)" />
<None Include="@(EmbeddedResource)" />
<EmbeddedResource Remove="@(EmbeddedResource)" />
<None Remove="NetFxTypeForwards.cs" />
<Compile Include="NetFxTypeForwards.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == 'netstandard2.0' and Exists('netstandard.cs')">
<None Include="@(Compile)" />
<Compile Remove="@(Compile)" />
<None Include="@(EmbeddedResource)" />
<EmbeddedResource Remove="@(EmbeddedResource)" />
<None Remove="netstandard.cs" />
<Compile Include="netstandard.cs" />
</ItemGroup>

<ItemGroup Condition="'$(TargetFramework)' == '$(DotNetVersion)'">
<Compile Condition="Exists('netstandard.cs')" Remove="netstandard.cs" />
<Compile Condition="Exists('NetFxTypeForwards.cs')" Remove="NetFxTypeForwards.cs" />
<None Condition="Exists('netstandard.cs')" Include="netstandard.cs" />
<None Condition="Exists('NetFxTypeForwards.cs')" Include="NetFxTypeForwards.cs" />
</ItemGroup>

<PropertyGroup>
<!-- Placeholders don't need a dependency group. -->
<NoWarn>$(NoWarn);NU5128;NU5131</NoWarn>
</PropertyGroup>
<ItemGroup>
<None Include="$(PlaceholderFile)"
Pack="true"
PackagePath="ref\netcoreapp2.0\;
$(BuildOutputTargetFolder)\MonoAndroid10\;
$(BuildOutputTargetFolder)\MonoTouch10\;
$(BuildOutputTargetFolder)\xamarinios10\;
$(BuildOutputTargetFolder)\xamarinmac20\;
$(BuildOutputTargetFolder)\xamarintvos10\;
$(BuildOutputTargetFolder)\xamarinwatchos10\"
Condition="$(TargetFrameworks.Contains('netstandard2.'))" />
</ItemGroup>
</Project>
4 changes: 4 additions & 0 deletions eng/Version.Details.xml
Original file line number Diff line number Diff line change
Expand Up @@ -16,5 +16,9 @@
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>39290b60a9015b444a1762d67e26f0f187eb5cc2</Sha>
</Dependency>
<Dependency Name="Microsoft.DotNet.GenAPI" Version="10.0.0-beta.24557.1">
<Uri>https://github.com/dotnet/arcade</Uri>
<Sha>39290b60a9015b444a1762d67e26f0f187eb5cc2</Sha>
</Dependency>
</ToolsetDependencies>
</Dependencies>
Loading

0 comments on commit 0011928

Please sign in to comment.