Posts

C# Logging using Trace and DebugView

Welcome to the first blog post of 2015. In this post I want to show you how the Trace class from .NET can help you debug an application (in production) as well as creating logs for you.

We start by creating a simple WPF project or if you prefer WinForms you can use that too. Add a simple button on it with a click event and add the following code to the click event handler.

Trace.WriteLine("Button clicked");

The Trace class is in the System.Diagnostics namespace, additional documentation can be found on MSDN.

Using the TypeScript language service in NodeJS

Update: This is actually an old post, TypeScript moved to GitHub.

This blog post is about using the TypeScript languageservice in Node.js. If you don’t know what TypeScript is you might want to look at the website first: TypeScript Homepage. In short, it is JavaScript with optional typeinfo and the language provides extra features like classes, modules and interfaces. After compiling the TypeScript files, plain JavaScript comes out which run everywhere (where JavaScript is supported).

Why would you want to use the languageservice, what are the possibilities? To answer this question it is easier to build TypeScript from source and look at the ILanguageService interface but some nice things you can do with it are: get autocompletion info, syntaxtree information, references. So basically you can add TypeScript support to an IDE (or build your own) with autocompletion, find all references support by using this languageservice.

subscribe via RSS