Visual Studio extension for Kentico MVC is here

   —   

You want to create a new MVC widget, open Visual Studio, create a new Controller, View, and then you open documentation and start reading. But you want to write code, not read documentation, right?

In this article, I will present you with the new Visual Studio extension that allows for simpler and faster MVC development without the need of browsing through a ton of documentation (even though the documentation is awesome! Hello Kentico technical writers :-)).

Creating MVC components manually

When you decide to create an MVC extension, how long does it take to get all the essentials sorted? Let's take a look.

In the documentation you will find that a widget consists of:

  • Controller
  • Partial View
  • View Model
  • Properties

That's easy. Especially when you get that link to the specific page in the docu. Or when this would be the tenth widget you are creating. But what about form components or sections? Or have you created a template yet? In those cases, you need to go back to reading & learning. Unless...

Visual Studio Extension for Kentico MVC

The VS extension for Kentico MVC does that job for you. It contains templates for various extensions that automatically adjust to your namespaces and naming conventions and add all necessary files automatically. Let's take a look at how that works.

Adding a new widget using VS extension animation

All the files were generated. Now your job is to adjust the functionality and optionally move the files to the target destination according to your project structure.

Installing the extension

To install the extension, navigate to "Tools" and select "Extensions and Updates" from the submenu. Look online for "Kentico MVC extension" and click "Download." After that, restart Visual Studio and you are all set.

Downloading VS extension animation

Item templates

The "New Item" options are based on Item templates we have available. Right now there are templates for:

  • widget
  • form component
  • section

And we are looking to add more. As always, the source code of VS extension is available publicly on our GitHub.

* The original concept and source code of this extension was implemented by Luminary.

How to ask for additional item templates?

For adding new item templates we need your help. Are you missing a template? Do you frequently work on components there is no template for? Let us know via GitHub issues in the extension source code repository.

How to add additional item templates?

We always welcome community contributions! Please create a GitHub issue in the extension source code repository. Or simply submit a pull request to the repository, we will check your contribution and republish the package on VS marketplace.

Share this article on   LinkedIn

Ondrej Polesny

Hi! I am a Developer Evangelist here at Kentico and my aim is to provide guidance and solutions for the technical community around both Kentico EMS and Kentico Cloud. I can also help with drinking beer.