Tracing mechanism in Windows Communication Foundation is based on the
classes that resides in System.Diagnostic namespace.Important classes are Trace,
TraceSource and TraceListener.
Following are the steps to enable tracing
in WCF:
1. Configuring WCF to emit tracing information/Define Trace Source,
we have the following options:
System.ServiceModel
System.ServiceModel.MessageLogging
System.ServiceModel.IdentityModel
System.ServiceModel.Activation
System.Runtime.Serialization
System.IO.Log
Cardspace
In configuration file, we will define a source to
enable this configuration as follows:
2. Setting Tracing Level, we have the
following available options, we need to set this tracing level to available
options other than default "Off":
Off
Critical
Error
Warning
Information
Verbose
ActivityTracing
All
In configuration file, we can choose above
values for switchValue attribute as follows:
switchValue=”Information”>
3. Configuring a trace listener
For configuring a trace listener, we will add
following to config file.
type="System.Diagnostics.XmlWriterTraceListener"
initializeData="d:\logs\messages.svclog"
/>
logEntireMessage: By default,
only the message header is logged but if we set it to true, entire message
including message header as well as body will be
logged. logMalformedMessages: this option log messages those
are rejected by WCF stack at any stage are known as malformed
messages. logMessagesAtServiceLevel: messages those are about
to enter or leave user code. logMessagesAtTransportLevel:
messages those are about to encode or decode. maxMessagesToLog:
maximum quota for messages. Default value is
10000. maxSizeOfMessageToLog: message size in bytes.
Putting all this together, configuration file
will appear like this.
Note: In this case, information will be
buffered and not published to file automatically, So, we can set the autoflush
property of the trace under sources as follows:
Simplex Data in a simplex channel is always one way.
Simplex channels are not often used because it is not possible to send back
error or control signals to the transmit end.
It's like a one way street. An example of simplex is Television,
or Radio. The simplex channel also corresponds directly to Shannon's model of communication discussed
earlier.
Half Duplex A half-duplex channel can send and
receive, but not at the same time. It's like a one-lane bridge where two way
traffic must give way in order to cross. Only one end transmits at a time, the
other end receives. In addition, it is possible to perform error detection and
request the sender to retransmit information that arrived corrupted. In some
aspects, you can think of Internet surfing as
being half-duplex, as a user issues a request for a web document, then that
document is downloaded and displayed before the user issues another request.
Another example of half-duplex is talk-back radio, and CB Radio
(Citizens Band). You might have seen movies where truckies (drivers of very big
trucks) communicate to each other, and when they want the other person to speak
they say "over". This is because only one person can talk at a
time.
Full Duplex Data can travel in both directions
simultaneously. There is no need to switch from transmit to receive mode like in
half duplex. Its like a two lane bridge on a two-lane highway. Have you ever
watched these television talk shows where the host has a number of people on the
show, and they all try to talk at once. Well, that's full duplex!
Visual Studio WITH C# KEY BINDINGS
To answer the specific question, in C# you are likely to be using the C# keyboard mapping scheme, which will use these hotkeys by default:
Ctrl+E, Ctrl+D to format the entire document. Ctrl+E, Ctrl+F to format the selection.
You can change these in Tools > Options > Environment -> Keyboard (either by selecting a different "keyboard mapping scheme", or binding individual keys to the commands "Edit.FormatDocument" and "Edit.FormatSelection").
If you have not chosen to use the C# keyboard mapping scheme, then you may find the key shortcuts are different. For example, if you are not using the C# bindings, the keys are likely to be:
Ctrl + K + D (Entire document) Ctrl + K + F (Selection only)
To find out which key bindings apply in YOUR copy of Visual Studio, look in the Edit > Advanced menu - the keys are displayed to the right of the menu items, so it's easy to discover what they are on your system.
I am glad to share my certification information “Microsoft® Certified
Professional Developer (MCPD) Web Developer 4” by providing
you with Transcript ID and Access Code.
I
have completed MCPD Web
Developer 4
Certification in this month.
You
can see complete list of Microsoft Certification till now I have completed on
below site using Transcript ID and Access Code.
To answer the specific question, in C# you are likely to be using the C# keyboard mapping scheme, which will use these hotkeys by default:
Ctrl+E, Ctrl+D to format the entire document. Ctrl+E, Ctrl+F to format the selection.
Ctrl + K + D (Entire document) Ctrl + K + F (Selection only)
resharper - Ctrl + Alt + F VS 2010 - Ctrl + K, Ctrl + D
You can change these in Tools > Options > Environment -> Keyboard (either by selecting a different "keyboard mapping scheme", or binding individual keys to the commands "Edit.FormatDocument" and "Edit.FormatSelection").
If you have not chosen to use the C# keyboard mapping scheme, then you may find the key shortcuts are different. For example, if you are not using the C# bindings, the keys are likely to be: Ctrl + K + D (Entire document) Ctrl + K + F (Selection only)
To find out which key bindings apply in YOUR copy of Visual Studio, look in the Edit > Advanced menu - the keys are displayed to the right of the menu items, so it's easy to discover what they are on your system.
These shortcuts (starting with Ctrl+E) are valid for Visual Studio 2005 and 2008 only. Use the shortcuts Ctrl+K+D and Ctrl+K+F to acchive the same in Visual Studio 2010 (if you are using the default configuration).
Yes, you can use the two-chord hotkey (Ctrl+K, Ctrl+F if you're using the General profile) to format your selection.
Other formatting options are under Edit » Advanced, and like all VS commands, you can set your own hotkey via Tools » Options » Environment » Keyboard (the format selection command is called Edit.FormatSelection).
Formatting doesn't do anything with blank lines, but it will indent your code according to some rules that are usually slightly off from what you probably want