Sign in

User name:(required)

Password:(required)

Join Us

join us

Your Name:(required)

Your Email:(required)

Your Message :

0/2000

Your Position: Home - Home & Garden - What is .NET Framework? .Net Programming Explained

What is .NET Framework? .Net Programming Explained

.NET is a software development framework and ecosystem designed and supported by Microsoft to allow for easy desktop and web application engineering. It’s a popular free platform currently used for a lot of different types of applications as it provides the programming environment for most software development phases. .NET best suits businesses that look for a wide range of features like web-based services, desktop software, and cloud infrastructure support.

Besides all that, it’s the very first release that has native support for Apple Silicon (mac OS Arm64) and improved support for Windows Arm64.We will partly cover what’s new in .NET 6 in the paragraphs below. Find more information on the Microsoft blog post .NET comes in four flavors: .NET Framework, .NET Core, Xamarin, and Universal Windows Platform (UWP).These implementations combined are called the .NET development platform. Each of them contains frameworks and libraries to build various applications.The .NET Framework released back in 2002 is the first and oldest implementation of the platform. It includes three main application models – WPF, Windows Forms, ASP.NET Forms – and Base Class Library.is a UI framework used for creating graphical interfaces primarily for desktop client applications on Windows OS. WPF uses the capabilities of Extensible Application Markup Language ( XAML ).is a GUI class library within .NET Framework. Windows Forms are used to develop desktop applications with rich graphics that are easy to update and deploy.While the previous two components are designed for desktop engineering ASP.NET is used to develop dynamic websites and web applications. There is the Common Language Runtime (CLR) in its core that gives developers the opportunity to write ASP.NET code using different .NET languages that we discuss below.provides the most common functionality like classes in namespaces and is the core of the Framework Class Library (FCL), a set of reusable interfaces, classes, and value types that are closely integrated with the Common Language Runtime (CLR)The combination of FCL and CLR constitutes the .NET Framework. The base class library also includes ADO.NET, data access technology used by developers to access databases.As .NET Framework supports only Windows-based devices, there was a need for a cross-platform package..NET Core was released in 2016. It’s a cross-platform re-build of .NET Framework. Unlike the old version, engineers can now use the product on Linux and macOS and create applications that aren’t necessarily tied to the Windows family. The new system aims at conquering the cloud space as some providers like Digital Ocean are Linux-driven. Not only is .NET Core cross-platform but its different versions can also be installed side by side on the same device. .NET Core includes ASP.NET Core and Universal Windows Platform (UWP).is a rebuild of ASP.NET that happened to be a more modular framework than its predecessor. ASP.NET Core allows you to build the mobile backend, web apps, and services. It’s also cross-platform and runs on OS X, Windows, and Linux.In .NET 6, ASP.NET Core counts many new features including Hot Reload that enables the application of changes to C#, Visual Basic, and CSS source files without having to restart or rebuild the app (the app is running while you are updating the code).The third implementation is called Xamarin and is used for mobile applications and Mac products. Originally, Xamarin was designed independently from Microsoft and was a proprietary product. Then Microsoft acquired it in 2016 making it a fully open-source branch of the .NET platform. Xamarin uses the Mono runtime and a version of the .NET Framework adjusted to work with APIs for iOS, Android, and Xamarin.Mac. To get an elaborate overview of this product, check our Xamarin pros and cons article.

One of the most prominent .NET 6 features is .NET MAUI (Multi-platform App UI) that acts as the cross-platform framework for developing native desktop and mobile apps with C# and XAML.Apart from being the final step of the unification, .NET 6 can boast of:

While .NET 5 set the unification foundations,version delivered the final parts of it in November 2021, with Visual Studio 2022 released the same day. This is a unified platform for building projects across cloud, browser, IoT, mobile, and desktop environments, enabling all to use the same .NET libraries, SDK, and runtime.

