Mehul Harry's DevExpress Blog

This Blog

News


Mehul Harry is the DevExpress Web Program Manager. Follow him on twitter: @Mehulharry

Subscribe (RSS, Email)

Archives

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

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

Published Nov 10 2017, 10:50 AM by
Bookmark and Share

Comments

No Comments

About Mehul Harry (DevExpress)

Mehul Harry is an ASP.NET technical evangelist at Developer Express. You can reach him directly at mharry@DevExpress.com. You can also follow him on Twitter: http://twitter.com/mehulharry
LIVE CHAT

Chat is one of the many ways you can contact members of the DevExpress Team.
We are available Monday-Friday between 7:30am and 4:30pm Pacific Time.

If you need additional product information, write to us at info@devexpress.com or call us at +1 (818) 844-3383

FOLLOW US

DevExpress engineers feature-complete Presentation Controls, IDE Productivity Tools, Business Application Frameworks, and Reporting Systems for Visual Studio, along with high-performance HTML JS Mobile Frameworks for developers targeting iOS, Android and Windows Phone. Whether using WPF, ASP.NET, WinForms, HTML5 or Windows 10, DevExpress tools help you build and deliver your best in the shortest time possible.

Copyright © 1998-2017 Developer Express Inc.
All trademarks or registered trademarks are property of their respective owners