Tuesday, November 27, 2018

Visual C# and ASP.NET Technical Guru - October 2018

Another month as a judge in Microsoft TechNet Guru Awards. And this it’s under both Visual C# and ASP.NET category. The TechNet Guru Awards celebrate the technical articles on Microsoft TechNet.

Post in WikiNinjas Official Blog,
image
]Visual C# Technical Guru - October 2018
Well, this time under Visual C# there were not many articles as it was used to be. Got into judging ASP.NET Category as well.
image
ASP.NET Technical Guru - October 2018
Happy Coding.

Regards,
Jaliya

Sunday, November 25, 2018

Visual Studio 2017 Version 15.9 and .NET Core Tooling

A couple of days back Visual Studio 2017 Version 15.9 was released and it is the final minor update to Visual Studio 2017. As of now, 2 service updates have been already released and currently, it’s on 15.9.2.
image
Visual Studio About
One of the major features released with Visual Studio 15.9 is an update to how Visual Studio Tools for .NET Core determines the version to .NET Core SDK to use with.

Prior versions were using whatever the latest .NET Core SDK installed in your machine, meaning that even if you have installed a preview version of .NET Core SDK, a stable version of Visual Studio was using that preview version.

So starting from Visual Studio 15.9, it will be defaulted to use the latest stable .NET Core SDK installed in your machine. But you can always choose to opt-in to use the preview versions of .NET Core SDK in Visual Studio by going to Tools->Options->Projects and Solutions->.NET Core and selecting Use previews of the .NET Core SDK.
image
.NET Core Options
I also have the latest preview version of Visual Studio 2017 installed which is Version 15.9.0 Preview 6.0 as of now.
image
Visual Studio About
But in the preview versions, I can’t opt out from using the preview versions of .NET Core SDK.
image
.NET Core Options
The option is disabled and the reason is, for Visual Studio to work properly, it needs the preview versions.

Hope this helps.

Happy Coding.

Regards,
Jaliya

Tuesday, November 20, 2018

Wrote a post on Wiki Life at Official Blog of TechNet Wiki

Wrote a post in Wiki Ninjas - Official Blog of TechNet Wiki. The title of the post is TNWiki Article Spotlight - Blazor: CRUD Using MongoDB.
image
TNWiki Article Spotlight - Blazor: CRUD Using MongoDB

Happy Coding.

Regards,
Jaliya

Sunday, November 18, 2018

ASP.NET Core: Important Things to Consider When Configuring Cookie Authentication

In this post, let’s go through two of the important things to consider when configuring Cookie Authentication in an ASP.NET Core Application.
services
     .AddAuthentication(CookieAuthenticationDefaults.AuthenticationScheme)
     .AddCookie(CookieAuthenticationDefaults.AuthenticationScheme, x =>
     {
          // other configuration
          x.Cookie.SecurePolicy = CookieSecurePolicy.SameAsRequest;
          x.Cookie.SameSite = SameSiteMode.None;
     })
Cookie.SecurePolicy and Cookie.SameSite plays a major role in Cookie authentication.

Cookie.SecurePolicy

This is an enum of type CookieSecurePolicy.
  • SameAsRequest: This is the default. If the server has provided the cookie to the client over HTTP, then all subsequent HTTP and HTTPS requests can return the cookie to the server. If it was over HTTPS, only HTTPS requests can take the cookie back.
  • Always: When this is set, your cookie will only sent in HTTPS requests.
  • None: When this is set, even the cookie is sent to the client in HTTPS, all your HTTP and HTTPS requests can take the cookie back to the server.

Cookie.SameSite

This is an enum of type SameSiteMode. This specifies how the cookie will be sent in cross-site requests.
  • None: No mode is specified.
  • Lax: The cookie will be sent with "same-site" requests, and with "cross-site" top-level navigation.
  • Strict: When the value is Strict, or if the value is invalid, the cookie will only be sent along with "same-site" requests.
An important thing to note is, the Cookie Policy Middleware setting for MinimumSameSitePolicy will override your setting of Cookie.SameSite as the matrix below. (Reference: Cookie Policy Middleware)
image
Matrix
Hope this helps.

Happy Coding.

Regards,
Jaliya

Thursday, November 1, 2018

Visual C# Technical Guru - September 2018

Another month as a judge in Microsoft TechNet Guru Awards under Visual C# category. The TechNet Guru Awards celebrate the technical articles on Microsoft TechNet.

Post in WikiNinjas Official Blog,
https://blogs.technet.microsoft.com/wikininjas/2018/11/01/technet-guru-awards-september-2018/

image
Visual C# Technical Guru - September 2018
Happy Coding.

Regards,
Jaliya