Also, in 2016, Microsoft acquired Xamarin, previously a proprietary technology for cross-platform mobile development, making it open source as well.Microsoft continued moving towards “transparency between the product team and the community,” and open-sourced Windows Presentation Foundation (WPF), Windows Forms, and WinUI frameworks in December 2018.In May 2019, the company announced the big release that would tie the ecosystem together: All .NET elements were supposed to be bundled in the .NET 5 development platform. While changes were made to the schedule because of COVID-19, the .NET 5 unified development platform was finally introduced in November 2020. The successor to .NET Core 3.1 and .NET Framework 4.8, .NET 5 puts order into the fragmentation of the .NET world and provides a lot of features to build applications on Windows, Linux, macOS, iOS, watchOS, Android, tvOS, or using WebAssembly. The platform comes with new APIs, language features, and runtime capabilities. Also, .NET 5 includes ASP.NET Core, Xamarin, Entity Framework Core, WPF, WinForms, and ML.NET.

Microsoft started working on the .NET framework in the late 90s. The idea was to create a platform based on so-called managed code, code that can be executed under a runtime environment. This was needed to improve the development experience and relieve engineers from handling security operations, active memory management, and other low-level efforts that C/C++ developers had to bother with.The first release of .NET Framework in 2002 introduced C#, a language for writing managed code that had a design similar to C++. The framework itself was aimed at Windows-based computers and servers. It had WinForms, a GUI library for desktop applications; ASP.NET, a framework for Web; and ADO.NET for data access. All these elements were driven by Common Language Runtime (CLR) to compile and execute managed code.To unite various functions, .NET offered a framework class library (FCL) that included the base class library (BCL), network library, a numerics library, and others.Since that time, the framework has undergone multiple iterations spanning runtime updates, new desktop graphical systems (WPF), APIs for service-oriented applications (WCF), and more.In 2014, Microsoft announced a dramatic shift in the way .NET exists by presenting .NET Core, a new cross-platform, cloud-friendly, and open-source version of the framework. .NET Core made it to a release in 2016, becoming the main technology to consider for new .NET projects. Gradually, Microsoft started porting existing services to work with Core. Some that didn’t receive official ports, like Windows Communication Foundation (WCF), were substituted by alternatives sourced from the community.

Xamarin, explained

All runtimes use a common infrastructure that makes the entire ecosystem work. It provides runtime components, languages, and compilers.

Universal Windows Platform (UWP)

UWP provides a common type system, APIs, and application model for all devices running on Windows 10. So, UWP enables the development of universal apps for PC, tablet, Xbox, Surface Hub, HoloLens, or Internet of Things (IoT) devices.

UWP app developers get access to the Microsoft store that charges only 15 percent for non-gaming subscription-based apps, unlike Google Play Store and App Store. Other services include an execution environment (AppContainer) and Extension SDKs to call specialized APIs for different devices.

Unfortunately, .NET 5 and .NET 6 will not be coming to UWP project types and there will not be an update on UWP in this regard.

.NET Standard

In 2016 Microsoft also introduced .NET Standard, a library that combines APIs from .NET Framework, .NET Core, and Xamarin allowing engineers to use a single base-class library rather than mastering three different ones related to each .NET implementation. This step unified the ecosystem and brought a higher consistency to reusing components across different platforms.

.NET ecosystem after 2016

.NET development platform is best served with Visual Studio IDE used for building, debugging, and publishing applications across all platforms and devices.

Common language runtime (CLR)

Common Language Runtime (CLR) is the heart of .NET, an application virtual machine that manages memory, implements code access security, verifies code safety, and provides execution of threads and code. CLR is what makes the .NET code a managed one.

As we mentioned, the idea of CLR is to make the developer’s life easier. Besides, it allows engineers to design systems with multiple languages, as CLR enables them to communicate and integrate their behaviors. The runtime checks the needed versions of applied services to ensure that all dependencies are intact and the code works as intended.

In .NET Core, an open-source CoreCLR is used. While nearly identical to CLR in .NET Framework, CoreCLR is adjusted to the .NET Core cross-platform makeup.

Supported languages

The languages that you can use with .NET can be ultimately divided into two major groups: 1) the main officially supported languages by Microsoft, and 2) the rest of the languages that are CLI-compliant.

Main languages. Most of the .NET development happens with C#, F#, and Visual Basic. All three saw great improvements within the .NET 6 release. C# 10 and F# 6 were introduced, both aiming at simplifying code and making it more performant.

The rest of CLI-compliant languages. CLI means common language infrastructure. It’s a technical standard for high-level languages that can be compiled into a common intermediate language (CIL) and further compiled into a byte-code. Besides those three mentioned above, there are about 25 active CLI-compliant languages, including C++/CLI, IronPython, Oxygene, Phalanger, and more. There’s also a number of languages that are no longer used, like IronRuby.

