Easily Add DevExtreme ASP.NET MVC Controls to .NET Core Visual Studio Projects (Coming Soon in 17.2)

ASP.NET Team Blog
10 November 2017

The DevExtreme MVC Controls work great with the ASP.NET Core 2.0 framework but what if you've got an existing project?

To help you get started with using DevExtreme MVC Controls in ASP.NET Core 2.0 projects, we've upgraded "Add DevExtreme to the Project" option in the upcoming v17.2 release.

Context Menu - Single Click

This tool, long familiar to our ASP.NET customers, is now available for ASP.NET Core projects, too. Right-click on your Visual Studio 2017 project and select the menu option:

Then you'll see a confirmation dialog. Select 'Yes' to run the tool.

Once it starts, the tool will help you to include the necessary references, scripts, styles, and also modify the important project files such as Startup.cs and NuGet.config. You can still do this manually but this tool saves you a ton of time.

When the tool is done, it'll display the following 'Readme page' which details the changes made and also recommends that you complete the last small but important step:

IMPORTANT: Complete the conversion

There is one final important step you need to complete after running this tool. The goal of this tool is to make enough changes to enable using DevExtreme MVC Controls in your .NET Core projects. However, we didn't want to modify your _Layout.cshtml file, more on this below.

The final step requires you to switch to use a new file which we add to the project called: _DevExtremeLayout.cshtml. This file contains the references that are needed in the head section (and elsewhere) to use DevExtreme MVC Controls in your existing project.

Unlike ASP.NET MVC 5 projects (which we refer to as "classic MVC"), in .NET Core there are no bundles. Instead, there is now a hierarchy of <environment>, <script>, and <link> tag helpers that are used. This gives developers more flexibility, however, for automated tools, it can complicate your process.

We understand that in existing projects the _Layout.cshtml and the corresponding sections of it can be highly customized. Therefore, we don’t try to parse and patch it. Instead we provide two alternatives to complete adding DevExtreme to your project:

  1. Either switch to the ready-to-use new layout _DevExtremeLayout.cshtml (which is the same as the one used in projects created from DevExtreme ASP.NET MVC Project Templates)

  2. -OR- modify your existing layout by following the recommendations from the mentioned Readme page

I want to stress, that the tool's primary purpose is to add DevExtreme to your existing projects. If you create a new project then please use our DevExtreme Project templates instead as they have everything setup already. They're available in the Web, .NET Core, and DevExtreme sections of the 'New Project' dialog.

Watch the webinar

I recommend watching this recent webinar which goes over the process of using the updated tool:

Try it now

You can test these new features today by downloading the DXperience v17.2 Beta that is available in your download center (for existing customers).

What do you think about the DevExtreme MVC Controls in ASP.NET Core 2.0? Drop me a line below.

Email: mharry@devexpress.com

Twitter: @mehulharry

Free DevExpress Products - Get Your Copy Today

The following free DevExpress product offers remain available. Should you have any questions about the free offers below, please submit a ticket via the DevExpress Support Center at your convenience. We'll be happy to follow-up.
No Comments

Please login or register to post comments.