-
Notifications
You must be signed in to change notification settings - Fork 5.1k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Update WCF sample Compression Encoder code to conditionally support .…
…NET framework / Core
- Loading branch information
Showing
12 changed files
with
215 additions
and
315 deletions.
There are no files selected for viewing
117 changes: 27 additions & 90 deletions
117
framework/wcf/Extensibility/MessageEncoder/Compression/CS/Client/Client.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,99 +1,36 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.50727</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{97E8A065-31ED-4506-B3A4-6B2E2ED5B124}</ProjectGuid> | ||
<TargetFrameworks>net462;net6.0</TargetFrameworks> | ||
<OutputType>Exe</OutputType> | ||
<AppDesignerFolder>Properties</AppDesignerFolder> | ||
<RootNamespace>Microsoft.Samples.GZipEncoder</RootNamespace> | ||
<AssemblyName>Client</AssemblyName> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<FileUpgradeFlags> | ||
</FileUpgradeFlags> | ||
<OldToolsVersion>2.0</OldToolsVersion> | ||
<UpgradeBackupLocation /> | ||
<PublishUrl>publish\</PublishUrl> | ||
<Install>true</Install> | ||
<InstallFrom>Disk</InstallFrom> | ||
<UpdateEnabled>false</UpdateEnabled> | ||
<UpdateMode>Foreground</UpdateMode> | ||
<UpdateInterval>7</UpdateInterval> | ||
<UpdateIntervalUnits>Days</UpdateIntervalUnits> | ||
<UpdatePeriodically>false</UpdatePeriodically> | ||
<UpdateRequired>false</UpdateRequired> | ||
<MapFileExtensions>true</MapFileExtensions> | ||
<ApplicationRevision>0</ApplicationRevision> | ||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> | ||
<IsWebBootstrapper>false</IsWebBootstrapper> | ||
<UseApplicationTrust>false</UseApplicationTrust> | ||
<BootstrapperEnabled>true</BootstrapperEnabled> | ||
<TargetFrameworkProfile /> | ||
<Title>Client</Title> | ||
<Description>GZipEncoder</Description> | ||
<Company>Microsoft Corporation</Company> | ||
<Product>Windows Communication Foundation and Windows Workflow Foundation SDK</Product> | ||
<Copyright>Copyright (c) Microsoft Corporation</Copyright> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>bin\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<ErrorReport>prompt</ErrorReport> | ||
<WarningLevel>4</WarningLevel> | ||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
<Reference Include="System.configuration" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Runtime.Serialization" /> | ||
<Reference Include="System.ServiceModel" /> | ||
<Reference Include="System.Xml" /> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' "> | ||
<None Remove="Connected Services\Microsoft.Samples.GZipEncoder\ConnectedService.json" /> | ||
<Compile Remove="Connected Services\Microsoft.Samples.GZipEncoder\Reference.cs" /> | ||
<None Include="Connected Services\Microsoft.Samples.GZipEncoder\Reference.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="generatedClient.cs" /> | ||
<Compile Include="Program.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' "> | ||
<None Remove="App.config" /> | ||
<Compile Remove="generatedClient.cs" /> | ||
<None Include="generatedClient.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<None Include="app.config" /> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' "> | ||
<Reference Include="System.ServiceModel" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<ProjectReference Include="..\GZipEncoder\GZipEncoder.csproj"> | ||
<Project>{3EB736C4-62EA-4887-B040-948B13EF29B9}</Project> | ||
<Name>GZipEncoder</Name> | ||
</ProjectReference> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' "> | ||
<PackageReference Include="System.ServiceModel.Primitives" Version="6.*" /> | ||
<PackageReference Include="System.ServiceModel.Http" Version="6.*" /> | ||
</ItemGroup> | ||
|
||
<ItemGroup> | ||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5"> | ||
<Visible>False</Visible> | ||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> | ||
<Install>false</Install> | ||
</BootstrapperPackage> | ||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> | ||
<Visible>False</Visible> | ||
<ProductName>.NET Framework 3.5 SP1</ProductName> | ||
<Install>true</Install> | ||
</BootstrapperPackage> | ||
<BootstrapperPackage Include="Microsoft.VisualBasic.PowerPacks.10.0"> | ||
<Visible>False</Visible> | ||
<ProductName>Microsoft Visual Basic PowerPacks 10.0</ProductName> | ||
<Install>true</Install> | ||
</BootstrapperPackage> | ||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> | ||
<Visible>False</Visible> | ||
<ProductName>Windows Installer 3.1</ProductName> | ||
<Install>true</Install> | ||
</BootstrapperPackage> | ||
<ProjectReference Include="..\GZipEncoder\GZipEncoder.csproj" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> | ||
</Project> | ||
</Project> |
17 changes: 17 additions & 0 deletions
17
...pression/CS/Client/Connected Services/Microsoft.Samples.GZipEncoder/ConnectedService.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
{ | ||
"ExtendedData": { | ||
"inputs": [ | ||
"http://localhost:8000/samples/GZipEncoder?wsdl" | ||
], | ||
"collectionTypes": [ | ||
"System.Array", | ||
"System.Collections.Generic.Dictionary`2" | ||
], | ||
"namespaceMappings": [ | ||
"*, Microsoft.Samples.GZipEncoder" | ||
], | ||
"sync": true, | ||
"targetFramework": "net6.0", | ||
"typeReuseMode": "None" | ||
} | ||
} |
72 changes: 72 additions & 0 deletions
72
...coder/Compression/CS/Client/Connected Services/Microsoft.Samples.GZipEncoder/Reference.cs
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,72 @@ | ||
//------------------------------------------------------------------------------ | ||
// <auto-generated> | ||
// This code was generated by a tool. | ||
// | ||
// Changes to this file may cause incorrect behavior and will be lost if | ||
// the code is regenerated. | ||
// </auto-generated> | ||
//------------------------------------------------------------------------------ | ||
|
||
namespace Microsoft.Samples.GZipEncoder | ||
{ | ||
|
||
|
||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] | ||
[System.ServiceModel.ServiceContractAttribute(ConfigurationName="Microsoft.Samples.GZipEncoder.ISampleServer")] | ||
public interface ISampleServer | ||
{ | ||
|
||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ISampleServer/Echo", ReplyAction="http://tempuri.org/ISampleServer/EchoResponse")] | ||
string Echo(string input); | ||
|
||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ISampleServer/Echo", ReplyAction="http://tempuri.org/ISampleServer/EchoResponse")] | ||
System.Threading.Tasks.Task<string> EchoAsync(string input); | ||
|
||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ISampleServer/BigEcho", ReplyAction="http://tempuri.org/ISampleServer/BigEchoResponse")] | ||
string[] BigEcho(string[] input); | ||
|
||
[System.ServiceModel.OperationContractAttribute(Action="http://tempuri.org/ISampleServer/BigEcho", ReplyAction="http://tempuri.org/ISampleServer/BigEchoResponse")] | ||
System.Threading.Tasks.Task<string[]> BigEchoAsync(string[] input); | ||
} | ||
|
||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] | ||
public interface ISampleServerChannel : Microsoft.Samples.GZipEncoder.ISampleServer, System.ServiceModel.IClientChannel | ||
{ | ||
} | ||
|
||
[System.Diagnostics.DebuggerStepThroughAttribute()] | ||
[System.CodeDom.Compiler.GeneratedCodeAttribute("Microsoft.Tools.ServiceModel.Svcutil", "2.1.0")] | ||
public partial class SampleServerClient : System.ServiceModel.ClientBase<Microsoft.Samples.GZipEncoder.ISampleServer>, Microsoft.Samples.GZipEncoder.ISampleServer | ||
{ | ||
|
||
public SampleServerClient(System.ServiceModel.Channels.Binding binding, System.ServiceModel.EndpointAddress remoteAddress) : | ||
base(binding, remoteAddress) | ||
{ | ||
} | ||
|
||
public string Echo(string input) | ||
{ | ||
return base.Channel.Echo(input); | ||
} | ||
|
||
public System.Threading.Tasks.Task<string> EchoAsync(string input) | ||
{ | ||
return base.Channel.EchoAsync(input); | ||
} | ||
|
||
public string[] BigEcho(string[] input) | ||
{ | ||
return base.Channel.BigEcho(input); | ||
} | ||
|
||
public System.Threading.Tasks.Task<string[]> BigEchoAsync(string[] input) | ||
{ | ||
return base.Channel.BigEchoAsync(input); | ||
} | ||
|
||
public virtual System.Threading.Tasks.Task OpenAsync() | ||
{ | ||
return System.Threading.Tasks.Task.Factory.FromAsync(((System.ServiceModel.ICommunicationObject)(this)).BeginOpen(null, null), new System.Action<System.IAsyncResult>(((System.ServiceModel.ICommunicationObject)(this)).EndOpen)); | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
23 changes: 0 additions & 23 deletions
23
framework/wcf/Extensibility/MessageEncoder/Compression/CS/Client/Properties/AssemblyInfo.cs
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
95 changes: 15 additions & 80 deletions
95
framework/wcf/Extensibility/MessageEncoder/Compression/CS/GZipEncoder/GZipEncoder.csproj
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,87 +1,22 @@ | ||
<?xml version="1.0" encoding="utf-8"?> | ||
<Project DefaultTargets="Build" xmlns="http://schemas.microsoft.com/developer/msbuild/2003" ToolsVersion="4.0"> | ||
<Project Sdk="Microsoft.NET.Sdk"> | ||
<PropertyGroup> | ||
<Configuration Condition=" '$(Configuration)' == '' ">Debug</Configuration> | ||
<Platform Condition=" '$(Platform)' == '' ">AnyCPU</Platform> | ||
<ProductVersion>8.0.50727</ProductVersion> | ||
<SchemaVersion>2.0</SchemaVersion> | ||
<ProjectGuid>{3EB736C4-62EA-4887-B040-948B13EF29B9}</ProjectGuid> | ||
<TargetFrameworks>net462;net6.0</TargetFrameworks> | ||
<OutputType>Library</OutputType> | ||
<RootNamespace>Microsoft.Samples.GZipEncoder</RootNamespace> | ||
<AssemblyName>GZipEncoder</AssemblyName> | ||
<WarningLevel>4</WarningLevel> | ||
<TargetFrameworkVersion>v4.0</TargetFrameworkVersion> | ||
<FileUpgradeFlags> | ||
</FileUpgradeFlags> | ||
<OldToolsVersion>2.0</OldToolsVersion> | ||
<UpgradeBackupLocation /> | ||
<PublishUrl>publish\</PublishUrl> | ||
<Install>true</Install> | ||
<InstallFrom>Disk</InstallFrom> | ||
<UpdateEnabled>false</UpdateEnabled> | ||
<UpdateMode>Foreground</UpdateMode> | ||
<UpdateInterval>7</UpdateInterval> | ||
<UpdateIntervalUnits>Days</UpdateIntervalUnits> | ||
<UpdatePeriodically>false</UpdatePeriodically> | ||
<UpdateRequired>false</UpdateRequired> | ||
<MapFileExtensions>true</MapFileExtensions> | ||
<ApplicationRevision>0</ApplicationRevision> | ||
<ApplicationVersion>1.0.0.%2a</ApplicationVersion> | ||
<IsWebBootstrapper>false</IsWebBootstrapper> | ||
<UseApplicationTrust>false</UseApplicationTrust> | ||
<BootstrapperEnabled>true</BootstrapperEnabled> | ||
<TargetFrameworkProfile /> | ||
<Title>GZipEncoder</Title> | ||
<Description>GZipEncoder</Description> | ||
<Company>Microsoft Corporation</Company> | ||
<Product>Windows Communication Foundation and Windows Workflow Foundation SDK</Product> | ||
<Copyright>Copyright (c) Microsoft Corporation</Copyright> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Debug|AnyCPU' "> | ||
<DebugSymbols>true</DebugSymbols> | ||
<DebugType>full</DebugType> | ||
<Optimize>false</Optimize> | ||
<OutputPath>.\bin\</OutputPath> | ||
<DefineConstants>DEBUG;TRACE</DefineConstants> | ||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> | ||
</PropertyGroup> | ||
<PropertyGroup Condition=" '$(Configuration)|$(Platform)' == 'Release|AnyCPU' "> | ||
<DebugType>pdbonly</DebugType> | ||
<Optimize>true</Optimize> | ||
<OutputPath>.\bin\Release\</OutputPath> | ||
<DefineConstants>TRACE</DefineConstants> | ||
<CodeAnalysisRuleSet>AllRules.ruleset</CodeAnalysisRuleSet> | ||
</PropertyGroup> | ||
<ItemGroup> | ||
<Reference Include="System" /> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net462' "> | ||
<Reference Include="System.Configuration" /> | ||
<Reference Include="System.Data" /> | ||
<Reference Include="System.Runtime.Serialization" /> | ||
<Reference Include="System.ServiceModel" /> | ||
<Reference Include="System.Xml" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<Compile Include="GZipMessageEncoderFactory.cs" /> | ||
<Compile Include="GZipMessageEncodingBindingElement.cs" /> | ||
<Compile Include="Properties\AssemblyInfo.cs" /> | ||
<Compile Include="GZipMessageEncodingBindingElementImporter.cs" /> | ||
</ItemGroup> | ||
<ItemGroup> | ||
<BootstrapperPackage Include="Microsoft.Net.Client.3.5"> | ||
<Visible>False</Visible> | ||
<ProductName>.NET Framework 3.5 SP1 Client Profile</ProductName> | ||
<Install>false</Install> | ||
</BootstrapperPackage> | ||
<BootstrapperPackage Include="Microsoft.Net.Framework.3.5.SP1"> | ||
<Visible>False</Visible> | ||
<ProductName>.NET Framework 3.5 SP1</ProductName> | ||
<Install>true</Install> | ||
</BootstrapperPackage> | ||
<BootstrapperPackage Include="Microsoft.VisualBasic.PowerPacks.10.0"> | ||
<Visible>False</Visible> | ||
<ProductName>Microsoft Visual Basic PowerPacks 10.0</ProductName> | ||
<Install>true</Install> | ||
</BootstrapperPackage> | ||
<BootstrapperPackage Include="Microsoft.Windows.Installer.3.1"> | ||
<Visible>False</Visible> | ||
<ProductName>Windows Installer 3.1</ProductName> | ||
<Install>true</Install> | ||
</BootstrapperPackage> | ||
|
||
<ItemGroup Condition=" '$(TargetFramework)' == 'net6.0' "> | ||
<PackageReference Include="System.ServiceModel.Primitives" Version="6.*" /> | ||
<PackageReference Include="System.ServiceModel.Http" Version="6.*" /> | ||
</ItemGroup> | ||
<Import Project="$(MSBuildBinPath)\Microsoft.CSHARP.Targets" /> | ||
</Project> | ||
|
||
</Project> |
Oops, something went wrong.