ASP.NET vNext, a quick look into the future

  1. MVC Controllers and WebAPI Controllers are now merged to form single controller class
  2. No need for physical folders for Areas, just decorating a Controller with [Area("AreaName")] gets you the desired result. But the problem is rendering engines still look for Views in Areas/{area name}/Views/{controller} path. So I guess you are better of placing your Controllers also in Areas/{area name}/Controller folder for better organizing them
  3. Route mapping looks a bit better now with the following syntax
  4. // MVC 6 route
    routes.MapRoute(
        name: "Default",
        template: "{controller=Home}/{action=Index}/{id?}"
    );
    
  5. Even if you omit the {action} token from the route template, your Controllers can still respond to Action names corresponding to the Request method (GET, POST, UPDATE…). So, this neatly ties up the merger of MVC Controllers and WebAPI Controllers
  6. OWIN and Katana seems to be all the rage now, and for good reasons. So, the startup scripts looks thus (no need for Global.asax .. will miss you my friend!)
  7. using Microsoft.AspNet.Routing;
    using Microsoft.AspNet.Builder;
    using Microsoft.Framework.DependencyInjection;
    
    public class Startup
    {
        public void Configure(IBuilder app)
        {
            app.UseServices(services =>
            {
                services.AddMvc();
            });
    
            app.UseMvc(routes =>
            {
                routes.MapRoute(
                    name: "Default",
                    template: "{controller=Home}/{action=Index}/{id?}");
            });
    
        }
    }
    
  8. Now your Visual Studio project file is a simple JSON file, instead of the lengthy XML one

So, overall seems to be a nice upgrade.

Do check out Getting started with MVC 6 for a more elaborate look into the features.

Evolution of Visual Studio, a lot to love about!

A pleasant thing I noticed in the last few years regarding Visual Studio is it’s attitude towards supporting various open source languages and platforms.

You would have felt the same if you were looking to improve your IDE experience when trying to work on projects not based on the Microsoft .NET family. It may have been PHP or Python (with Django) or the D Language. It is quite nice to have the option to use a single IDE which you are familiar with to work on various language and platforms.

For anyone interested, below is my toolset/plugin setup for supporting the above mentioned language and platforms:

  1. PHP – [Free]: PHP Language Support / [Commercial]:PHP Tools for Visual Studio 2013
  2. Python – [Free]:Python Tools for Visual Studio / Project Page on CodePlex / Great intro by Hanselman
  3. D Language – [Free] Visual D / Project page on GitHub

To add to the good news, Visual Studio also supports Git for source control. Oh! and now we have Visual Studio Online Basic where you can have upto 5 users for Free with unlimited team projects (can be private too) which allows you to host your repo either based on TFS or Git! As an alternative you can also sign up and use BitBucket who are just cool with allowing free private repos and supporting custom domain names for accessing your repos.

What a good time to be in development, I am loving it! :)

Cmder and Visual Studio 2013 (Developer Command Prompt)

I am a regular user of Cmder, a very nice command line emulator for Windows. Cmder is internally using ConEmu for the command prompt emulation and has a very beautiful Monokai color scheme.

Since Cmder uses ConEmu internally, we can setup custom Tasks (like loading PowerShell and Visual Studio developer command prompt) for adding additional functionality to the command shell. The below is the my Task setup for loading Visual Studio 2013 Developer command prompt from inside Cmder:

* > cmd.exe /k ""%VS120COMNTOOLS%VsDevCmd.bat"   & "%CMDER_ROOT%\vendor\init.bat"" -new_console:d:D:\

Or add the following entry in the ConEmu.xml (under config folder)

<key name="Task3" modified="2014-08-10 20:44:11" build="131215">
	<value name="Name" type="string" data="{VSCmd}"/>
        <!-- HotKey is Alt + Ctl + V -->
	<value name="Hotkey" type="dword" data="00111256"/>
	<value name="GuiArgs" type="string" data=""/>
	<value name="Cmd1" type="string" data="* &gt; cmd.exe /k &quot;&quot;%VS120COMNTOOLS%VsDevCmd.bat&quot;   &amp; &quot;%CMDER_ROOT%\vendor\init.bat&quot;&quot; -new_console:d:D:\"/>
	<value name="Active" type="dword" data="00000000"/>
	<value name="Count" type="dword" data="00000001"/>
</key>