Skip to content

Commit 3a90509

Browse files
gewarrenmairaw
andauthored
More Acrolinx 1/15/20 (#16706)
* acrolinx * Apply suggestions from Maira Co-Authored-By: Maira Wenzel <[email protected]>
1 parent 364e9af commit 3a90509

File tree

7 files changed

+32
-27
lines changed

7 files changed

+32
-27
lines changed

docs/csharp/language-reference/operators/bitwise-and-shift-operators.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,13 +165,13 @@ The following example demonstrates that behavior:
165165
[!code-csharp-interactive[shift count example](~/samples/csharp/language-reference/operators/BitwiseAndShiftOperators.cs#ShiftCount)]
166166

167167
> [!NOTE]
168-
> As the preceding example shows, the result of a shift operation can be non zero even if the value of the right-hand operand is greater than the number of bits in the left-hand operand.
168+
> As the preceding example shows, the result of a shift operation can be non-zero even if the value of the right-hand operand is greater than the number of bits in the left-hand operand.
169169

170170
## Enumeration logical operators
171171

172172
The `~`, `&`, `|`, and `^` operators are also supported by any [enumeration](../builtin-types/enum.md) type. For operands of the same enumeration type, a logical operation is performed on the corresponding values of the underlying integral type. For example, for any `x` and `y` of an enumeration type `T` with an underlying type `U`, the `x & y` expression produces the same result as the `(T)((U)x & (U)y)` expression.
173173

174-
You typically use bitwise logical operators with an enumeration type which is defined with the [Flags](xref:System.FlagsAttribute) attribute. For more information, see the [Enumeration types as bit flags](../builtin-types/enum.md#enumeration-types-as-bit-flags) section of the [Enumeration types](../builtin-types/enum.md) article.
174+
You typically use bitwise logical operators with an enumeration type that is defined with the [Flags](xref:System.FlagsAttribute) attribute. For more information, see the [Enumeration types as bit flags](../builtin-types/enum.md#enumeration-types-as-bit-flags) section of the [Enumeration types](../builtin-types/enum.md) article.
175175

176176
## Operator overloadability
177177

docs/csharp/programming-guide/classes-and-structs/static-constructors.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ Static constructors have the following properties:
2424

2525
- The user has no control on when the static constructor is executed in the program.
2626

27-
- A static constructor is called automatically to initialize the [class](../../language-reference/keywords/class.md) before the first instance is created or any static members are referenced. A static constructor will run before an instance constructor. Note that a type's static constructor is called when a static method assigned to an event or a delegate is invoked and not when it is assigned. If static field variable initializers are present in the class of the static constructor, they will be executed in the textual order in which they appear in the class declaration immediately prior to the execution of the static constructor.
27+
- A static constructor is called automatically to initialize the [class](../../language-reference/keywords/class.md) before the first instance is created or any static members are referenced. A static constructor will run before an instance constructor. A type's static constructor is called when a static method assigned to an event or a delegate is invoked and not when it is assigned. If static field variable initializers are present in the class of the static constructor, they will be executed in the textual order in which they appear in the class declaration immediately prior to the execution of the static constructor.
2828

2929
- If you don't provide a static constructor to initialize static fields, all static fields are initialized to their default value as listed in [Default values of C# types](../../language-reference/builtin-types/default-values.md).
3030

@@ -42,7 +42,7 @@ Static constructors have the following properties:
4242
- A typical use of static constructors is when the class is using a log file and the constructor is used to write entries to this file.
4343
- Static constructors are also useful when creating wrapper classes for unmanaged code, when the constructor can call the `LoadLibrary` method.
4444

45-
- Static constructors are also a convenient place to enforce run-time checks on the type parameter that cannot be checked at compile-time via constraints (Type parameter constraints).
45+
- Static constructors are also a convenient place to enforce run-time checks on the type parameter that cannot be checked at compile time via constraints (Type parameter constraints).
4646

4747
## Example
4848
In this example, class `Bus` has a static constructor. When the first instance of `Bus` is created (`bus1`), the static constructor is invoked to initialize the class. The sample output verifies that the static constructor runs only one time, even though two instances of `Bus` are created, and that it runs before the instance constructor runs.

docs/framework/unmanaged-api/profiling/corprof-e-unsupported-call-sequence-hresult.md

Lines changed: 10 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -8,24 +8,26 @@ helpviewer_keywords:
88
ms.assetid: f2fc441f-d62e-4f72-a011-354ea13c8c59
99
---
1010
# CORPROF_E_UNSUPPORTED_CALL_SEQUENCE HRESULT
11-
The CORPROF_E_UNSUPPORTED_CALL_SEQUENCE HRESULT was introduced in the .NET Framework version 2.0. The .NET Framework 4 returns this HRESULT in two scenarios:
11+
12+
The CORPROF_E_UNSUPPORTED_CALL_SEQUENCE HRESULT was introduced in .NET Framework version 2.0. .NET Framework 4 returns this HRESULT in two scenarios:
1213

1314
- When a hijacking profiler forcibly resets a thread's register context at an arbitrary time so that the thread tries to access structures that are in an inconsistent state.
1415

1516
- When a profiler tries to call an informational method that triggers garbage collection from a callback method that forbids garbage collection.
1617

17-
These two scenarios are discussed in the following sections.
18+
These two scenarios are discussed in the following sections.
1819

1920
## Hijacking Profilers
20-
(This scenario is primarily an issue with hijacking profilers although there are cases where non-hijacking profilers can see this HRESULT.)
21+
22+
(This scenario is primarily an issue with hijacking profilers, although there are cases where non-hijacking profilers can see this HRESULT.)
2123

22-
In this scenario, a hijacking profiler forcibly resets a thread's register context at an arbitrary time so that the thread can enter profiler code or re-enter the common language runtime (CLR) through an [ICorProfilerInfo](../../../../docs/framework/unmanaged-api/profiling/icorprofilerinfo-interface.md) method.
24+
In this scenario, a hijacking profiler forcibly resets a thread's register context at an arbitrary time so that the thread can enter profiler code or reenter the common language runtime (CLR) through an [ICorProfilerInfo](../../../../docs/framework/unmanaged-api/profiling/icorprofilerinfo-interface.md) method.
2325

24-
Many of the IDs that the profiling API provides point to data structures in the CLR. Many `ICorProfilerInfo` calls merely read information from these data structures and pass them back. However, the CLR might change things in those structures as it runs, and it might use locks to do so. Suppose the CLR was already holding (or attempting to acquire) a lock at the time the profiler hijacked the thread. If the thread re-enters the CLR and tries to take more locks or inspect structures that were in the process of being modified, these structures might be in an inconsistent state. Deadlocks and access violations can easily occur in such situations.
26+
Many of the IDs that the profiling API provides point to data structures in the CLR. Many `ICorProfilerInfo` calls merely read information from these data structures and pass them back. However, the CLR might change things in those structures as it runs, and it might use locks to do so. Suppose the CLR was already holding (or attempting to acquire) a lock at the time the profiler hijacked the thread. If the thread reenters the CLR and tries to take more locks or inspect structures that were in the process of being modified, these structures might be in an inconsistent state. Deadlocks and access violations can easily occur in such situations.
2527

26-
In general, when a non-hijacking profiler executes code inside an [ICorProfilerCallback](../../../../docs/framework/unmanaged-api/profiling/icorprofilercallback-interface.md) method and calls into an `ICorProfilerInfo` method with valid parameters, it should not deadlock or receive an access violation. For example, profiler code that runs inside the [ICorProfilerCallback::ClassLoadFinished](../../../../docs/framework/unmanaged-api/profiling/icorprofilercallback-classloadfinished-method.md) method may ask for information about the class by calling the [ICorProfilerInfo2::GetClassIDInfo2](../../../../docs/framework/unmanaged-api/profiling/icorprofilerinfo2-getclassidinfo2-method.md) method. The code might receive an CORPROF_E_DATAINCOMPLETE HRESULT to indicate that information is unavailable; however, it will not deadlock or receive an access violation. This class of calls into `ICorProfilerInfo` are called synchronous, because they are made from an `ICorProfilerCallback` method.
28+
In general, when a non-hijacking profiler executes code inside an [ICorProfilerCallback](../../../../docs/framework/unmanaged-api/profiling/icorprofilercallback-interface.md) method and calls into an `ICorProfilerInfo` method with valid parameters, it should not deadlock or receive an access violation. For example, profiler code that runs inside the [ICorProfilerCallback::ClassLoadFinished](../../../../docs/framework/unmanaged-api/profiling/icorprofilercallback-classloadfinished-method.md) method may ask for information about the class by calling the [ICorProfilerInfo2::GetClassIDInfo2](../../../../docs/framework/unmanaged-api/profiling/icorprofilerinfo2-getclassidinfo2-method.md) method. The code might receive an CORPROF_E_DATAINCOMPLETE HRESULT to indicate that information is unavailable. However, it will not deadlock or receive an access violation. These calls into `ICorProfilerInfo` are considered synchronous, because they are made from an `ICorProfilerCallback` method.
2729

28-
However, a managed thread that executes code that is not within an `ICorProfilerCallback` method is considered to be making an asynchronous call. In the .NET Framework version 1, it was difficult to determine what might happen in an asynchronous call. The call could deadlock, crash, or give an invalid answer. The .NET Framework version 2.0 introduced some simple checks to help you avoid this problem. In the .NET Framework 2.0, if you call an unsafe `ICorProfilerInfo` function asynchronously, it fails with an CORPROF_E_UNSUPPORTED_CALL_SEQUENCE HRESULT.
30+
However, a managed thread that executes code that is not within an `ICorProfilerCallback` method is considered to be making an asynchronous call. In .NET Framework version 1, it was difficult to determine what might happen in an asynchronous call. The call could deadlock, crash, or give an invalid answer. .NET Framework version 2.0 introduced some simple checks to help you avoid this problem. In .NET Framework 2.0, if you call an unsafe `ICorProfilerInfo` function asynchronously, it fails with an CORPROF_E_UNSUPPORTED_CALL_SEQUENCE HRESULT.
2931

3032
In general, asynchronous calls are not safe. However, the following methods are safe and specifically support asynchronous calls:
3133

@@ -61,7 +63,7 @@ The CORPROF_E_UNSUPPORTED_CALL_SEQUENCE HRESULT was introduced in the .NET Frame
6163

6264
- [DoStackSnapshot](../../../../docs/framework/unmanaged-api/profiling/icorprofilerinfo2-dostacksnapshot-method.md)
6365

64-
For additional information, see the entry [Why we have CORPROF_E_UNSUPPORTED_CALL_SEQUENCE](https://docs.microsoft.com/archive/blogs/davbr/why-we-have-corprof_e_unsupported_call_sequence) in the CLR Profiling API blog.
66+
For more information, see the entry [Why we have CORPROF_E_UNSUPPORTED_CALL_SEQUENCE](https://docs.microsoft.com/archive/blogs/davbr/why-we-have-corprof_e_unsupported_call_sequence) in the CLR Profiling API blog.
6567

6668
## Triggering Garbage Collections
6769
This scenario involves a profiler that is running inside a callback method (for example, one of the `ICorProfilerCallback` methods) that forbids garbage collection. If the profiler tries to call an informational method (for example, a method on the `ICorProfilerInfo` interface) that might trigger a garbage collection, the informational method fails with a CORPROF_E_UNSUPPORTED_CALL_SEQUENCE HRESULT.

docs/framework/wcf/feature-details/adding-a-service-reference-in-a-workflow-solution.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ title: "Adding a Service Reference in a Workflow Solution"
33
ms.date: "03/30/2017"
44
ms.assetid: 83574cf3-9803-49bc-837f-432936dc9c76
55
---
6-
# Adding a Service Reference in a Workflow Solution
6+
# Add a Service Reference in a Workflow Solution
77

8-
Adding a service reference in a workflow application works a little differently than a regular WCF application. When you select **Add > Service Reference** and specify the URL to the service, the metadata is downloaded and custom activities are generated that allow you to call the WCF service or WCF workflow service you added a reference to. After adding a service reference, rebuild the solution so the generated activities are built. They will then appear in the workflow designer toolbox. Note however, that this will only work if you are adding a service reference within a workflow solution. The following web cast shows how to add a service reference in other types of projects: [Calling a WCF Service from a Workflow in a Web Project](https://docs.microsoft.com/archive/blogs/endpoint/how-to-consume-a-wcf-service-from-a-wf4-workflow).
8+
Adding a service reference in a workflow application works a little differently than a regular WCF application. When you select **Add** > **Service Reference** and specify the URL to the service, the metadata is downloaded and custom activities are generated that allow you to call that WCF service or WCF workflow service. After adding a service reference, rebuild the solution so the generated activities are built. They will then appear in the workflow designer toolbox. This will only work if you are adding a service reference within a workflow solution. The following web cast shows how to add a service reference in other types of projects: [Calling a WCF Service from a Workflow in a Web Project](https://docs.microsoft.com/archive/blogs/endpoint/how-to-consume-a-wcf-service-from-a-wf4-workflow).
99

10-
Adding two or more service references to services that contain the same operation name will cause a problem. The generated activities will call only the first service operation. To work around this issue rename the service operations so they are different or change the endpoint configuration name within each generated activity.
10+
Adding two or more service references to services that contain the same operation name will cause a problem. The generated activities will call only the first service operation. To work around this issue, rename the service operations so they are different, or change the endpoint configuration name within each generated activity.
1111

1212
## See also
1313

docs/framework/wcf/feature-details/adopting-wcf.md

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -3,17 +3,17 @@ title: "Adopting Windows Communication Foundation"
33
ms.date: "03/30/2017"
44
ms.assetid: 49ba71e2-9468-4082-84c5-cf8daf95e34a
55
---
6-
# Adopting Windows Communication Foundation
6+
# Adopt Windows Communication Foundation
77

8-
You can choose to use Windows Communication Foundation (WCF) for new development, while continuing to maintain existing applications developed using ASP.NET. Because WCF is intended to be the most suitable choice for facilitating communication with applications built with the .NET Framework in any scenario, it can serve as a standard tool for solving a wide variety of software communications problems in a way that ASP.NET cannot.
8+
You can choose to use Windows Communication Foundation (WCF) for new development while continuing to maintain existing applications developed using ASP.NET. Because WCF is intended to be the most suitable choice for facilitating communication with applications built with the .NET Framework in any scenario, it can serve as a standard tool for solving a wide variety of software communications problems in a way that ASP.NET cannot.
99

1010
New WCF applications can be deployed on the same machines as existing ASP.NET Web services. If the existing ASP.NET Web services use a version of the .NET Framework prior to version 2.0, then you can use the ASP.NET IIS Registration Tool to selectively deploy the .NET Framework 2.0 to IIS applications in which new WCF applications are to be hosted. That tool is documented at [ASP.NET IIS Registration Tool (Aspnet_regiis.exe)](https://docs.microsoft.com/previous-versions/dotnet/netframework-3.5/k6h9cz8h(v=vs.90)), and has a user interface built into the IIS 6.0 management console.
1111

1212
WCF can be used to add new features to existing ASP.NET Web services by adding WCF services configured to run in ASP.NET compatibility mode to existing ASP.NET Web service applications in IIS. Because of ASP.NET compatibility mode, the code for the new WCF services can access and update the same application state information as the pre-existing ASP.NET code, by using the <xref:System.Web.HttpContext> class. The applications can also share the same class libraries.
1313

14-
WCF clients can use ASP.NET Web services. WCF services that are configured with the <xref:System.ServiceModel.BasicHttpBinding> can be used by ASP.NET Web service clients. ASP.NET Web services can co-exist with WCF applications, and WCF can even be used to add features to existing ASP.NET Web services. Given all of these ways in which WCF and ASP.NET Web services can be used together, you may want to migrate ASP.NET Web services to WCF only if you require features that are provided by WCF and not ASP.NET Web services.
14+
WCF clients can use ASP.NET Web services. WCF services that are configured with the <xref:System.ServiceModel.BasicHttpBinding> can be used by ASP.NET Web service clients. ASP.NET Web services can coexist with WCF applications, and WCF can even be used to add features to existing ASP.NET Web services. Given all of these ways in which WCF and ASP.NET Web services can be used together, you may want to migrate ASP.NET Web services to WCF only if you require features that are provided by WCF and not ASP.NET Web services.
1515

16-
Even in the few cases where it is necessary, migrating code from one technology to another is seldom the correct approach. The reason for adopting the new technology is to meet new requirements that cannot be met with the earlier technology, and in that case, the correct thing to do is to design a new solution to meet the newly-expanded set of requirements. The new design benefits from your experience with the existing system and from wisdom gained since that system was designed. The new design can also use the full capabilities of the new technologies rather than reproducing the old design on the new platform. After prototyping key elements of the new design, it becomes easier to re-use code from the existing system within the new one.
16+
Even in the few cases where it is necessary, migrating code from one technology to another is seldom the correct approach. The reason for adopting the new technology is to meet new requirements that cannot be met with the earlier technology, and in that case, the correct thing to do is to design a new solution to meet the newly expanded set of requirements. The new design benefits from your experience with the existing system and from wisdom gained since that system was designed. The new design can also use the full capabilities of the new technologies rather than reproducing the old design on the new platform. After prototyping key elements of the new design, it becomes easier to reuse code from the existing system within the new one.
1717

1818
## See also
1919

0 commit comments

Comments
 (0)