.NET languages



.NET starter pack

If you’re just starting with .NET, here are some useful links for the beginning of your journey:

.NET guide – the general documentation by Microsoft for newbies;

.NET Core guide – for those considering transitioning to the Core version, go here;

.NET framework – the original .NET documentation;

Xamarin – the docs for mobile development;

.NET foundation – the headquarters of the .NET open-source community;

NuGet – the place to find all .NET packages (By the way, Microsoft Visual also supports npm);

Best .NET tools – our take on the best tools, supported by expert opinion;

.NET Core and framework – download it here; and

.NET developer community – all about chatter and support with links to social media, forums, blogs, live workshops, and organizations like .NET foundation.

Now, let’s look deeper at the advantages and drawbacks of using the .NET development platform. Most of the points can be applied to the entire ecosystem, while some of them relate only to its specific components, which we’ll specify in the respective sections.

Pros of .NET development

Object-oriented software development model

.NET is based on object-oriented programming (OOP). OOP is a development model for breaking down software into smaller pieces that are easier to manage and combine. OOP compartmentalizes data into objects, i.e., data fields, and describes objects’ behavior and contents through the declaration of classes.

A modular structure helps define the behavior of objects and their interactions without managing object inner attributes. OOP simplifies programming by making the code manageable, easier to test, and respond to recurring issues. It also eliminates unnecessary programming and generally means less coding for developers. .NET makes it possible to reuse code and components, save time, and – subsequently – the cost of development.

Reliable and simple caching system

Caching means keeping data in a temporary storage place to call it faster when needed. The stored data is the result of an earlier information request or the duplicate of information stored in other places that would take longer to retrieve.

The caching system in .NET is robust and simple to use. It’s also designed to be extensible. The Object Cache class allows developers to create a custom cache implementation to be used for improving the performance and scalability of Windows client and server applications.

Visual Studio IDE

An Integrated Development Environment (IDE) is a single product for programmers that makes application development easier by providing all the tools needed to write and test software.

Visual Studio is a Microsoft IDE used for building, debugging, and publishing applications across all platforms, including Android and iOS. Visual Studio is integrated with .NET and provides the features of a language-specific environment.

The key features of the Visual Studio IDE:

  • It’s used as a single IDE for all .NET applications.
  • The IDE has integrated compilation and debugging features.
  • Collaborative features include a Git-first workflow, real-time collaboration on the same codebase, and integrated code reviews.
  • The solution can be used for applications based on code written in different languages.
  • Visual Studio allows for customizing the environment to match user preferences.

Additionally, Visual Studio Marketplace offers a wide range of editor extensions from Microsoft and other providers to enable team collaboration, continuous integration, third-party connections, cloud development management, etc.

The all-purpose IDE, Visual Studio 2022 was released in November 2021 along with .NET 6. The roll-out is the first 64-bit version of the IDE itself and is stuffed with useful features. Among other things, Visual Studio 2022 contains IntelliCode -- special capabilities that use Machine Learning to complete chunks of code for you, recognize repeated edits, and suggest fixes.

Cross-platform design of .NET Core

.NET Core is a cross-platform .NET implementation that allows the code to run on macOS, Windows, and Linux. Unlike the original .NET framework – which is not completely open – .NET Core has a fully open-source code that ensures that a wide engineering community can continuously contribute to its development.

If you’re writing in C#, F#, or Visual Basic, your code will run on each of the compatible operating systems. This enables companies to reach the widest variety of platforms staying within the .NET ecosystem. At the same time, the cross-platform design ensures that the whole .NET community with a large pool of different engineering skillsets shares the experience.

Flexible deployment and easy maintenance

One of the important .NET Core features is flexible deployment. It can be installed as a part of your application or require a separate installation. The modular design contemplates including all the dependencies you need. The deployment itself is as easy as copying a folder.

Another benefit is that you can have multiple .NET Core versions running side by side on the same machine to cover different projects and seamlessly perform deployment tasks.

Universal .NET Standard

