How to deploy a self contained .NET Core app.

in ASP.NET MVC
by Mahmut Jomaa on June 27, 2016
mnwall-separatormnwall-separator
Ok this blog post is rather a duplicate of the docs. However many people wrote me an e-mail because they simply didn't find it.   Docs: https://docs.microsoft.com/en-us/dotnet/articles/core/deploying/index   1. Change the…

.NET Core 1.0 got released

in News
by Mahmut Jomaa on June 27, 2016
mnwall-separatormnwall-separator
Today is the day. Microsoft announced something sweet at Red Hat DevNation. After a 3 year long journey .NET Core 1.0 got released: https://blogs.msdn.microsoft.com/dotnet/2016/06/27/announcing-net-core-1-0/     1. Get the Visual…

Microsoft aquired Xamarin

in News
by Mahmut Jomaa on February 25, 2016
mnwall-separatormnwall-separator
Microsoft announced today that they aquired Xamarin. This is HUGE!   About Xamarin Xamarin is a provider for mobile app development technology. You can write a C# application and cross-compile…

Building a simple Brainfuck Interpreter in C

in C/C++
by Mahmut Jomaa on December 08, 2015
mnwall-separatormnwall-separator
Brainfuck is a Turing-complete language that isn't necessary designed for productive usage :) However it is actually great to understand C pointers. An Interpreter is a computer program that directly…

How to enable precompiled razor views (.cshtml) in ASP.NET 5

in ASP.NET MVC
by Mahmut Jomaa on November 29, 2015
mnwall-separatormnwall-separator
If you want your .cshtml to be precompiled before the first request hits, you need to enable it manually. This increases time needed for compilation, however the compilation process still…

Upgrading your ASP.NET 5 application from beta8 to RC1

in ASP.NET MVC
by Mahmut Jomaa on November 23, 2015
mnwall-separatormnwall-separator
There aren't that many API changes, the focus on RC1 was to stabilize the code base.   Installation of RC1: 1. First download and install the RC1 upgrade for Visual…

Pasterino.com

in Projects
by Mahmut Jomaa on November 09, 2015
mnwall-separatormnwall-separator
Today I'm releasing a new online tool: pasterino.com In short: You can store text online or use it as your syntax highlghter (for your blog).   Features: Paste and share…

View Location Expander in ASP.NET 5 / MVC6

If you are using MVC and your backend is getting bigger and bigger you will start to structure it more aggressively.

For example in a project I had to move my "Views" into a subfolder like this:

 

 

 

The Problem

The default RazorViewEngine's view path is at '/Views' and not  '/Core/Views'.

 

The Solution

There is an easy way in MVC6 to add or replace view paths. The feature is called View Location Expander.

In my case I don't have any other "Views" folder, so I decided to replace the default view location.

 

Example:

 This defines a custom view location expander that will override the default path.

 

 

How to add it to your Startup.cs:

 We configure the DI-Container by adding / customizing a service.

 

 

Well that's it. Pretty, nice and easy :)

 

 

 



Mahmut Jomaa is a Software Engineer from Germany.

Currently he attends university to gain more knowledge in Computer Science.


Security code Refresh

 

Because insights are awesome!