Exception Filters

I have been coding VB.NET for about seven years now and it still keeps surprising me with its features that are missing from C#. Today I stumbled upon exception filters.

Exception filters are way to restrict catch blocks with conditions.
        Catch ex As Exception When DateTime.Now.DayOfWeek = DayOfWeek.Monday
            MessageBox.Show("Exceptions are caught on mondays!")
        End Try
Exceptions filters are created with When -keyword and condition is specified after it.
This leads us to proper use case.

Catching multiple exceptions in one catch block

    Private Sub SomeMethod()
        Catch argException As ArgumentException
        Catch invalidCastException As InvalidCastException
        End Try
    End Sub

    Private Sub MethodThatWillCrash()
        Throw New ArgumentException()
    End Sub
This code will not show messagebox when code is run, because ArgumentException catch block is empty. We could fix it by changing the catch block to check exception type:
        Catch generalException As Exception
            If TypeOf generalException Is ArgumentException OrElse TypeOf generalException Is InvalidCastException Then
            End If
        End Try
But the Else statement is dull and catch statement is kind of unclear to read because it catches all exceptions.
        Catch generalException As Exception When _
            TypeOf generalException Is ArgumentException OrElse
            TypeOf generalException Is InvalidCastException
        End Try
With When -keyword we can specify types of exception to catch. Neat!

Exception filters posses great strengths, but beware, they can cause some unexpected behaviors: https://blogs.msdn.microsoft.com/dotnet/2009/08/25/the-good-and-the-bad-of-exception-filters/

Btw. exception filters are coming also to C# 6!

Top software developer podcasts

I spend around 40 minutes everyday at listening software development podcasts. They are great way to learn new technologies and easy way to keep track of latest trends. Currently I use the iPhone default podcast player and its good enough for me, on Windows Phone I used i Podcast alot and it was great also.

These are my favorite podcasts in a field of software development:

1. .NET Rocks

.NET rocks is a one of the longest running .NET podcasts. Episodes are well produced and there ain't too much of commercials in show. Guests are top of the line and hosts are doing good job asking interesting questions around the topic. Only minus is that hosts rarely challenge their guests to defend their opinion or to give a good argument why their 40302. Javascript framework is the best in the world. New shows appears more than once a week which is a nice thing for active listeners.

2. The Web platform podcast

Web platform podcast currently runs at 100. episode. Topics varies from Javascript frameworks into latest Microsoft Explorer version. Podcast has great hosts and topics are usually interesting and trending at the moment. New shows appears almost every week. 

3. Javascript Jabber

Javascript Jabber is a well produced podcast which runs new episode once a week. Hosts have a good knowledge of web development (well maybe not Amy, but the others atleast!) and topics are usually well picked. Shows are quite ploated from commercials, but they are bearable.

4. Herding Code 

