.NET Core Interview Questions

Réussis tes devoirs et examens dès maintenant avec Quizwiz!

What is .NET Core?

+.NET Core is a new version of .NET which is a cross-platform, open source and modular .NET platform for creating modern web apps, microservices, libraries and console applications that run everywhere (Windows, Linux, and MacOS). Cross-platform: Runs on Windows, MacOS, and Linux. .NET Core is a new cross-platform .NET product. The Primary points of .NET Core are: -Cross-platform: Runs on Windows, MacOS and Linux -Flexible deployment: Can be included in your app or installed side-by-side user- or machine-wide. Command-line tools: All product scenarios can be exercised at the command-line -Compatible: .NET Core is compatible with .NET Framework, Xamarin and Mono, via the .NET Standard Library -Open source: The .NET Core platform is open source, using MIT and Apache 2 licenses. +.NET Core is composed of the following parts: -A .NET runtime, which provides a type system, assembly loading, a garbage collector, native interop and other basic services -A set of framework libraries, which provide primitive data types, app composition types and fundamental utilities -A set of SDK tools and language compilers that enable the base developer experience, available in the .NET Core SDK -The 'dotnet' app host, which is used to launch .NET Core apps. It selects and hosts the runtime, provides an assembly loading policy and launches the app. The same host is also used to launch SDK tools in the same way.

Explain .NET family of frameworks?

+.NET Framework is the "full" or "traditional" flavor of .NET that's distributed with Windows. Use this when you are building a desktop Windows app or working with ASP.NET 4.5/4.6 +.NET Core is cross-platform .NET that can run on Windows, Mac, and Linux. Use this when you want to build applications that can run on any platform, including ASP.NET Core (cross-platform web applications) +Xamarin (Mono) is used for building mobile apps that can run on iOS, Android, or Windows Phone devices

What are key advantages using ASP.NET CORE

+ASP.NET Core is cross platform, so you can run it on Windows, Linux, and Mac +No need to install the .NET Framework to run it. Instead, ship all the required dlls with your application +ASP.NET Core can handle many requests

What are the main characteristics of ASP.NET Core?

+Cross-platform and super fast +Dependency Injection (DI) Container which is quite simple and built-in +There is no web.config - now using appsettings.json file +There is no Global.asax - Now using Startup.cs +Kestrel : Kestrel is a cross-platform web server built for ASP.NET Core based on libuy (a cross-platform asynchronous I/O library) +Fully Async Pipeline +Extensible strongly typed configuration, which can also be used to reload at run-time

What is Startup.cs in ASP.NET Core?

+In ASP.NET, Global.asax acts as the entry point for your application +In ASP.NET Core, startup.cs is the entry point for your application +In Startup.cs file -The constructor loads the AppSettings.json file using ConfigurationBuilder class -The ConfigureServices() method adds the services required by the application. For example, here you add MVC and Entity Framework to the services collection -The Configure() method specifies and configures the services added earlier for application's use

What is Kestrel?

+Kestrel is a cross-platform web server built for ASP.NET Core based on libuy (a cross-platform asynchronous I/O library) +It is default web server, hence it is used in all ASP.NET Core templates. It is secure enough to use it without a reverse proxy server +It is good enough to use it without a reverse proxy server. However, you can use IIS, Nginx or Apache or something else +Besides being cross-platform, another great advantage of Kestrel is speed. It is faaaast

What are technologies discontinued in .NET Core?

+Reflection +Appdomain +Remoting +Binary serialization +Sandboxing

Differences between .NET Core and .NET Framework

+The differences between the two can be summarized in these three points -NuGet-based: .NET Core is distributed as a set of NuGet packages that allow app-local deployments, In contrast, the .NET Framework is always installed in a system-wide location. This difference doesn't matter so much for class libraries; but it matters for applications as those are expected to deploy the closure of their dependencies. But we expect this model to change how quickly class library authors can take advantage of new functionality. Since the applications can simply deploy a new version (as opposed to having a given .NET Framework version is widely adopted), there is less of a penalty for component authors to take advantage of the latest features -Well layered: .NET Core was specifically designed to be layered. The goal was to create a .NET stack that can accomodate a wide variety of capabilities and system constraints without forcing customers to recompile their binaries and/or produce new assets. This means that we had to remove certain APIs because they tied lower level components to higher level components. In those cases, we provide alternatives often in the form of extension methods -Free of problematic tech: .NET Core doesn't include certain technologies we decided to discontinue because we found them to be problematic, for instance AppDomain and sandboxing. If the scenario still makes sense for .NET Core, our plan is to have replacements. For example, AssemblyLoadContext replaces AppDomains for loading and isolation assemblies.

What are the various Json files in ASP.NET Core?

+global.json : can be define solution level settings in global.json file +launchsettings.json : can define project specific settings associated with each profile Visual Studio is configured to launch the application, including any environment variables that should be used. You can define framework for your project for compilation and debugging for specific profiles +appsettings.json : can define the configuration for bundling and minification for the project +package.json +bower.json : Bower is a package manager for the web. Bower manages components that contain HTML, CSS, JavaScript, fonts or even image files. Bower installs the right versions of the packages you need and their dependencies

What is the relationship between .NET Core and .NET Framework?

.NET Core and .NET Framework have (for the most part) a subset-superset relationship. .NET Core is named "Core" since it contains the core features from the .NET Framework, for both the runtime and framework libraries. For example, .NET Core and .NET Framework share the GC, the JIT and types such as String and List

What is wwwroot folder in ASP.NET Core?

In ASP.NET, there are no fixed locations for storing static files such as image files, JavaScript files, and CSS files but, int ASP.NET Core, all the static files are kept under the wwwroot folder (default). You also can change the name of this folder by using the Project.json file

What is Metapackages?

The framework .NET Core 2.0 introduced Metapackage that include all the supported package by ASP.NET code with their dependencies into one package. It helps us to do fast development as we don't require to include the individual ASP.NET Core packages. The assembly Microsoft.AspNetCore.All is a meta package provided by ASP.NET core

Can ASP.NET Core applications work with full .NET 4.x Framework?

Yes. ASP.NET core applications works with full .NET framework via .NET standard library


Ensembles d'études connexes

Fundamentals PrepU Chapter 16: Documenting

View Set

Spanish Quizlet- Tori Cappuzzello and Ethan Cochran

View Set

Non-Traditional Mortgages (Oregon CE 2021)

View Set

The Iroquois Creation Myth: "The World on Turtle's Back"

View Set