In-Depth

The Key to Cross-Platform Coding is .NET Everywhere

No longer a pipe dream, cross-platform coding has been made fairly straightforward and nearly ordinary with tools from Xamarin and others. At VSLive!, Microsoft's James Montemagno demonstrated the ease with which cross-platform apps can be delivered without venturing too far from the C# space.

Being able to write code and run it anywhere is no longer just a dream. With cross-platform technologies like Xamarin, it's easily within reach. James Montemagno, principal program manager for Xamarin at Microsoft, gave a demo-heavy keynote presentation entitled ".NET Everywhere." He showed the crowd how straightforward it can be to develop once and deploy to multiple platforms. Montemagno's presentation was Wednesday, March 15 at Visual Studio Live! in Las Vegas.

Montemagno came to Microsoft through its acquisition of Xamarin. "My real focus is Xamarin. I've been living and breathing it for the last six years," he said. "You can take C# and .NET code and run it everywhere, and I want to show you how to do that." And with that he launched into an extensive series of demos.

"I love C#," he said. "It's simply the best programming language ever created." When he first went to Xamarin, he had a similar reaction. "I downloaded Xamarin and fell in love immediately." His affections for these technologies are due to the time-saving ability to share code.

"You can create beautiful native apps," he said. "You want to share code? With Xamarin, you can share 70-80 percent of your business logic. Xamarin embraces and extends .NET. Xamarin delivers every single API and all your .NET stack and libraries, so I'm building native user interfaces and access to all APIs for native performance."

He began the demo portion working within Visual Studio, with Xamarin installed. "I'm going to build a brand new iPhone app. It looks like a .NET project, with all the properties and references. It all makes sense as a .NET developer. This is a Xamarin native app, so I have a main storyboard for an overview of the app."

He worked through the process of creating this single view geolocator app. "I am going to create a storyboard layout," he says. "You could think of this as a drag and drop user interface."

As he finished up the first demo, he summarized what he had just accomplished. "So I just dropped a few controls and wrote 15 lines of C# code to do all that," he said. "And that was all in Visual Studio. I never left my development environment."

He reiterated the cross-platform possibilities of the new technologies. "When I say C# everywhere, I mean C# everywhere," he said. "With .NET core, you could take your .NET code anywhere, whether it's to the web, to a server, to Linux, it doesn't matter. You can put .NET code absolutely everywhere."

He enthusiastically put this statement in context with a bit of history. "A little more than year ago, Xamarin joined Microsoft. That was an awesome day, I knew we were going to do awesome things together," he said. "In the last year, we've worked tightly with .NET team, the ASP.NET team and all the other amazing teams building libraries at Microsoft. Now we have this amazing IDE call Xamarin on the Mac. We also now have Visual Studio for the Mac, and they're all free Community editions."

The open source movement at Microsoft has also been part of this story. "We've worked hard to open source all the Xamarin integrations like Xamarin Android and Xamarin iOS. We've open sourced our .NET runtime called Mono. We've also open sourced Xamarin forms. And created .NET standard for unification of .NET across all platforms. What this means is that as a .NET developer is you just write code and it just works everywhere," said Montemango. "It's a dream we've all wanted for a long time."

Montemagno wrapped up by sharing some educational resources. "As a developer, all this is moving fast," he said. ".NET is moving fast, C# is moving fast, and Xamarin is a brand new platform to target. How do you learn all this?" The series of interactive workbooks available on Xamarin University is one way to quickly get up to speed on this new cross-platform world.

The next Visual Studio Live! event happens in Austin, TX in May 15-18. Click here for more information.

About the Author

Lafe Low has been a technology editor and writer for more than 25 years. Most recently, he was the editor in chief of TechNet magazine. He has also held various editorial positions with Redmond magazine, CIO magazine and InfoWorld. He also launched his own magazine entitled Explore New England, and has published four editions of his guidebook The Best in Tent Camping: New England.

comments powered by Disqus

Featured

  • Compare New GitHub Copilot Free Plan for Visual Studio/VS Code to Paid Plans

    The free plan restricts the number of completions, chat requests and access to AI models, being suitable for occasional users and small projects.

  • Diving Deep into .NET MAUI

    Ever since someone figured out that fiddling bits results in source code, developers have sought one codebase for all types of apps on all platforms, with Microsoft's latest attempt to further that effort being .NET MAUI.

  • Copilot AI Boosts Abound in New VS Code v1.96

    Microsoft improved on its new "Copilot Edit" functionality in the latest release of Visual Studio Code, v1.96, its open-source based code editor that has become the most popular in the world according to many surveys.

  • AdaBoost Regression Using C#

    Dr. James McCaffrey from Microsoft Research presents a complete end-to-end demonstration of the AdaBoost.R2 algorithm for regression problems (where the goal is to predict a single numeric value). The implementation follows the original source research paper closely, so you can use it as a guide for customization for specific scenarios.

  • Versioning and Documenting ASP.NET Core Services

    Building an API with ASP.NET Core is only half the job. If your API is going to live more than one release cycle, you're going to need to version it. If you have other people building clients for it, you're going to need to document it.

Subscribe on YouTube