Since 2016, the .NET ecosystem has been enhanced with a large class library called .NET Standard. It’s based on the number of base class libraries for .NET Framework, .NET Core, and Xamarin. These are used to work with common functions such as graphics rendering, database interaction, and manipulations with XML documents. The .NET Standard library greatly simplified developers’ work.

Prior to .NET Standard, a programmer had to redevelop an application or a library for the new platform and then distribute all the updates across various platforms. Currently, the library supports all dependent libraries across applications. However, you should check version compatibility to successfully leverage .NET Standard.

You may check your product compatibility with .NET Standard here and track updates on the Microsoft documentation site



.NET popularity and community

For those of you who are wondering just how popular .NET is, a large community of developers is the answer. Interestingly, it unites engineers from small, midsize, and enterprise-grade companies. This means that almost any issue can be resolved with the help of community members.

Since .NET Core is open source, its libraries, runtime, and compiler are available on GitHub and have many contributions. According to the Stack Overflow 2021 survey, ASP.NET took fifth place among the most popular web frameworks. At the same time, .NET Framework with .NET 5 and .NET Core placed first and second respectively as the most used frameworks beyond web development.

Besides that, .NET Foundation fosters open development and teamwork around the .NET ecosystem. .NET community and commercial developers use it as the main forum for idea exchange.

Automatic monitoring in ASP.NET

ASP.NET has built-in automatic monitoring. The Windows Web Server strictly monitors web pages and applications that run on it. In case any issues such as memory leaks or infinite loops occur, it immediately alerts about them. This allows for directly correcting these behaviors and creating new processes. The monitoring ensures higher stability and transparency of .NET applications.

Powerful Roslyn and RyuJIT compilers

.NET uses two compilers, Roslyn, to compile C# or VB code into CIL (common intermediate language), and RyuJIT, to run just-in-time compilation of CIL into native code. Both compilers are highly regarded by the .NET community as Microsoft actively improves them.

Roslyn has been available since 2011. In 2014, it became open source and in 2015 was included in Visual Studio. Besides the fact that it’s open source, Roslyn exposes APIs to offer rich code analysis for the developer. This means that, unlike traditional black-box compilation, with Roslyn, developers can read the compilation data at every stage.

RyuJIT is responsible for compiling CIL to byte code. The full transition from the old JIT was completed in 2018 with the idea of improved performance. And, generally, engineers agree that RyuJIT is faster. According to .NET 5 Preview 1 and Preview 2 released in spring 2020, numerous improvements to RyuJIT were made to enhance the quality of the machine code generated by JIT (“code quality” as Microsoft specialists call it). “In summary, about half of the following improvements are actual new optimizations, and the other half is due to changing the flow of RyuJIT to enable existing optimizations to apply to more code patterns,” noted .NET Team Program Manager Richard Lander.

Active Microsoft support

Since .NET is Microsoft’s platform technology you would expect the company to actively support and develop it. But the point is, Microsoft is really good at what they are doing. Perhaps there’s no other technology company with such a full and coherent ecosystem that checks off all boxes for engineers, from IDEs and frameworks to cloud services.

Microsoft does its best to further evolve. The transition to .NET Core was a major step in terms of the ecosystem development, as it embraced cloud and focused on performance improvements.

In 2018 Microsoft introduced the ML.NET framework for C# and F# languages. Also, let’s keep in mind the releases of .NET 5 and .NET 6 are already here with .NET 7 being projected for 2022.

Relatively easy migration from .NET 5 to .NET 6

If you keep your applications constantly updated with the newest .NET versions, migrating from .NET 5.0 to .NET 6.0 won’t be a big headache. You first change the target framework from .NET 5.0 to .NET 6.0 on the Properties of your projects in Visual Studio 2022. Then you upgrade the rest of the packages within the project and run QA processes to see how everything performs.

Unlike the above, the migration from .NET Framework to .NET Core or between some .NET Core versions is not a walk in the park. In case your projects are based on earlier versions like .NET Core 3.1, migrating the app to .NET 5 before making the move towards the latest release is recommended.

Disadvantages of .NET development

Even though .NET is considered one of the strongest engineering platforms out there due to extensive infrastructure and proven product development history, it comes with a set of problems.

Limited Object-Relational Support

As we mentioned above, .NET uses the object-oriented programming (OOP) language model. This model is centered around objects rather than “actions” and data rather than logic. The support of data-oriented software application development in .NET Framework and Core are provided by the Entity Framework.