Herding Code topics are really interesting. For example latest episode (#217) guest was Nick Craver from StackExchange and he presented technologies and numbers behind the StackExchange. Bad thing about Herding Code is that they don't provide that many shows in a year. Currently there is only three shows released in 2016.
(Don't go to their web site, it's hacked).

5. Coding Blocks

My fifth choice is Coding Blocks. Coding Blocks is relatively new podcast (first show in 2013 and latest episode is 44.). Episodes are usually around two hours, so they are quite long compared to other software podcasts. Shows contains lot of chit-chat, so they could be easily fit into 1h, if you would pick-up only important parts. Topics are broad and there ain't any guests in shows which is refreshing. 

Current state of .NET

In recent months Microsoft has announced dozens of new versions and names into it's development ecosystem. For a regular developer it's hard to keep track of all these announcements. That's why I made a short list of current state of .NET versions.


Latest .NET version is 4.6.1. Windows 10 has 4.6 pre-installed, and 4.6.1 after November update. There is a beta version of .NET 5 and its called .NET Core 5.


ASP.NET versioning is a mess. Latest ASP.NET version is a 4.6 which was released in July 20. There is a new version "5.0", which is in beta. ASP.NET 5.0 is also now called as ASP.NET CORE 1.0.

Check ASP.NET Core roadmap for more info about release date


Current ASP.NET MVC version is 5.2.3 and there is a release candidate for 6.0.  The MVC version consist the view-model-controller pattern implementation.


Current ASP.NET Web Api version is 2.2.

ASP.NET Core will simplify Web Api and MVC versioning by bringing them all under one version number.


C# is currently running at version 6.0 and there is a proposal for version 7.0.
Latest VB.NET version is called 14 and it was released along with Visual Studio 2015.


Table of versions

Product Current version Upcoming version
ASP.NET4.6Core 1.0
MVC5.2.36.0?/Core 1.0
Web API2.2 (5.2.3.)?/Core 1.0

Image from Business vector designed by Freepik

Seven cool things about the Visual Studio Code

#1 Command Palette

Command Palette is a new thing for Visual Studio users. It gives access to everything inside VSC. Command Palette is activated by pressing F1 and then typing desired keyword. There are few tricks to enpower Command Palette usage.
?  gives a list of available commands
: + line number  navigates to given line
!  shows errors and warnings
# + name  Open symbol by name.

#2 Extensions and built-in installer

There are quite nice amount of extensions available for VSC. There is an extension for Angular, C#, TypeScript and so on. Nice thing about these extensions is that you can install them directly from VSC by pressing F1 and typing "ext install".

#3 Intellisense

Visual Studio has very good intellisense, but so does VSC. It keeps suprising me all the time what it can do. It knows my json files, crawls through my code files and suggests me new things that I didn't know to exists.

#4 Open VSC easily from current folder

Visual Studio Code can be easily opened from current folder by typing "code ." Could it be simpler than that anymore?

code .

#5 Debugger

VSC has a debugger for Node.js (JS and TypeScript) and it's very easy to use. Just launch debugger, accept launch.json file creation and debug. If your main method is not in a file called app.js, change proper main filename into launch.json.

#6 Auto-update

Upgrading to the latest version is really easy. Approx once a month application will ask user to update. Clicking "Update Now", will download latest version, install it and restart app into latest build.

#7 Cross-platform

VSC is fully cross-platform and you can edit code from Mac, Linux or Windows. VSC doesn't restrict development machine anymore into one platform, which is a good thing in a long run.

Rider - Candy for .NET

Rider is new .NET IDE from Jetbrains. Jetbrains is the organization behind popular Visual Studio add-in ReSharper and Web IDE WebStorm, so own .NET IDE was kind of long waited product. .NET-community is used Visual Studio from dawn, but I think the time is ready for new IDE options also. Rider is currently in closed beta and can be optained only by invitation, but there is very good reason for that.

First launch

When Rider is launched first time it asks series of questions like "Do you want to use white or dark theme?" and "Do you want to use Visual Studio, Resharper or IntelJ key bindings". Settings can be changed later from File > Settings menu.

Main view

First impression

If I had to describe Rider UI with three words. Those would be: Menu, colorful and common. UI is more simpler than Visual Studio, however when first menu is opened from top menu, or when right click is used, the feeling changes quickly towards complexity of Visual Studio. Right click menus have lots of options and top menu is filled with tools and settings.

Visual Studio like menus
Default coloring differs from Visual Studio quite a bit. For example variables are colored in pink (in dark theme goddamn!) and method names are bright cyan. Very lively for dark theme. Coloring reminds me about the first appearance of Windows XP (oh the candy).

Lively and lovely

Feature rich

Rider has impressive amount of features, which mostly are familiar from Visual Studio.
For example actions can contain multiple key bindings, new items can be added simply by right clicking over folder and there are even VCS tools integrated into IDE.


Why there has to be always a but...
Rider is still in beta, which means that it still lacks critical features. For example there is no way to add references, debug .NET code (IIS/WPF/UWP) or run unit tests. These are features which must be implemented well, before Visual Studio can be overthrown from throne.

No summary support


Rider has lots of good features which makes it unique as it tries to stand-up from the shadows of Visual Studio. Like when folders are opened in solution tree, if the sub folders contains only one item, they are automatically opened. Rider also contains ReSharper features like "Find Symbol", which is now called Search Everywhere. Ctrl+Shit+Up/Down moves the whole code block up and down in logical level and so on.


Rider is not ready. It's not even close to ready, but it's on a good route! However there are black clouds hanging over its bright future. Visual Studio Code is surely bringing support for C#. One could say that Visual Studio Code doesn't have all the features that Rider has,  but then we step into Visual Studios territory. Rider has to find it's own place between Visual Studio and Visual Studio Code. That's not an easy task. Few key features in Rider may raise it into a new level, where it will be noticed. Features like good multi-monitor support and integrated CI tools (for TeamCity).

Project Rider web site

Edit ASP.NET Web API project with Visual Studio Code

I have been using Visual Studio Code (VSC) in web development for a while and I love its speed, expandability and general design. Today I got an idea, which felt like a lightning strike (not literally, but figuratively). Could I use VSC in my big .NET projects? Lets find out!

I'm currently working with a quite big Web API project. Solution contains multiple projects, Nuget packages, automated tests and so on. I use Postman to test app, so I don't need a Visual Studio to test app. I'm also using IIS to host app, so I don't need IIS Express to run app. Only thing I will lack in VSC is a debugger. That is of course a huge thing, but maybe I can use Visual Studio to debug app and VSC in main coding?

Setup for test run

VSC use PATH environment variable to resolve msbuild path. So first I need add msbuild path into PATH variable. I have regular Windows machine so correct path is C:\Windows\Microsoft.NET\Framework\v4.0.30319

MSBuild in task.json

Then I launch VSC and open project folder. Cool, it took only few seconds to load whole folder. Compared to Visual Studios 15 seconds that is fast. Then press Ctrl+Shift+B to build and vola! Oh, no vola. No task runner configured. Well lets configure one then. Comment TypeScript out because I'm not interested from that now... and uncomment msbuild. Ctrl+Shift+B again to build. Lots of build messages appears into console.

Restoring Nuget packages...
All packages listed in packages.config are already installed.

and vola! Well almost. Time elapsed 17 seconds and 4 error(s).

I have four times error "MSB4019". Put that error code on Stack Overflow and found out following:
It is due to Vs2012 adding in csproj file this part:
    <VisualStudioVersion Condition="'$(VisualStudioVersion)' == ''">10.0</VisualStudioVersion>
    <VSToolsPath Condition="'$(VSToolsPath)' == ''">$(MSBuildExtensionsPath32)\Microsoft\VisualStudio\v$(VisualStudioVersion)</VSToolsPath>
You can safely remove that part and your solution will build.
Well lets get rid of that nuisance and try again. Note: Its easy to edit project files by just ctrl+clicking the path given in error message. Property group is found from main project. Let's remove it and try again.

    0 Error(s)
Time Elapsed 00:00:17.43

Cheers! I'm up and running.

Well let's test few things next:
I make a little change into code, build, test with Postman and everything seems to work. This seems to go too well. Next let's try to make a little bit bigger change which includes call into another project.

error BC30002: Type 'Customer' is not defined.

Yes I need to add reference, but there is no way to add it. I have to do it manually or use Visual Studio to add it for me. I'm also lacking import/using statement for projects namespace and VSC don't know how to do that. That is also manual labor.


So what are the benefits and drawbacks of using VSC to edit WebAPI projects.
VSC use about 200 MB of memory with this project.
Visual Studio use 650 MB.

VSC builds project in 17 seconds.
Visual Studio build time depends on size of changes. Visual Studio can optimize build process much more than  msbuild does so it's almost every time faster than VSC.

Visual Studio supports ReSharper, but there is no confirmed timeline for VSC ReSharper plugin and VSC doesn't support nunit/mstest out of the box (those would be a very cool plugins btw.).

VSC don't know how to add references or using/import statements, so for that Visual Studio is still needed. It seems that VSC is suitable for small code editing, but Visual Studio is still king of the hill in WebAPI/MVC projects.

However VSC is good tool to edit project files, make small changes into code and to simply build whole solution quickly.

Eclipse Che and Codenvy

Eclipe Che is an open source "Cloud IDE" created by Codenvy (and currently owned by Eclipse Foundation). I put quotes around Cloud IDE because Eclipse Che can be installed also locally and run like old-school IDE. This is a huge difference to another solutions, which are usually restricted into cloud only.

Che requires Java 1.8 and a Docker host to run locally. There is a full installer available at Eclipse Che site. This installer includes Che, Java, Docker, Git Bash and Shortcuts. Very neat indeed.

The Che itself consist from multiple different parts like workspaces, docker machines and Cloud IDE, but in this post I'm going to focus on Cloud IDE part.

The Cloud IDE

Eclipse Che has its roots in Java world and that's clearly visible in IDE. The app itself looks like a stand-alone Java application and there is Java terms flying around the IDE. I'm frankly .NET guy and all these Java settings seems a little distracting to me. If you have a Java background, you will feel certainly're more at home with this IDE with

Very Java oriented
Java Swing anyone?

Basic features

The editor is build on top of Orion Cloud IDE. Editor contains all the basic features like code highlighting, code completion for multiple languages, code deployment and Subversion/Git tools. There are project templates for C++, Go, Javascript, Java, PHP, Python and Ruby. Che has plugin support so new languages are just matter of creating a plugin.

There are plugins for Angular, Grunt, Gulp, NPM, Yeoman and so forth. This is a good set of tools to run modern-day web development at cloud.


Where is my window layouting?

IDE has a tab system for windowing, but I couldn't find any way to set two tabs side-by-side. Double-clicking tab will hide all the other widgets and focus all screen area for clicked tab, but dragging tabs or right clicking them didn't give any option for layouting, not either did "Windows" menu.


Che is fast. I mean very fast. It feels faster than my Notepad. This is very important, because lag in typing can easily kill a good vibe in development.

Real-time warnings

Che gives real-time warnings and errors about Javascript (and other languages). Errors are shown on left side of editor and they have a tooltip which describes error. Like 'asdf is undefined. Missing semicolon.' Another cool, but also quite common feature.

Real-time warnings


Codenvy is a company that offers hosted version (and on-prem version) for Eclipse Che. Company's head office is at San Francisco and they are quite fresh company (founded in 2013).

Codenvy has three different kind of offering:
1) For individuals, students, and small teams, they offer SaaS model
2) For teams, devops, and organizations, they offer Codenvy On-Prem installation and support.
3) Codenvy On-Prem is also offered with hardware. I call this model as a turnkey model.

Pricing starts from Free version and ends into Enterprise SaaS which is priced at 60$/month per user (02/18/2016). Pricing is not around cheapest cloud IDE's, but if you get a good value for a money, then it is justified. The answer for that is more complicated.
For sixty dollars you will get this feature list:
- We provide the software, hardware, and admin
- Private, hosted installation of Codenvy On-Prem
- Available on Azure, AWS, or any other provider
- Premium support and SLAs
- Monitoring, alerts, and monthly software upgrades
- Extensible with custom plug-ins

Sounds like a good set of features to me.

Codenvy is currently only company offering Eclipse Che as a hosted service. So if you want to use Eclipse Che as SaaS model or get fully installed & configured on-prem environment, Codenvy is the right company for that.

The opinions expressed herein are my own personal opinions. I don't work for Codenvy or Eclipse Foundation.

If you have any experiences with Eclipse Che or Codenvy, please leave a comment!