Telerik blogs
Cross-Platform support in Telerik UI for ASP.NET MVC 870x220

The .NET framework has had quite the journey from conception until today. Yet, every iteration from .NET 1.0 to .NET 4.5 has almost invariably required kittens to die, as you painstakingly upgraded your apps and the .NET runtimes. The challenge, in part, was because of the giant monolithic .NET framework that all your apps depended on.

All that changes moving forward.

The new .NET framework is modern, lean, modular and open source. No longer is .NET a system-wide installation—it is merely a folder. Instead of a huge underlying framework, you only pick and choose the pieces of the .NET framework that you need in your apps. And more importantly, you can package the required components of the .NET framework right alongside your app. We’re entering an age of app-runtime silos and ultimate portability.

Not surprisingly, ASP.NET 5 is driving many of the changes in .NET, as shown in the 10,000-foot view below. ASP.NET 4.6 is the next full iteration of ASP.NET and it runs on the full API canvas of .NET 4.6—everything you do now in .NET runs just fine in this mode going forward. The new kids on the block are ASP.NET 5 and .NET Core 5 – both of them lean, modular, cross-platform and open source.

DotNetPicture

With ASP.NET 5, you could build your web app on one machine with a specific version of .NET runtime, and seamlessly move and run the app on another machine, with no installation required. This is possible not just between Windows machines, but even cross-platform across OSX or Linux. Portability of .NET—yes please!

Telerik UI

Want to spice up the UI for your MVC web apps? With Telerik® UI for ASP.NET MVC suite, you get 70+ polished and performant UI components powered by Kendo UI. You get server-side wrappers that emit clean HTML5/JS code on the client side, as well framework pieces and deep Visual Studio integration.

With ASP.NET 5 around the corner, you may be wondering how your beloved Telerik MVC UI suite will fare. Turns out, UI for ASP.NET MVC is as bleeding edge as you are. Telerik UI for ASP.NET MVC suite already supports ASP.NET 5 RC1 release—the latest and greatest. This means you can leverage Visual Studio 2015 and the latest features of MVC 6 while utilizing Telerik UI for your next amazing web app.

How do you get started? Grab the latest Telerik UI for ASP.NET MVC 6 bits from the updated NuGet feed. Check your Visual Studio References folder to ensure that you are correctly using the Telerik MVC bits inside your existing MVC web project. With the bits ready, it’s time to have fun.

Going Cross-Platform

With ASP.NET 5 you have ultimate portability, and now you can use your favorite Telerik MVC UI controls for cross-platform apps! How? Simple—Telerik MVC apps can now run on top of the new .NET Core, and therefore are super portable.

Want to see Telerik UI going cross-platform in action? We have a sample app ready for you. Head out to the GitHub repo for the sample cross-platform app.

Here are the steps to run the app on a Mac:

  1. Download the source code as a zipped file.
  2. Unpack and take a look around.GHSolution
  3. Notice the Index.shtml view—it is rendering UI through the @HTML server-side Kendo helpers, just as would normally do in your MVC project. You’ll find the usual Grid, Menu, Buttons and more.
  4. Make sure you have the right DNX version runtime. This particular app depends on the 1.0.0-rc1-update1 CoreCLR runtime; feel free to use ‘DNVM Use’ command to set the right DNX version, as below. CorrectDNX
  5. Run ‘DNU Restore’ to pull down and restore all NuGet packages.
  6. Run ‘DNX Web’ to launch the entry point.DNXWeb
  7. Launch browser and navigate to http://localhost:5004.MVConMac

A native ASP.NET MVC app with Telerik UI controls—now running on a Mac. How cool is that! And you can not only run the app on OSX or Linux, but also do future development on these other platforms. How can you set up cross-platform support from the very start for your MVC projects? Simple—just meet the requirements and follow the steps below.

Here are the steps to run Telerik UI for ASP.NET MVC cross-platform from scratch:

  1. Start an ASP.NET MVC project in Visual Studio
  2. Make sure you have the latest Telerik UI for ASP.NET MVC bits, with support for ASP.NET 5 RC1
  3. Utilize the Telerik MVC controls to build your desired UI
  4. Set target framework to .NET Core. This can be done in VS Project Properties or through Project.JSON file by setting supported frameworks to ‘DNXCore50
  5. Move entire directory to OSX or Linux and run ‘DNU Restore’
  6. To simply run the app locally on other platforms, package up the app using ‘DNU Publish’

You may call this an effort to democratize .NET and ASP.NET for every type of developer. Gone are the days of a high barrier to entry, massive installations and IDE lock-ins—you should be able to use ASP.NET 5 on any platform and using the editor of your choice. And Telerik UI for ASP.NET MVC is right there to help spice up your app’s UI. Have fun!


SamBasu
About the Author

Sam Basu

Sam Basu is a technologist, author, speaker, Microsoft MVP, gadget-lover and Progress Developer Advocate for Telerik products. With a long developer background, he now spends much of his time advocating modern web/mobile/cloud development platforms on Microsoft/Telerik technology stacks. His spare times call for travel, fast cars, cricket and culinary adventures with the family. You can find him on the internet.

Related Posts

Comments

Comments are disabled in preview mode.