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

[Bug repro] Convert snippet syntax #6619

Draft
wants to merge 5 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all 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
120 changes: 60 additions & 60 deletions xml/System.Net.Security/NegotiateStream.xml

Large diffs are not rendered by default.

270 changes: 135 additions & 135 deletions xml/System.Net/WebClient.xml

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@
## Examples
You can use the following configuration to specify the namespace, contract name, and user defined types to be included. You can also specify other settings for a service contract

[!code-xml[S_UEComContractElement#100](~/samples/snippets/csharp/VS_Snippets_CFX/s_uecomcontractelement/common/app.config#100)]
:::code language="xml" source="~/samples/snippets/csharp/VS_Snippets_CFX/s_uecomcontractelement/common/app.config" id="Snippet100":::

When the service is initialized, the specified namespaces and contract names are applied to the generated service descriptions.

Expand Down Expand Up @@ -162,7 +162,7 @@ ComSvcConfig.exe /i /application:OnlineStore /contract:ItemOrders.Financial,IFin

When you run the ComSvcConfig.exe tool, it then generates the following service contract listing the previously mentioned methods as `exposedMethod` elements.

[!code-xml[S_UEComContractElement#101](~/samples/snippets/csharp/VS_Snippets_CFX/s_uecomcontractelement/common/app2.config#101)]
:::code language="xml" source="~/samples/snippets/csharp/VS_Snippets_CFX/s_uecomcontractelement/common/app2.config" id="Snippet101":::

At service initialization time, the runtime attempts to generate a service contract by reflecting over and adding only the methods included in the list of `exposedMethod` elements. A trace is produced for every interface method that is not included on the service contract.

Expand Down Expand Up @@ -358,7 +358,7 @@ ComSvcConfig.exe /i /application:OnlineStore /contract:ItemOrders.Financial,IFin
## Examples
The following example demonstrates adding two specific UDTs to the `<userDefinedTypes>` section of the configuration file for this purpose.

[!code-xml[S_UEComContractElement#102](~/samples/snippets/csharp/VS_Snippets_CFX/s_uecomcontractelement/common/app3.config#102)]
:::code language="xml" source="~/samples/snippets/csharp/VS_Snippets_CFX/s_uecomcontractelement/common/app3.config" id="Snippet102":::

The attributes of the `<userDefinedType>` element are defined as follows:

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
## Examples
The following code example shows how to use a configuration file to enable the HTML help page feature and return exception information inside a SOAP fault back to the client for debugging purposes (in addition to enabling metadata support).

[!code-xml[ServiceDebugBehaviorConfig#1](~/samples/snippets/csharp/VS_Snippets_CFX/servicedebugbehaviorconfig/cs/hostapplication.exe.config#1)]
:::code language="xml" source="~/samples/snippets/csharp/VS_Snippets_CFX/servicedebugbehaviorconfig/cs/hostapplication.exe.config" id="Snippet1":::

]]></format>
</remarks>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@
## Examples
The following code example shows a client configuration file that instructs WCF to return managed exception information from a client callback object in SOAP messages.

[!code-xml[SCA.CallbackContract#4](~/samples/snippets/csharp/VS_Snippets_CFX/sca.callbackcontract/cs/client.exe.config#4)]
:::code language="xml" source="~/samples/snippets/csharp/VS_Snippets_CFX/sca.callbackcontract/cs/client.exe.config" id="Snippet4":::

]]></format>
</remarks>
Expand Down Expand Up @@ -147,7 +147,7 @@
## Examples
The following code example shows a client configuration file that instructs WCF to return managed exception information from a client callback object in SOAP messages.

[!code-xml[SCA.CallbackContract#4](~/samples/snippets/csharp/VS_Snippets_CFX/sca.callbackcontract/cs/client.exe.config#4)]
:::code language="xml" source="~/samples/snippets/csharp/VS_Snippets_CFX/sca.callbackcontract/cs/client.exe.config" id="Snippet4":::

]]></format>
</remarks>
Expand Down
16 changes: 8 additions & 8 deletions xml/System.ServiceModel.Description/IEndpointBehavior.xml
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,19 @@

The first step is to implement the message inspector.

[!code-csharp[IEndpointBehavior#2](~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/iendpointbehaviormessageinspector.cs#2)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/iendpointbehaviormessageinspector.cs" id="Snippet2":::

The next code example shows the use of the <xref:System.ServiceModel.Description.IEndpointBehavior.ApplyDispatchBehavior%2A> method to add the message inspector to the <xref:System.ServiceModel.Dispatcher.DispatchRuntime.MessageInspectors%2A?displayProperty=nameWithType> property.

[!code-csharp[IEndpointBehavior#4](~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/iendpointbehaviormessageinspector.cs#4)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/iendpointbehaviormessageinspector.cs" id="Snippet4":::

The following code example shows the implementation of <xref:System.ServiceModel.Configuration.BehaviorExtensionElement?displayProperty=nameWithType> in order to enable use of the message inspector behavior from a configuration file.

[!code-csharp[IEndpointBehavior#3](~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/iendpointbehaviormessageinspector.cs#3)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/iendpointbehaviormessageinspector.cs" id="Snippet3":::

Finally, the following configuration file shows how the preceding example can be used from configuration.

[!code-xml[IEndpointBehavior#5](~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/hostapplication.exe.config#5)]
:::code language="xml" source="~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/hostapplication.exe.config" id="Snippet5":::

]]></format>
</remarks>
Expand Down Expand Up @@ -237,19 +237,19 @@

The first step is to implement the message inspector.

[!code-csharp[IEndpointBehavior#2](~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/iendpointbehaviormessageinspector.cs#2)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/iendpointbehaviormessageinspector.cs" id="Snippet2":::

The next code example shows the use of the <xref:System.ServiceModel.Description.IEndpointBehavior.ApplyDispatchBehavior%2A> method to add the message inspector to the <xref:System.ServiceModel.Dispatcher.DispatchRuntime.MessageInspectors%2A?displayProperty=nameWithType> property.

[!code-csharp[IEndpointBehavior#4](~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/iendpointbehaviormessageinspector.cs#4)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/iendpointbehaviormessageinspector.cs" id="Snippet4":::

The following code example shows the implementation of <xref:System.ServiceModel.Configuration.BehaviorExtensionElement?displayProperty=nameWithType> in order to enable use of the message inspector behavior from a configuration file.

[!code-csharp[IEndpointBehavior#3](~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/iendpointbehaviormessageinspector.cs#3)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/iendpointbehaviormessageinspector.cs" id="Snippet3":::

Finally, the following configuration file shows how the preceding example can be used from configuration.

[!code-xml[IEndpointBehavior#5](~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/hostapplication.exe.config#5)]
:::code language="xml" source="~/samples/snippets/csharp/VS_Snippets_CFX/iendpointbehavior/cs/hostapplication.exe.config" id="Snippet5":::

]]></format>
</remarks>
Expand Down
24 changes: 12 additions & 12 deletions xml/System.ServiceModel.Description/IPolicyExportExtension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -35,21 +35,21 @@
## Examples
The following code example shows the implementation of <xref:System.ServiceModel.Description.IPolicyExportExtension> on a <xref:System.ServiceModel.Channels.BindingElement>. In this example, a custom binding element is attached to the WSDL file at the binding level.

[!code-csharp[CustomPolicySample#14](~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyexporter.cs#14)]
[!code-vb[CustomPolicySample#14](~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/policyexporter.vb#14)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyexporter.cs" id="Snippet14":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/policyexporter.vb" id="Snippet14":::

The following code example shows a <xref:System.ServiceModel.Configuration.BindingElementExtensionElement?displayProperty=nameWithType> implementation that enables the preceding policy exporter to be loaded from an application configuration file.

[!code-csharp[CustomPolicySample#15](~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyexporter.cs#15)]
[!code-vb[CustomPolicySample#15](~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/policyexporter.vb#15)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyexporter.cs" id="Snippet15":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/policyexporter.vb" id="Snippet15":::

The following example shows the host configuration file that loads the custom policy exporter.

[!code-xml[CustomPolicySample#3](~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/app.config#3)]
:::code language="xml" source="~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/app.config" id="Snippet3":::

The following example shows the custom assertion in the WSDL file.

[!code-xml[CustomPolicySample#16](~/samples/snippets/common/VS_Snippets_CFX/custompolicysample/common/tempuri.org.wsdl#16)]
:::code language="xml" source="~/samples/snippets/common/VS_Snippets_CFX/custompolicysample/common/tempuri.org.wsdl" id="Snippet16":::

]]></format>
</remarks>
Expand Down Expand Up @@ -90,21 +90,21 @@
## Examples
The following code example shows the implementation of <xref:System.ServiceModel.Description.IPolicyExportExtension> on a <xref:System.ServiceModel.Channels.BindingElement>. In this example, a custom binding element is attached to the WSDL file at the binding level.

[!code-csharp[CustomPolicySample#14](~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyexporter.cs#14)]
[!code-vb[CustomPolicySample#14](~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/policyexporter.vb#14)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyexporter.cs" id="Snippet14":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/policyexporter.vb" id="Snippet14":::

The following code example shows a <xref:System.ServiceModel.Configuration.BindingElementExtensionElement?displayProperty=nameWithType> implementation that enables the preceding policy exporter to be loaded from an application configuration file.

[!code-csharp[CustomPolicySample#15](~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyexporter.cs#15)]
[!code-vb[CustomPolicySample#15](~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/policyexporter.vb#15)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyexporter.cs" id="Snippet15":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/policyexporter.vb" id="Snippet15":::

The following example shows the host configuration file that loads the custom policy exporter.

[!code-xml[CustomPolicySample#3](~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/app.config#3)]
:::code language="xml" source="~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/app.config" id="Snippet3":::

The following example shows the custom assertion in the WSDL file.

[!code-xml[CustomPolicySample#16](~/samples/snippets/common/VS_Snippets_CFX/custompolicysample/common/tempuri.org.wsdl#16)]
:::code language="xml" source="~/samples/snippets/common/VS_Snippets_CFX/custompolicysample/common/tempuri.org.wsdl" id="Snippet16":::

]]></format>
</remarks>
Expand Down
20 changes: 10 additions & 10 deletions xml/System.ServiceModel.Description/IPolicyImportExtension.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,17 +49,17 @@
## Examples
The following code example shows the use of the <xref:System.ServiceModel.Description.PolicyAssertionCollection.Remove%2A?displayProperty=nameWithType> method to locate, return, and remove the assertion in one step.

[!code-csharp[CustomPolicySample#1](~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyimporter.cs#1)]
[!code-vb[CustomPolicySample#1](~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/policyimporter.vb#1)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyimporter.cs" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/policyimporter.vb" id="Snippet1":::

The following code example shows the client application configuration file to load the custom policy importer when the <xref:System.ServiceModel.Description.MetadataResolver?displayProperty=nameWithType> is invoked.

[!code-xml[CustomPolicySample#7](~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/client.exe.config#7)]
:::code language="xml" source="~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/client.exe.config" id="Snippet7":::

The following code example shows the use of the <xref:System.ServiceModel.Description.MetadataResolver> to download and resolve metadata into description objects.

[!code-csharp[CustomPolicySample#10](~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/client.cs#10)]
[!code-vb[CustomPolicySample#10](~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/client.vb#10)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/client.cs" id="Snippet10":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/client.vb" id="Snippet10":::

]]></format>
</remarks>
Expand Down Expand Up @@ -112,17 +112,17 @@
## Examples
The following code example shows the use of the <xref:System.ServiceModel.Description.PolicyAssertionCollection.Remove%2A?displayProperty=nameWithType> method to locate, return, and remove the assertion in one step.

[!code-csharp[CustomPolicySample#1](~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyimporter.cs#1)]
[!code-vb[CustomPolicySample#1](~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/policyimporter.vb#1)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/policyimporter.cs" id="Snippet1":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/policyimporter.vb" id="Snippet1":::

The following code example shows the client application configuration file to load the custom policy importer when the <xref:System.ServiceModel.Description.MetadataResolver?displayProperty=nameWithType> is invoked.

[!code-xml[CustomPolicySample#7](~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/client.exe.config#7)]
:::code language="xml" source="~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/client.exe.config" id="Snippet7":::

The following code example shows the use of the <xref:System.ServiceModel.Description.MetadataResolver> to download and resolve metadata into description objects.

[!code-csharp[CustomPolicySample#10](~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/client.cs#10)]
[!code-vb[CustomPolicySample#10](~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/client.vb#10)]
:::code language="csharp" source="~/samples/snippets/csharp/VS_Snippets_CFX/custompolicysample/cs/client.cs" id="Snippet10":::
:::code language="vb" source="~/samples/snippets/visualbasic/VS_Snippets_CFX/custompolicysample/vb/client.vb" id="Snippet10":::

]]></format>
</remarks>
Expand Down
Loading