OmniSharp Canada Tour 2016
FormatFilter and MediaTypeMappings in ASP.NET Core 1.0 MVC
In the earlier posts, we looked at how formatters work in general in the upcoming MVC Core 1.0 (although at that time it was still being referred to as MVC 6) and how XML formatters can be enabled in your ASP.NET Core application.
This time around, I thought it would be interesting to follow up on that, and discuss another topic that should be very familiar to folks with ASP.NET Web API experience - MediaTypeMappings. They were quite commonly used in Web API, and they have been ported over to MVC Core, and can be enabled via a FormatFilter.
Re-using external view components in ASP.NET 5 & ASP.NET MVC 6
The other day we [explored using view components in ASP.NET 5][1] - as a very nifty replacement for the old MVC ChildActions. View components allow you to package a piece of functionality into a reusable class, along with an accompanying view, that can be invoke from any other view on demand.
Today let’s take this a step further - and let’s see how you can configure ASP.NET MVC 6, to be able to consume view components not just from the current web project but from external sources - external assemblies too. This way you will be able to share and distribute your view components across multiple projects. This is definitely useful for anyone who has - for example - ever worked on a portal-style applications, where building reusable components is one of the most important development activities.
Running ASP.NET 5 website on IIS
As ASP.NET 5 hit RC1 about a month go, more and more folks are looking at production deployments and other real life use cases of it. Going beyond demoware and experiments, to real applications, inevitably leads to thinking about hosting it somewhere - which, if your environment is Windows, most likely means IIS.
I have recently gone through quite some trouble getting it all to work, so I thought it might be useful to document and highlight some of the steps, which hopefully will save a bit of your time.
Adding C# Scripting to Your Development Arsenal
Running C# scripts and snippets in Visual Studio Code with scriptcs
Recently Microsoft open sourced the Code editor and I think a lot of people would agree that it’s really awesome. The UI based on Electron and the Monaco editor previously used in Visual Studio Online is really snappy and works great.
Visual Studio Code can also now be extended via plugins - and when that was announced, I thought why not make something for scriptcs? There already is a scriptcs plugin for Sublime Text and for Atom, so it only makes sense to have one for Visual Studio Code.
Localized routes with ASP.NET 5 and MVC 6
In my Web API book, in one of the chapters (source here), I’m discussing an in interesting approach towards route localization, using attribute routing.
The whole idea came from the fact that at some point in the past I used to work on a really large application - 70+ language versions, all of which required localizations on the route level.
That approach allowed you to define a single attribute route at action level (as opposed to, well, 70+ routes), and have it auto-translated by the plugged in infrastructure, as long as you provide the mapping to other languages at application startup.
Let’s have a look at how same type of functionality can be built in ASP.NET MVC 6.
Global route prefixes with attribute routing in ASP.NET 5 and MVC 6
In the last post a few days ago we looked at adding a centralized route prefix to attribute routing in ASP.NET Web API.
I got a couple of follow up question about how to achieve the same in ASP.NET 5 and MVC 6 framework. Let’s have a look then (btw: this article is written using beta8 version of ASP.NET 5).
Global route prefixes with attribute routing in ASP.NET Web API
As you may have learnt from some of the older posts, I am a big fan, and a big proponent of attribute routing in ASP.NET Web API.
One of the things that is missing out of the box in Web API’s implementation of attribute routing, is the ability to define global prefixes (i.e. a global “api” that would be prepended to every route) - that would allow you to avoid repeating the same part of the URL over and over again on different resources. However, using the available extensibility points, you can provide that functionality yourself.
Let’s have a look.
Using Roslyn and unit tests to enforce coding guidelines and more
Last year, during a few of my Roslyn talks, I was presenting a cool idea of leveraging Roslyn in unit tests to enforce a certain style in code, and in general inspect the consistency of the code in various ways.
It’s a really powerful concept, and something I wanted to blog about, but of course forgot - until I was reminded of that yesterday on Twitter.
Let’s have a look.
About

Hi! I'm Filip W., a software architect from Zürich 🇨🇭. I like Toronto Maple Leafs 🇨🇦, Rancid and quantum computing. Oh, and I love the Lowlands 🏴.
You can find me on Github, on Mastodon and on Bluesky.

Recent Posts
- 2025/03/10, Running Phi models on iOS with Apple MLX Framework
- 2025/02/24, Strathweb Phi Engine - now with Phi-4 support
- 2025/02/14, ML-KLEM and ML-DSA Post-Quantum Cryptography in .NET
- 2025/01/17, Fine tuning Phi models with MLX
- 2024/12/20, Running Phi Inference in .NET Applications with Strathweb Phi Engine
Categories
- ai (20)
- ai search (5)
- apache cordova (1)
- asp.net 5 (17)
- asp.net core (47)
- asp.net mvc (35)
- asp.net mvc 6 (7)
- asp.net vnext (6)
- asp.net web api (96)
- astronomy (1)
- autogen (1)
- azure (22)
- azure service bus (1)
- azure-devops (1)
- benchmark dotnet (1)
- bing maps (1)
- blazor (2)
- c plus (2)
- c-sharp (156)
- cryptography (6)
- csharp (6)
- csharp 10 (2)
- dnx (3)
- dotnet-cli (2)
- dotnet-script (11)
- duende (4)
- editorconfig (1)
- entity framework (2)
- espn api (2)
- events (1)
- ffi (4)
- fsharp (1)
- git (1)
- glimpse (1)
- html5 (4)
- identity server (2)
- iis (2)
- il (1)
- intro to qc (19)
- ios (7)
- javascript (9)
- jquery (4)
- jquery mobile metro (1)
- katana (2)
- kindle (1)
- knockout.js (8)
- kotlin (2)
- last.fm api (2)
- linq (1)
- mac (3)
- macos (1)
- mathematica (1)
- msbuild (3)
- mvc core (3)
- nancy (2)
- native (1)
- net (144)
- net 5 (3)
- net 6 (5)
- net 7 (7)
- net 8 (3)
- net 9 (1)
- net core (49)
- net sdk (2)
- ninject (2)
- odata (4)
- oidc (2)
- omnisharp (13)
- openai (11)
- osx (2)
- owin (5)
- phi (8)
- php (1)
- python (1)
- q-sharp (36)
- qir (3)
- qiskit (1)
- quantum computing (41)
- roslyn (30)
- rust (6)
- scriptcs (11)
- scripting (9)
- security (9)
- servicestack (2)
- signalr (8)
- swift (9)
- testing (5)
- twitter boostrap (1)
- typescript (1)
- visual studio (4)
- visual studio code (11)
- wasi (3)
- wasm (3)
- windows phone 7 (1)
- wordpress (1)
- wpf (2)