Entity is an object-relational mapper (ORM) that links object-oriented .NET Framework and relational (SQL) databases. Some engineers believe Entity Framework isn’t flexible enough and may not support all available database designs. This also means that there’s a chance that at some point Entity Framework may not be supporting new database designs. Another problem is that the framework may eventually be abandoned by Microsoft.

On the bright side, you can always choose another ORM alternative, so it remains a debatable point.

Licensing cost

Building .NET apps isn’t cheap regardless of open source technologies. Mostly, your expenses will be spent on Visual Studio IDE and other additional collaboration and quality assurance services that Microsoft offers to simplify your work. As of today, the business version of Visual Studio will cost you $45/month for every user. An enterprise release that includes various cloud, enterprise mobility, QA features, and more will be $250 per month per user. However, you still can try to become a Microsoft Partner to have a number of subscriptions for free. For non-profit and educational purposes, there is also the free Visual Studio Community.

Even though you can use .NET Core on Mac and Linux machines, the best way is to use Windows for .NET engineering, which also comes with licensing costs.

The barrier will be even higher if you’ve never used Microsoft products before and you have to migrate from, say, the AWS cloud ecosystem to Azure.

The gap between release and stability

Perhaps, this problem cripples all Microsoft products, not .NET stack only. But it’s definitely worth mentioning. The newly released products lack proper documentation, support, stability, and are prone to drastic changes. In one of the AltexSoft projects, our architects decided to use a fresh DocumentDB (now Azure Cosmos DB) but then were forced to design custom data architecture as the product suffered a number of technical issues that could jeopardize the entire project.

One of Y Combinator users has vividly described this issue: “My problem with these kinds of Microsoft technology evangelism articles/videos is that it always seems like Microsoft has juuuust gotten their new hotness to work, and is telling the world that it’s awesome, and ready for production. Then you go to implement it, and as soon as you leave the perfect world of their demo, it all falls apart, and THEN you find out the docs were written for the beta version, and no longer apply, so you’re left guessing at the right invocation signature for the method you need.”

At the same time, Microsoft keeps working on this issue, and the company’s latest long-term support (LTS) .NET 6 release is claimed to have 3 years of official support and proper documentation on use and migration.

Memory leaks

The problem of memory leaks is not uncommon in any technology. Simply put, the framework doesn’t release the memory that it no longer needs. .NET is frequently criticized for memory leaks and memory-related issues. Although .NET has a garbage collector for this sort of problem, engineers still have to invest additional efforts into proper resource management. And the leaks keep on growing as the application scales.

Fortunately, engineers can find detailed and effective recommendations for detecting leaks in .NET.

Bumpy transition to .NET Core

.NET Core is the next big step in Microsoft’s platform development. As always happens, the transition period may be long and difficult. The applications built with the old .NET Framework outnumber those with .NET Core. And it doesn’t necessarily mean that all of them will experience this transition. In corporate environments, the transition may not be prioritized as much. Nonetheless, these systems need support.

Another related problem here is that the mature .NET Framework had many supporting projects around. For example, many developers expressed concerns about abandoning Windows Communication Foundation (WCF), a runtime and API set for service-oriented applications used by many .NET practitioners. Microsoft decided not to port WCF to Core. Instead, they leveraged community effort, as one of .NET Foundation team members donated an open-source alternative, Core WCF. Again, this isn’t directly managed by Microsoft, nor does it provide full compatibility with the original WCF. Developers will have to spend a little extra effort to complete a transition.

Scott Hunter, from .NET program management, posted that you won’t find ASP.NET Web Forms, .NET Remoting, and some other services in .NET Core. They’ll be gone for good, freeing the way for new technologies.

When to use the .NET

Scalable products. Usually, business needs are growing and your software has to scale with it. .NET provides a scalable environment and allows for redesigning ongoing applications in order to match the growing needs of the business.

Cross-platform needs. In case you need an app that works across platforms, .NET will be a great choice as most platforms are covered and you can reduce development effort while expanding your desktop or mobile app to other operating systems. Also, .NET can be used for such specific engineering cases as gaming (including Xbox) and AR development (including HoloLens).

