Tag: csharp
All the articles with the tag "csharp".
-
Coding Standards document
A concise C# coding standards document with ReSharper configuration, covering access modifiers, var usage, and best practices.
-
Escaping Invalid XML Unicode characters
Step-by-step derivation of a C# regex to strip or escape characters invalid in XML, handling UTF-16 surrogate pairs correctly.
-
Stripping invalid characters from UTF-16 strings
C# regex approach to remove unpaired UTF-16 surrogate characters from strings to ensure valid Unicode output.
-
The best debugging technique - inverse breakpoint
Using Debugger.Launch and Debugger.Break in C# code to attach a debugger to hard-to-reach processes like Visual Studio plugins.
-
C__PowerShell Clipboard Watcher
Implements a clipboard change watcher in PowerShell using inline C# with P/Invoke and WinForms WM_CLIPBOARDUPDATE.
-
WTF Method overloads resolution in PowerShell
PowerShell resolves .NET method overloads differently from C#, causing unexpected method calls with bool arguments.
-
Indent styles holy wars
Discussion of Allman vs K&R brace styles across C#, JavaScript, CSS, and PowerShell.
-
obj.ToString(), nulls and ReSharper
ReSharper incorrectly marks ToString() as non-nullable, but BCL types like HtmlString can return null.
-
WCF _ useless ProtocolException
WCF ProtocolException truncates the server error response; an extension method on WebException extracts the full response body.
-
T4 Design-Time templates base class
How to create a shared custom base class for T4 design-time templates by extending TextTransformation, with a working example.