Blog

Blog posts on .NET, Azure, and more.

Azure Functions - Could not load file or assembly System.Text.Encoding.CodePages

November 27, 2021 by Anuraj

Azure Functions Serverless

This post is about how to fix the exception Could not load file or assembly System.Text.Encoding.CodePages when you’re using any HTML parser in Azure Functions. Recently while working on Azure Static Web App, I faced an issue like this. I created an Azure Function in Dotnet, which helps to parse HTML from URLs. I was using a nuget package - OpenGraph-Net. And after I deployed the function, it is started throwing this error - Exception while executing function: <Function Name> Could not load file or assembly 'System.Text.Encoding.CodePages, Version=5.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'. The system cannot find the file specified. It is working properly on my machine.

Working with model validation in Minimal APIs

November 17, 2021 by Anuraj

AspNetCore

This post is about implementing model validation in ASP.NET Core Minimal APIs. Minimal APIs do not come with any built-in support for validation. In this post we will explore how to build one and we explore will use some other libraries which can be used to implement validations.

GraphQL multiple requests and EF Core DbContext

November 16, 2021 by Anuraj

AspNetCore GraphQL DotNet6 EFCore

GraphQL support multiple operations in a single query. So that you can query multiple objects in a single request. Here is an example.

GraphQL in ASP.NET Core with EF Core

November 16, 2021 by Anuraj

AspNetCore GraphQL DotNet6 EFCore

This post is about GraphQL in ASP.NET Core with EF Core. In the earlier post I discussed about integrating GraphQL in ASP.NET Core with HotChocolate. In this post I will discuss about how to use GraphQL on top EF Core.

Getting started with GraphQL in ASP.NET Core

November 15, 2021 by Anuraj

AspNetCore GraphQL DotNet6

This post is about GraphQL in ASP.NET Core. GraphQL is a query language for APIs and a runtime for fulfilling those queries with your existing data. GraphQL provides a complete and understandable description of the data in your API, gives clients the power to ask for exactly what they need and nothing more, makes it easier to evolve APIs over time, and enables powerful developer tools. GraphQL implemented using HotChocolate package. To get started, create an empty web project using dotnet web command and then add reference of HotChocolate.AspNetCore package using dotnet add package HotChocolate.AspNetCore command. Once it is done, you can modify the program.cs file like following. I am using .NET 6.0 for this. So there is no Startup.cs and configure and configureservices() methods.

Copyright © 2024 Anuraj. Blog content licensed under the Creative Commons CC BY 2.5 | Unless otherwise stated or granted, code samples licensed under the MIT license. This is a personal blog. The opinions expressed here represent my own and not those of my employer. Powered by Jekyll. Hosted with ❤ by GitHub