Creating and publishing NuGet packages to VSTS feeds in Visual Studio

In this post I will show you a number of ways in which you can create and publish NuGet packages to your own feeds. But the focus will be on a new Visual Studio extension that I have written during my assignment for Dime, who were gracious enough to share this utility with the rest of the world.

Continue reading “Creating and publishing NuGet packages to VSTS feeds in Visual Studio”

Exam 70-487 Preparation: the review

Over the last few weeks, I made a few blog posts containing useful links for Microsoft’s certification exam 70-487: Developing Microsoft Azure and Web Services. I’m pleased to announce that I passed the exam with a score of 873. And because this is the third exam in the MCSD Web Applications track, I am now also a certified Microsoft Certified Solutions Developer.

Continue reading “Exam 70-487 Preparation: the review”

A repository of useful PowerShell scripts

I have had to generate a lot of new files lately, and because I am allergic to repetitive work, I looked for a way to dynamically generate and process files. And for my case, PowerShell scripting comes pretty close to what I needed. Just like a few of my other posts (the best of StackOverflow and Things I always have to Google, I decided it would be a good idea to centralize these scripts and share them with you. Most of these scripts were made for one specific case so they’re not generic – but upon request I’ll try to make these as generic as possible. This is going to be a post that I’ll hope to update on regular occasions, so make sure to pay a visit every now and then if you’re working with PowerShell too.

Continue reading “A repository of useful PowerShell scripts”

ASP.NET MVC and HTML5 Web Workers

Although the technology has been around for a while now, HTML5 Web Workers didn’t draw my attention until a few days ago. As I’m building a client facing SaaS application for my client, performance is crucial. Having worked with asynchronous methods in C# for years, I thought of using this concept in JavaScript. As it turns out, multithreading in Javascript isn’t really part of the package. You had to work with timeouts and callbacks to implement some kind of asynchronous architecture, but splitting some heavy work into multiple threads (and even background work for that matter) wasn’t really supported out of the box – until HTML5 Web Workers were introduced. In this article, I’ll explore the capabilities in two different ways in the context of a ASP.NET MVC 5 application. What I’m not going to cover is the theoretical aspects of web workers.

Continue reading “ASP.NET MVC and HTML5 Web Workers”

Best of Stack Overflow

Just as in my other post about topics I have to “re-Google” often, this post serves as a catalog of interesting Stack Overflow articles. Because the concept of browser favorites doesn’t work quite well in my world, this blog post does the job of keeping a simple and convenient list very well. To keep things as simple as possible, I have divided the post in categories, comparable to the tags in Stack Overflow. One thing I’ve noticed is the amount of JavaScript articles, which is a bit surprising since I’m rather a back-end kind of a guy.

Continue reading “Best of Stack Overflow”

Create lambda expressions on the fly in C#

For the last couple of weeks I have been working with client-side frameworks such as Kendo UI and Sencha ExtJS a lot. One of the requirements of my clients was server-side filtering, grouping and ordering of several grids and other components. The challenge here is that you don’t know exactly what information might be coming in: which field do you have to filter or sort, which direction, what operator do you have to use, etc. There is only one proper way to do this in C#: Expressions.

Continue reading “Create lambda expressions on the fly in C#”

New features in C# 6.0

With the release of Visual Studio 2015 last week, I thought it would be a good time to inspect the new features that come with the newest version of C#. Although C# 6.0 is certainly not a major release from a developer’s perspective, there are some items that every developer will use in the coming years. In this post, I’ll show some examples on how to use these new features.

Continue reading “New features in C# 6.0”

How to automatically load navigation properties in Entity Framework

Anyone who has worked with Entity Framework will have had to manage with loading related entities. I believe many developers will agree the way that system works is difficult to reconcile with design patterns such as the Repository pattern. In this post, I’ll provide one quick and easy way to automatically load all related properties from the database.

Continue reading “How to automatically load navigation properties in Entity Framework”

ASP.NET MVC fixing error ‘Multiple types were found that match the controller named’ when routing is not the problem

I just came across following error message while I was converting one of my ASP.NET MVC applications:

Multiple types were found that match the controller named 'Home'. 

Continue reading “ASP.NET MVC fixing error ‘Multiple types were found that match the controller named’ when routing is not the problem”

How to prepare for Microsoft exam 70-483 programming in C#

Today I passed the 70-483 Programming in C# exam. As any other Microsoft exam, the passing score is 700 on a total score of 1000. I scored way above my expectations, so I’m very happy that my efforts are rewarded with a MCP certificate. I can highly recommended experienced consultants and developers to take this exam. For beginning programmers ( < 1 year) this exam will probably be too difficult as there are many topics in scope of the exam. In order to motivate anyone who wants to take this exam, here is how I experienced the exam.

Continue reading “How to prepare for Microsoft exam 70-483 programming in C#”

Managing shared information with IDisposable in C# and SharePoint

Every once in a while you’ll have a situation in which you temporarily have to use different (shared) settings and reset them if all work is done. An example of this is often seen in SharePoint, for instance disabling events when updating items in event receivers, or allowing unsafe updates. A workaround that I have seen a lot is that developers add a TRY/CATCH/FINAL block for each method they want to reset some objects. In this post, I’ll talk about an alternative way of achieving this behavior by the implementation if the IDisposable interface.

Continue reading “Managing shared information with IDisposable in C# and SharePoint”

Writing the output from console applications to text file

Console applications provide a quick and easy way (and also a little bit dirty) to test or fix parts of your application. It enables you to focus on the business logic rather than the GUI. Sometimes the output to the window is quite large – larger than the console window can show. In those cases you want to be able to persist the output to text files. In this post, I’ll show you how to do this.

Continue reading “Writing the output from console applications to text file”

Item-based exception handling in LINQ

Last week I rewrote some of my client’s code after having discovered a number of bugs. More specifically, a lot of errors came up in LINQ methods such as Where and Select. In order to capture what exactly was going wrong there, I have added a new extension method to the IEnumerable interface, allowing item-based exception handling on collections and LINQ statements.
Continue reading “Item-based exception handling in LINQ”

Developing timerjobs in C# with Quartz.NET

At some point, any developer will have to write some code that must be executed at regular intervals. In SharePoint for instance, timerjobs were (!) very easy to create. In .NET, you could choose between scheduled tasks and windows services. While I was doing research on the ideal replacement for timerjobs in the new SharePoint app model, I came across Quartz.NET. In this post, I will show you which code you need to create timerjobs.

Continue reading “Developing timerjobs in C# with Quartz.NET”

Replacing file extensions from uppercase to lowercase

Here’s a very simple utility that recursively finds uppercase file extensions and makes those who are lowercase. For once, it’s not written in C# but in good old DOS. If you paste this code in a CMD file, you’ll have a working program. If you execute this cmd, it will take the current folder as the root and it will process all files and subfolders.

Nowadays you would use PowerShell but this is a way to provide a quick fix to your users.