Enterprise-scale infrastructures. It’s still a debatable point whether .NET is designed mostly for enterprise use. But Microsoft makes sure it provides the widest toolset possible to build and cross-integrate enterprise products, both internal and public ones. It also supports a robust enterprise mobility ecosystem.

This article is a part of our “The Good and the Bad” series. If you are interested in web development, take a look at our blog post on the

The Good and the Bad of C# Programming

The Good and the Bad of Xamarin Development

The Good and The Bad of Angular Development

The Good and the Bad of JavaScript Full Stack Development

The Good and the Bad of Node.js Web App Development

The Good and the Bad of ReactJS and React Native

The Good and the Bads of Swift Programming Language

The Good and the Bad of Selenium Test Automation Tool

The Good and the Bad of Android App Development

The Good and the Bad of Ionic Mobile Development

The Good and the Bad of Java Programming

The Good and the Bad of Katalon Studio Automation Testing Tool

The Good and the Bad of Vue.js Framework Programming

The Good and the Bad of TypeScript

The Good and the Bad of React Native App Development

The Good and the Bad of React Development

The Good and the Bad of Flutter App Development

The Good and the Bad of Python Programming Language

Learn about the .NET platform that powers C# applications

If you’re learning C#, you’re going to encounter a lot of “dot net”: .NET, .NET Framework, .NET Core, dotnet, ASP.NET, the list goes on. This article will demystify these concepts and give you some context before diving into C# programming.

What is .NET?

Formally, .NET is “an open source developer platform, created by Microsoft, for building many different types of applications. You can write .NET apps in C#, F#, Visual C++, or Visual Basic.”

Informally, .NET is the tool that lets you build and run C# programs (we’ll avoid F#, Visual C++, Visual Basic for now).

When you download .NET, you’re really downloading a bunch of programs that:

  • Translate your C# code into instructions that a computer can understand
  • Provide utilities for building software, like tools for printing text to the screen and finding the current time
  • Define a set of data types that make it easier for you to store information in your programs, like text, numbers, and dates

There are a few versions of .NET. They do the same job but they are meant for different operating systems:

  • .NET Framework is the original version of .NET that only runs on Windows computers.
  • .NET Core is the new, cross-platform version of .NET that runs on Windows, MacOS, and Linux computers. Since it’s more flexible and Microsoft is actively enhancing this version, we’ll be using this one throughout the path.

Whenever we refer to “.NET” from now on, we really mean .NET Core. Conveniently, Microsoft itself plans to rename .NET Core to .NET towards the end of 2020.

How do I get .NET?

So we know we want to work with C#, and we know we need .NET. How do we get the .NET platform on our computers?

The two main ways are:

  1. Download Visual Studio, an integrated development environment (IDE) for .NET applications. It comes as an app, like the web browser you’re using to view this article. It comes with the .NET platform, a code editor, and additional tools to help you write code.

  2. Download the .NET SDK (software development kit). It also comes with the .NET platform, but it has no code editing tools. Instead of an app on your computer, the SDK is accessed via a command-line interface (CLI) — to use an SDK, you’ll open up a terminal on your computer and type commands instead of clicking buttons. In this example, you can see a terminal in which the user ran commands like dotnet new and dotnet run to build a new application, then ran it (the app just prints out “Hello World!”).

You’ll see both of these throughout the skill path.

What about ASP.NET?

If we want to build programs specifically for the web, like websites, you’ll need to add more tools on top of .NET. One of the most popular is ASP.NET. To keep them separate, developers call .NET a platform and ASP.NET a framework. This is all you need to know about ASP.NET to get started with C#: we’ll cover the details in a separate article.

Summary

Hopefully, this helps you see the big picture before diving into the details of C#:

  • C# is a programming language
  • To build programs with C#, you need the .NET platform
  • .NET comes in two major flavors, .NET Framework for Windows and .NET Core for Windows/MacOS/Linux
  • To get .NET Core on your computer, download Visual Studio or the .NET SDK
  • To build programs like web apps and web services, you need the ASP.NET framework on top of .NET

Now let’s get coding!

What is .NET Framework? .Net Programming Explained

What is .NET?

191

0

Comments

0/2000

All Comments (0)

Guest Posts

If you are interested in sending in a Guest Blogger Submission,welcome to write for us!

Your Name:(required)

Your Email:(required)

Subject:

Your Message:(required)

0/2000