Developing and Distributing Tools with DNX, DNU and NuGet

npm install -g for .NET? it’s here! There is a (somewhat) hidden gem in the new .NET world with DNVM, DNX and DNU - creating and distributing global tools with ease. Global meaning the application is always available through one or more commands in the command prompt (basically being registered in the PATH system variable). In the Node.js community this has been a central part, allowing you to install useful tools using the Node Package Manager. “Secret Manager”, part of ASP.NET 5, is an example of such a tool in the .NET world - but it is also one of the only examples currently available. Here is how simple it is to get started with it: ...

November 7, 2015 · Jeppe Lund Andersen

ASP.NET Web API Request Throttling with Redis Cache

When developing API’s for external parties to consume, sometimes the need for request throttling becomes relevant. In this article you’ll see a simple approach to create such a middleware component for Web API in ASP.NET 5, based on Redis. You can browse or download the complete sample on GitHub at: https://github.com/jlandersen/web-api-redis-request-throttling. Considerations The general case usually is that you have identifiable consumers of your API. The consumers are usually identified based on an access key (or something equivalent) supplied with each request. Since you will have to check each incoming request up against a history of previous requests, the mechanism should almost always be implemented using in-memory caching or a dedicated caching system, such as memcached or Redis. Before implementing a request throttling mechanism in your API, that rates each of these consumers individually, you should consider how ambitious the mechanism should be. You can choose from a wide range of different parameters to base the rating on. Some examples are: ...

August 16, 2015 · Jeppe Lund Andersen

Async Camera Pictures with Xamarin Forms

I have seen different approaches to using the device camera with Xamarin Forms. Here’s an example of how this might be implemented, with an async interface for easy async-await consumption in the shared Xamarin Forms part of the application. I will show the implementation details of the shared code and iOS version. The full example is available on https://github.com/jlandersen/xamarin-forms-camera that includes Windows Phone and Android parts as well. If you are unfamiliar with accessing native features of the different platforms, check out the official documentation. ...

June 18, 2015 · Jeppe Lund Andersen

ASP.NET 5 with Gulp and Bower From an Empty Solution

ASP.NET 5 is on it’s way which will level the playing field a bit in comparison with other web stacks, primarily enabled through the integration of Node.js with Visual Studio. Exciting times indeed! In the project templates provided with the currently available Visual Studio 2015 CTP, the “non-empty” projects are configured with Grunt and Bower. In this post I will walk through setting up an empty solution with Bower and Gulp, an alternative to Grunt. The goal is to demonstrate how all the new possibilities are actually wired up in an ASP.NET 5 solution and show how you might replace Grunt with Gulp as task runner instead. ...

April 10, 2015 · admin

Multitenancy with Subdomains in ASP.NET MVC 5

Developing a product that is multi-tenant is a pretty interesting challenge. Recently I was in the fortunate situation of having to work on such a thing. By giving organisations access to a tenant through a subdomain of choice is a pretty neat approach that provides users a sense of personal ownership of the product. In this post I will show a simple approach of how to use subdomains to identify the corresponding tenant in ASP.NET MVC 5. ...

February 12, 2015 · admin

Xamarin Forms - Customizing Tabbed Page Header and Title on Windows Phone

In this post I will show how to customize the title and header section of the Tabbed Page control, when running on Windows Phone. On WP this is the pivot control being used, which is quite different from the tabs used on both iOS and Android. Let’s say you wish to just change the font or completely restyle the title or the header showing the sections. You can create the complete page as a native Windows Phone XAML page with a pivot control and let that render. This gives complete control of the page and the pivot control, but makes the sacrifice of reducing how much code is shared. ...

December 10, 2014 · admin

Dynamics CRM 2011/2013 - Re-register Plugin Assembly With New Strong Name Key

All CRM plugins must be signed with a strong key in order to be deployed (both for letting Dynamics CRM be able to handle assembly naming conflicts and if you deploy it to the GAC on the server). I have come across a couple of projects where the password for the strong name key file was stuck in the head of another person – and later forgotten – making it troublesome set up a new development machine to build and deploy a solution. ...

June 26, 2014 · admin

Custom pushpin icon for Windows Store Apps with Bing Maps and C#

While the Bing Maps SDK is out of Release Preview and made final along with the release of Windows 8, i find that the documentation is still lacking quite a bit. Here is a couple of examples of how you can customize the pushpin control by changing the displayed image overlay, without having to implement a seperate Control. Custom icon for pushpin using XAML and C# Add the following to the resources (e.g. in your XAML for the Page containing the Bing Maps Control): ...

November 4, 2012 · admin

ABAP Reflection - Part One (The RTTS and Type Introspection)

Reflection provides the ability to examine, modify and create data types and behaviour at runtime. Developers of C# (or Java) not familiar with this concept, have most likely encountered it at some point, or even used it, through the .NET or Java reflection library. Have you ever used the typeof operator or invoked the GetType() methods in C#? Then you have already encountered it first hand. Recently I found the need for reflection in ABAP, all the way from type inspection to creation of new data types at runtime, which I found to be documented only very superficial. This (and the following) post is a result of my experiences working with reflection in ABAP. In this first post I will briefly introduce an overview of reflection in ABAP and how this can be used to inspect types at runtime. If you just want to get down with reflection in ABAP I suggest you skip the next section. ...

November 1, 2012 · admin

NetMeter tool

I have always been using a small tool to monitor my network usage for various reasons, but recently my favourite decided to take the step away from being a free tool. Instead of tracking down another, I decided to use this opportunity to start a new project of my own, and use it as an opportunity to take a look at WPF for the first time. Currently it simply displays your network usage, but should only be considered an appetizer in its current state – I got some ideas lined up to give this some more sweet features! ...

January 13, 2010 · admin