.Net Core Questions and Answers
1
What do you understand by .Net Core?
.NET Core is an open-source, general-purpose development platform
maintained by Microsoft and the .NET community on GitHub.
It's cross-platform (supporting Windows, macOS, and Linux)
and can be used to build device, cloud, and IoT applications.
2. What are the
important characteristics of .Net Code?
.NET Core has the following characteristics:
Cross-platform: Runs on Windows, macOS, and Linux
operating systems.
Consistent across architectures: Runs your code with the
same behavior on multiple architectures, including x64, x86, and ARM.
Command-line tools: Includes easy-to-use command-line
tools that can be used for local development and in continuous-integration
scenarios.
Flexible deployment: Can be included in your app or
installed side-by-side (user-wide or system-wide installations). Can be used
with Docker containers.
Compatible: .NET Core is compatible
with .NET Framework, Xamarin, and Mono, via .NET Standard.
Open source: The .NET Core platform is open source,
using MIT and Apache 2 licenses. .NET Core is a .NET Foundation
project.
3. What are the
different languages supported by .Net Core?
C#, Visual Basic, and F# languages can be used to write
applications and libraries for .NET Core. These languages can be
used in your favorite text editor or Integrated Development Environment (IDE),
including:
·
Visual Studio
·
Visual Studio Code
·
Sublime Text
·
Vim
4. What are the
different components of .Net Core?
.NET Core is composed of the following parts:
· The .NET Core runtime, which provides a
type system, assembly loading, a garbage collector, native interop, and other
basic services.
· .NET Core framework libraries provide primitive data types, app
composition types, and fundamental utilities.
· The ASP.NET runtime, which provides a
framework for building modern cloud-based internet connected applications, such
as web apps, IoT apps, and mobile backends.
· The .NET Core CLI tools and language
compilers (Roslyn and F#) that enable the .NET Core developer experience.
· The dotnet tool, which is used to launch .NET
Core apps and CLI tools. It selects the runtime and hosts the runtime, provides
an assembly loading policy, and launches apps and tools.
These components are distributed in the following ways:
·
.NET Core Runtime -- includes the .NET
Core runtime and framework libraries.
· ASP.NET Core Runtime -- includes ASP.NET Core and .NET
Core runtime and framework libraries.
· .NET Core SDK -- includes the .NET
CLI Tools, ASP.NET Core runtime, and .NET Core runtime and framework.
5. What is
ASP.NET Core?
ASP.NET Core is a brand new cross-platform web
framework built with .NET Core framework.
It is not an update to existing ASP.NET framework. It is
a complete rewrite of the ASP.NET framework.
It was built from scratch in the effort to make a modular,
scalable, super fast, configurable, cross-platform and easily extended web
framework.
ASP.NET Core (on Linux!) itself can handle over
2 000 000 – 2 Million requests per second for plaintext request/response
scenarios.
ASP.NET Core MVC can handle over 1 million requests
per second! Compared to Node.js, which can handle about 400 000 requests per
second,
this is an amazing effort.
It works with both .NET Core and .NET Framework.
6. What is .NET
Standard?
.NET Standard is a set of APIs that all .NET
platforms have to implement. This unifies the .NET platforms and prevents
future fragmentation.
.NET Standard 2.0 is implemented by .NET
Framework, .NET Core, and Xamarin. For .NET Core, this added
many of the existing APIs that have been requested.
.NET Standard 2.0 includes a compatibility shim for .NET
Framework binaries, significantly increasing the set of libraries that
you can reference from your .NET Standard libraries.
.NET Standard will replace Portable Class
Libraries (PCLs) as the tooling story for building multi-platform .NET
libraries.
You can see the .NET Standard API definition in the
dotnet/standard repo on GitHub.
7. Can ASP.NET
Core work with the .NET framework?
Yes. This might surprise many, but ASP.NET Core works with .NET
framework and this is officially supported by Microsoft.
ASP.NET Core works with:
·
.NET Core framework
·
.NET framework
8. What is
Kestrel?
Kestrel is a cross-platform web server built for ASP.NET
Core based on libuv – a cross-platform asynchronous I/O library.
It is a default web server pick since it is used in all ASP.NET
Core templates.
It is really fast.
It is secure and good enough to use it without a reverse
proxy server.
However, it is still recommended that you use IIS, Nginx or
Apache or something else. Unless you really know what you are doing.
9. What are the
different ways for bundling and minification in ASP.NET Core?
There are different ways for doing bundling and minification
in ASP.NET
Core.
Gulp – was the default choice for ASP.NET Core till beta
versions. Later it was removed due to performance and speed issue and replaced
with BundlerMinifier.
BundlerMinifier – is a Visual Studio extension and it’s
default choice now. You should see bundleconfig.json file in your default
template.
ASP.NET Core Web Optimizer – ASP.NET
Core middleware for bundling and minification of CSS and JavaScript
files at runtime.
Grunt – can also be used with ASP.NET Core
10. What is
“Razor pages” in ASP.NET Core?
“Razor Pages” is a new feature of ASP.NET Core and it was
released with ASP.NET Core 2.0 release.
Razor Pages are simple pages or views without controllers
and introduced with the intent of creating page focused scenarios
where there is no real logic is involved. You will find
razor pages similar to ASP.NET Web Forms. They work on the
convention
and need to be placed in Pages folder and the extension is
.cshtml. Razor pages uses handler methods to deal with incoming HTTP request.
11. What are
the differences between .NET Core Runtime and SDK?
The SDK contains everything that are required for developing
a .NET
Core application easily, such as the CLI and a compiler.
Whereas, the Runtime is the "virtual machine" that
hosts/runs the application and abstracts all the interaction with the base
operating system.
12. Explain why
to choose ASP.NET Core?
Millions of developers have used (and continue to use) ASP.NET
4.x to create web apps. ASP.NET Core is a redesign of ASP.NET
4.x, with architectural changes that result in a leaner, more modular
framework.
ASP.NET Core provides the following benefits:
·
A unified story for building web UI and web APIs.
·
Architected for testability.
·
Razor Pages makes coding page-focused scenarios easier and
more productive.
·
Blazor lets you use C# in the browser alongside JavaScript.
Share server-side and client-side app logic all written with .NET.
·
Ability to develop and run on Windows, macOS, and Linux.
·
Open-source and community-focused.
·
Integration of modern, client-side frameworks and
development workflows.
·
Support for hosting Remote Procedure Call (RPC) services
using gRPC.
·
A cloud-ready, environment-based configuration system.
·
Built-in dependency injection.
·
A lightweight, high-performance, and modular HTTP request
pipeline.
·
Ability to host on the following:
·
Kestrel
·
IIS
·
HTTP.sys
·
Nginx
·
Apache
·
Docker
·
Side-by-side versioning.
·
Tooling that simplifies modern web development.