.NET / C#

.NET / C#

I love programming in .NET / C#. Have been doing it since 2004 now. Much has changed since: the .Net framework is got more libraries, NuGet was a game-changer and even C# itself is evolving with lambda and dynamic.

And now .Net has evolved to Standard and Core with support for other platforms like Linux / Docker. Things are getting easier and faster.

How to add dynamic compilation to your C# projects?
How to add dynamic compilation to your C# projects?
.NET / C#, .NET Framework / C#, KeesTalksTech Utility Pack, OSS

How to add dynamic compilation to your C# projects?

Dynamic compilation is an awesome feature to add to your projects. Especially frameworks will benefit from the compilation of dynamic expressions and scripts. There are two main ways of doing it: the Code DOM Compiler or the Roslyn project. In this blog I will show how to implement them both.

Auto fill settings objects with .config values
Auto fill settings objects with .config values
.NET Framework / C#, KeesTalksTech Utility Pack

Auto fill settings objects with .config values

Lately I’ve been playing around with some API’s. Most of them need a bunch of settings that I’m storing them in my config files. I found myself doing the same work over and over again: creating a settings class, filling the class with information and using it. So I came up with a way to leverage reflection to fill my setting classes with .config values.

How to scrape a photo from a Twitter Photo URL with C#
How to scrape a photo from a Twitter Photo URL with C#
.NET Framework / C#, Regular Expression, Twitter

How to scrape a photo from a Twitter Photo URL with C#

Twitter uses its url shortener to place photo’s in Tweets. I’ve tried processing these URLs in the browser, but cross site scripting measures prevented me from processing the result with jQuery.

I decided to resolve it in C# (as I’m using ASP.Net). The following script leverages a WebClient and a regular expression to extract the photo URL from the shortened URL. This code could be added to a handler or a webservice that can be called from script.