ASP.NET IS NOW OPEN SOURCE!
Yes it has been so for a while now. So why am I bringing this up?
Last Saturday, a couple of friends and I decided to attend an open session on the subject. The meetup was really interesting and informative. Attendees were mostly members from the MSCC – Mauritius Software Craftsmanship Community (@MSCraftsman) and a handful of MSPs. Some familiar faces I recognized were Jochen (From MSCC), Prithvi, Bilkiss, Adrien (MSP), Prashant (MSP), Gulshan (MSP), Hansynee (MSP) and Arshad (MSP).
We started with a small group of less than 10 people which gradually increased to a roomful by the end. Kicking off the event, each member around the table introduced themselves. We had a little of everything: COBOL and Visual Basic to Web Developers and C#. The diversity was just as wide in terms of age and experience of the members.
The first part was an introduction to the topic of the day and a quick run through the ASP.NET documentations and showing off the new .NET Core 1.0 now on GitHub.
BUT IS IT .NET CORE or ASP.NET?
They are both accurate. In fact, Jochen mentioned a blog post by Microsoft explaining the .NET Core and ASP.NET5 conundrum. However, .NET Core 1.0 is the new open source and cross platform .NET Framework. The 1.0 is particularly meaningful indication that Microsoft wants developers to know that this is a new and fresh start.
On a side note, this has for implication that a .NET 4.6 application will not run on .NET Core 1.0 out of the box. They will need some refactoring and will have a migration process.
HOW TO CODE?
So this is usually the first question that pops to mind when thinking about moving to .NET Core. What is the use of an open source .NET if we still need to buy a full fledge Visual Studio Enterprise IDE to use it? This led to an interesting evaluation about IDEs in general. We all love a beasts of an IDE. Visual Studio and its plethora of plugins and add-ons is a beautiful example.
But is this your first choice to write a Hello World application?
“The first choice (of IDE) for most average Joes (developers) like us is usually a simple text editor in the likes of Sublime, Atom or Visual Studio Code.” – Jochen
And those simple text editors can all be used to code using the .NET Core framework.
NEXT IS THE .NET ENVIRONMENT
And this is where .NET Core steps in. The packages are all up for download on GitHub. At this point we went through the steps to get ASP.NET on a system. To fully get the cross platform feel of this new venture, we specifically looked at how to get .NET on a Linux machine. One of the members even tried it on his MacBook. We did not get to see it finish due to a slow internet connection though.
LET’S CREATE A PROJECT THEN
IDE – Checked. .NET Core – Checked. What are we waiting for? This is the part where we created a new .NET project. The official way is well documented on the ASP.NET site with how to install and use the DNVM and DNX. I was particularly interested by another way of creating .NET projects – using the DOTNET command, which we are all secretly hoping will eventually become the new official method.
The directions are pretty straightforward.
- Navigate to the required directory
– cd directory_name
- Create a new project – which actually automatically creates a JSON file that specifies the basics libraries required to run the project.
– dotnet new
- Get the libraries specified before
– dotnet restore
– dotnet run
Adrien and Prashant did a quick recap of .NET Core and described it as
“A single Modular and Cross Platform version of .NET”
Adrien gave us a demo of how an ASP.NET website was running from a Linux VM.
He also showed us a peek at Yeoman on Linux – an impressive utility to aid developers in creating projects – and its support for .NET Core.
Well that’s about it. The rest of the afternoon was spent having fun tinkering with some codes and us sharing our views on virtually anything related to development.
All in all, it was a Saturday well spent.