Skip to main content

Posts

global.json file

  Symptoms Suddenly you get build errors in your build pipeline which perfectly builds in your local machine 🤔🤔🤔 Cause Most likely the root cause is .NET SDK versions. Your local machine builds on a different SDK and the pipeline builds on a different SDK. Resolution The ideal way of solving this is to force everyone to use one define .Net SDK. Regardless of whether it is a developer or CI pipeline. Simply to make this happen .NET  provides you a file called "global.json". The global.json file allows you to define which .NET SDK version is used when you run .NET CLI commands. Selecting the .NET SDK version is independent from specifying the runtime version a project targets. For information about specifying the runtime version instead of the SDK version, see Target frameworks . If you always want to use the latest SDK version that is installed on your machine, no global.json file is needed. Into the Depth The sample global.json file looks like the below, {    ...

ASP.NET Core 3.1 - Setting up React app with Typescript

With the release of .NET Core 3.1, I have decided to migrate one of my .NET core 2.1 solutions which contain ASP.NET core API project, React Web project (ASP.NET core project with react typescript template) and .NET Core Library project.  So I started the migration with the Library and API projects. Based on my experience, I think it was not a smooth migration due to the vast number of breaking changes but I managed to up and run both projects. Lastly, I have started to migrate the React ASP.NET core project. It was chaotic but I managed to up and run the project. Thought it worked I got some issues here and there so I decided not to continue with the same project rather create a new ASP.NET Core 3.1 React TypeScript template project. When you are going to create a new project, Visual Studio provided you a list of templates where you can pick desired Even though we have a project template for ASP.NET Core with React JS, there is no direct project templ...

Setup Azure AD B2C: Identity providers & Policies

This blog post will be the second part of the Setup Azure AD B2C blog series. From this blog post, we will be able to set up identity providers and policies to the Azure B2C AD. Identity providers An identity provider (abbreviated IdP or IDP ) is a system entity that creates, maintains, and manages identity information for principals while providing authentication services to relying applications within a federation or distributed network Azure AD B2C - Identity providers Azure supports many identities such as social, enterprise, or local account identities in B2C AAD. The following image shows some of the identity providers that currently B2C AAD support. As you can see AAD B2C Supports numerous identity providers. Except for Local account every other identity provider, you have to configure manually. Configure Social IDP In order to use social identity providers, we need to configure them first. Different identity providers use different ways to configure IDP. So ...

React: åäö swedish characters shown as �

Last few months, I have started working on a web application that belongs to a Swedish client. Since this application's target audience is Swedish people, we were only focused on the Swedish language as the application language. We have hardcoded all the labels (I know it is not a good practice but for this case that was fine 😉). Then we figured out something is wrong when it rendered in the HTML. Symptoms All the special Swedish characters were rendered as � åäö Swedish characters shown as � Cause This is most likely caused by the encoding.  Resolution Ideally, you can overcome this issue by providing a metadata tag for  "charset".   In your   index.html   file, add the following meta tag to the header section. < meta charset = "UTF-8" > Simply, when you declare the "charset" as "UTF-8", you are telling your browser to use the UTF-8 character encoding, which is a method of converting your typed characters into ma...

Setup Azure AD B2C

Azure Active Directory B2C Briefly, Azure Active Directory (Azure AD) B2C is a business-to-consumer identity management service. This service enables you to customize and control how users securely interact with your web, desktop, mobile, or single-page applications. Using Azure AD B2C, users can sign up, sign in, reset passwords, and edit profiles. Azure AD B2C implements a form of the OpenID Connect and OAuth 2.0 protocols. The important key in the implementation of these protocols is the security tokens and their claims that enable you to provide secure access to resources. read more Ingredients for set up an Azure AD B2C resource Ingredients that you need to have in-order to set up an Azure AD B2C Microsoft Azure account with a valid subscription associated. Azure AD B2C tenant resource with necessary policies Directions I hope that you have a Microsoft Azure account with a valid subscription associated. If you don't have an account, create an account with th...

VSTS Package Management

Visual Studio Team Services provide asserts such as source code, builds, releases, etc. You may also know that it is also allowed to add/install extensions to give extra value. Microsoft marketplace  list all the extensions available for VSTS. VSTS Package Management Click this link to download the Package Management extension. You should have admin level permission to install/add an extension. Package Management is an extension that hosts NuGet, npm, and Maven packages in VSTS. This blog post helps you to Create, host, and share packages with your team. I have use NuGet option for this blog post. Create Packages Open your Solution in Visual Studio. Right-click on the desired Project and select Project Property . It will open the Project Property Window. Select Package tab. In that form, you can edit necessary fields accordingly. Most important fields or the required fields filled with default values. Underline felids in the below two screenshots ...