This site uses cookies to deliver our services. By using this site, you acknowledge that you have read and understand our Cookie and Privacy policy. Your use of Kontext website is subject to this policy. Allow Cookies and Dismiss

.NET Framework

Everything about .NET framework.

dotnet core lite-log

Set AttachDbFilename as Relative Path in .NET Core

67 views   0 comments last modified about 2 months ago

.NET Framework, you can use |DataDirectory| to configure connection string when connecting to SQL Server database file via attach mode: AttachDbFilename=|DataDirectory|\dbname.mdf In .NET Core, you cannot directly set SQL Server Express connec...

View detail
dotnet core lite-log

Instantiate a Service in ConfigureServices Method in .NET Core

21 views   0 comments last modified about 2 months ago

.NET Core is built in with dependency injection. Usually method ConfigureServices in Startup class is used to register services in the container. The signature of the method looks like the following: public void ConfigureServices(IServiceC...

View detail
.net core entity-framework

SQLite in .NET Core with Entity Framework Core

41 views   0 comments last modified about 2 months ago

SQLite is a self-contained and embedded SQL database engine. In .NET Core, Entity Framework Core provides APIs to work with SQLite. This page provides sample code to create a SQLite database using package Microsoft.EntityFrameworkCore.Sqlite . Create sample project ...

View detail
asp.net core 2 .net core

Graphics Programming and Image Processing in .NET Core 2.x

25 views   0 comments last modified about 2 months ago

In .NET Core 2.x, Windows Forms or WPF are not implemented since they are based on GDI+ and DirectX respectively in Windows. In .NET Core 3.0, there is plan to add Desktop Packs which includes UWP. WPF and Windows Forms. However, they will still be Windows-only. In .NET Core applications, you may...

View detail
c#

Tuples in C# (4.x, 7.0, 7.1)

140 views   0 comments last modified about 6 months ago

What is a tuple? Tuple is an ordered sequence, fixed-size, immutable and of heterogeneous objects. Tuple has been existing in other languages such as F#, Python, Perl and etc. for a long time. It was first introduced into C# from C# 4.0 and has been evolving over time. Since C# 7.1, tuple...

View detail
lite-log hadoop hdfs

Invoke Hadoop WebHDFS APIs in .NET Core

277 views   0 comments last modified about 6 months ago

Background Apache doesn't provide native official .NET APIs for Hadoop HDFS. The HTTP REST API supports the complete FileSystem / ...

View detail
.net core

Logging configuration in .NET core

432 views   0 comments last modified about 11 months ago

.NET core introduces a logging API that works with a number of logging frameworks. The built-in providers are configurable and extensible to support different level loggings.

View detail
.net core

Sending Emails in .NET Core Applications

1439 views   0 comments last modified about 11 months ago

Sending emails are common in applications. For example, when user registers, we need to send account activation emails. This post summarize the approaches we can use to send emails in .NET Core 1.x and 2.x.

View detail
dotnet core asp.net core

Retrieve Http client request metadata like IP address and languages in asp.net core

1217 views   0 comments last modified about 11 months ago

IP Address In ASP.NET Core, Request.UserHostAddress has been removed though that attribute exists in the traditional ASP.NET applications. We can use HttpContext.Connection to retrieve the remove client IP address: var ipAddress = HttpContext.Connecti...

View detail

Migrating from ASP.NET Core 1.x to ASP.NET Core 2.0

1153 views   2 comments last modified about 12 months ago

Migrating from ASP.NET Core 1.x to 2.0 is not an easy job especially if you have customized Identity and used customized authentication. This post summarizes the issues and errors I have experienced and their resolutions when upgrading my project. Hopefully it can save you sometime if you are doi...

View detail