Just Simply Code

Another developer blog

  • Home
  • About
  • Register
  • Policy

Year: 2022

Fixing “Unchecked runtime.lastError: The message port closed before a response was received” for browser extension

25 December 2022 / Leave a Comment

In this previous post, I showed how to implement a Chrome Browser extension to talk to a native app on user local machine. Recently, we added support for Microsoft Edge browser and published to Microsoft Edge Add-ons store. We then received reports from some testers in the team that the Edge extension does not work … [Read more…]

Posted in: Uncategorised Tagged: Browser extension, Native Messaging

Setting client certificate when registering HttpClient in .NET Core

4 December 2022 / Leave a Comment

In my current project, we have to integrate with a third party API. One of the security requirements is to use mTLS. This means we have to pass the client certificate when sending HTTP requests to the third party. Since we’re using named HttpClient, we can specify the client certificate when registering the HttpClient in … [Read more…]

Posted in: Uncategorised Tagged: .Net Core, HttpClient, mTLS

Database migration not running after upgrading to EF Core 6.0

13 November 2022 / Leave a Comment

We had upgraded to EF Core 6.0 for a while now but we haven’t had any schema change with migrations since before the upgrade. One of the recent changes had a migration and we noticed that the migration was never run. We tested other projects that also had upgraded to EF Core 6.0 and they … [Read more…]

Posted in: Uncategorised Tagged: .Net Core, EF Core

Integration tests with dockerized SQL Server

23 October 2022 / Leave a Comment

Recently, a friend of mine asked me if there’s a better way to run integration tests without using in-memory DB because in-memory DB does not behave exactly like the real thing. In my opinion, the repository should be simple and not contain any business logic. Hence mocking the data in the in-memory DB for the … [Read more…]

Posted in: Uncategorised Tagged: .Net Core, Docker, EF Core, Integration Test, SQL, Unit Test

Fix AuthenticationSchemes not respected in multiple authentication schemes in .NET

2 October 2022 / Leave a Comment

In a recent project, I had to add support for multiple identity providers. Some endpoints/controllers will be restricted to a particular identity provider while others can be authenticated with either identity provider. Even though we only had one identity provider, we actually already constructed it in a way where it’s a collection of multiple providers. … [Read more…]

Posted in: Uncategorised Tagged: .Net Core, AuthenticationSchemes

Generic abstract class implementing another generic class and multiple interfaces with constraint

11 September 2022 / Leave a Comment

In one of my recent projects, I needed to create a new generic abstract class which implements another generic class and a couple other interfaces. I also needed to restrict the generic type in this generic abstract class to a specific type This is not something I commonly need to do so I was not … [Read more…]

Posted in: Uncategorised Tagged: .Net Core, Generics

MS Orleans silos cannot find each other after a re-run

21 August 2022 / Leave a Comment

In my previous post, I showed how to add MS Orleans to an existing WebAPI application. I also mentioned my frustrations around the documentation for MS Orleans. In the documentation, it says that Cluster ID ‘is a unique ID for the Orleans cluster. All clients and silos that use this ID will be able to … [Read more…]

Posted in: Uncategorised Tagged: .Net Core, Ms Orleans

Fixing DI lifetime scope getting disposed after adding MS Orleans

31 July 2022 / Leave a Comment

In the previous post, I showed how to add MS Orleans to an existing WebAPI application. If you happen to use Entity Framework and you run your database migration in Program.cs before you run the application, you might get the below exception after adding MS Orleans ‘Instances cannot be resolved and nested lifetimes cannot be … [Read more…]

Posted in: Uncategorised Tagged: .Net Core, Dependency Injection, Ms Orleans

Adding MS Orleans to .NET WebAPI application with DynamoDb

10 July 2022 / Leave a Comment

Recently I worked a discovery piece of work where I had to add MS Orleans to an existing WebAPI application. MS Orleans supports different types of storage, including Azure Table, SQL server and DynamoDb. I wanted to use DynamoDb and what I found was there weren’t a lot of documentation on how to add MS … [Read more…]

Posted in: Uncategorised Tagged: DynamoDb, Ms Orleans, WebAPI

Find a child node from XmlNode with ignoring namespaces

19 June 2022 / Leave a Comment

Given a XmlNode object, I needed to get the first children node by name. I used the SelectSingleNode method, providing a valid Xpath, but it didn’t work. For example, I need to get the first child node named Signature from the xmlNode It took me a bit of time to realise that the Signature node … [Read more…]

Posted in: Uncategorised Tagged: .Net Core, XML
1 2 Next »

Search Posts

Recent Posts

  • Override IHttpRequestBodyDetectionFeature.CanHaveBodyOverride value in .NET Core Web API
  • Allow empty request body in PUT and POST HTTP requests in .NET Core Web API
  • Modify request body with middleware in .NET Core Web API
  • Running MS Orleans on AWS ECS
  • Respect leading and trailing spaces when querying SQL Server
Support my blog here!Support my blog!

Archives

  • July 2024
  • June 2024
  • July 2023
  • April 2023
  • January 2023
  • December 2022
  • November 2022
  • October 2022
  • September 2022
  • August 2022
  • July 2022
  • June 2022
  • May 2022
  • April 2022
  • March 2022
  • February 2022
  • December 2021
  • November 2021
  • October 2021
  • September 2021
  • August 2021
  • July 2021
  • June 2021
  • May 2021
  • April 2021
  • March 2021
  • February 2021
  • January 2021
  • December 2020
  • November 2020
  • October 2020
  • September 2020
  • August 2020
  • July 2020
  • June 2020
  • May 2020
  • April 2020
  • March 2020
  • February 2020
  • January 2020
  • December 2019
  • November 2019
  • October 2019
  • September 2019
  • August 2019
  • July 2019
  • June 2019
  • May 2019
  • April 2019
  • March 2019
  • February 2019
  • January 2019
  • December 2018
  • November 2018
  • October 2018
  • September 2018
  • August 2018
  • July 2018
  • June 2018
  • May 2018
  • October 2017
  • September 2017
  • July 2017
  • June 2017
  • May 2017
  • April 2017
  • March 2017
  • February 2017
  • January 2017
  • December 2016
  • November 2016
  • October 2016
  • September 2016
  • July 2016
  • June 2016
  • March 2016
  • February 2016
  • January 2016

Copyright © 2025 Just Simply Code.

Me WordPress Theme by themehall.com