You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The `~`, `&`, `|`, and `^` operatorsarealsosupportedbyany [enumeration](../builtin-types/enum.md) type. Foroperandsofthesameenumerationtype, alogicaloperationisperformedonthecorrespondingvaluesoftheunderlyingintegraltype. Forexample, 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.
Copy file name to clipboardExpand all lines: docs/csharp/programming-guide/classes-and-structs/static-constructors.md
+2-2Lines changed: 2 additions & 2 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -24,7 +24,7 @@ Static constructors have the following properties:
24
24
25
25
- The user has no control on when the static constructor is executed in the program.
26
26
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.
28
28
29
29
- 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).
30
30
@@ -42,7 +42,7 @@ Static constructors have the following properties:
42
42
- 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.
43
43
- Static constructors are also useful when creating wrapper classes for unmanaged code, when the constructor can call the `LoadLibrary` method.
44
44
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 compiletime via constraints (Type parameter constraints).
46
46
47
47
## Example
48
48
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.
Copy file name to clipboardExpand all lines: docs/framework/unmanaged-api/profiling/corprof-e-unsupported-call-sequence-hresult.md
+10-8Lines changed: 10 additions & 8 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -8,24 +8,26 @@ helpviewer_keywords:
8
8
ms.assetid: f2fc441f-d62e-4f72-a011-354ea13c8c59
9
9
---
10
10
# 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:
12
13
13
14
- 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.
14
15
15
16
- When a profiler tries to call an informational method that triggers garbage collection from a callback method that forbids garbage collection.
16
17
17
-
These two scenarios are discussed in the following sections.
18
+
These two scenarios are discussed in the following sections.
18
19
19
20
## 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.)
21
23
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.
23
25
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.
25
27
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.
27
29
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.
29
31
30
32
In general, asynchronous calls are not safe. However, the following methods are safe and specifically support asynchronous calls:
31
33
@@ -61,7 +63,7 @@ The CORPROF_E_UNSUPPORTED_CALL_SEQUENCE HRESULT was introduced in the .NET Frame
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.
65
67
66
68
## Triggering Garbage Collections
67
69
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.
Copy file name to clipboardExpand all lines: docs/framework/wcf/feature-details/adding-a-service-reference-in-a-workflow-solution.md
+3-3Lines changed: 3 additions & 3 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,11 +3,11 @@ title: "Adding a Service Reference in a Workflow Solution"
3
3
ms.date: "03/30/2017"
4
4
ms.assetid: 83574cf3-9803-49bc-837f-432936dc9c76
5
5
---
6
-
# Adding a Service Reference in a Workflow Solution
6
+
# Add a Service Reference in a Workflow Solution
7
7
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).
9
9
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.
Copy file name to clipboardExpand all lines: docs/framework/wcf/feature-details/adopting-wcf.md
+4-4Lines changed: 4 additions & 4 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -3,17 +3,17 @@ title: "Adopting Windows Communication Foundation"
3
3
ms.date: "03/30/2017"
4
4
ms.assetid: 49ba71e2-9468-4082-84c5-cf8daf95e34a
5
5
---
6
-
# Adopting Windows Communication Foundation
6
+
# Adopt Windows Communication Foundation
7
7
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.
9
9
10
10
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.
11
11
12
12
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.
13
13
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.
15
15
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 newlyexpanded 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.
0 commit comments