Skip to main content

116 posts tagged with "ASP.NET Core"

ASP.NET Core Framework for Building Web Applications

View All Tags

How to Let Requests Finish When an ASP.NET Core App Shuts Down (C#)

· 16 min read
Jagdish Kumawat
Founder @ Dewiride

When an ASP.NET Core app stops, it doesn't drop the requests it's still answering straight away: it stops taking new ones and gives the rest 30 seconds. A request that needs longer is cut off, and the caller gets an error instead of an answer. Here's that happening to a 40-second request, and the one setting that lets it finish.

Fixed: "System.InvalidOperationException: The service collection cannot be modified because it is read-only" in ASP.NET Core

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

My ASP.NET Core app stopped before it listened on anything, with System.InvalidOperationException: The service collection cannot be modified because it is read-only. The stack trace pointed at a builder.Services.Configure call that I had put after builder.Build(). Build() locks the list of services, so every registration has to come before it.

Fixed: Framing '…' Violates the Following Content Security Policy Directive: "frame-ancestors …" in a Teams Dialog

· 7 min read
Jagdish Kumawat
Founder @ Dewiride

A Teams dialog that should have shown my agent's web page showed a grey area with a sad-page icon, and the browser's console said Framing '…' violates the following Content Security Policy directive: "frame-ancestors https://teams.microsoft.com https://*.teams.microsoft.com". The page allowed Teams' old addresses, but Teams on the web now runs at teams.cloud.microsoft.

Fixed: The workflow factory returned workflow with name '', but the expected name is 'greeting'

· 8 min read
Jagdish Kumawat
Founder @ Dewiride

I registered a Microsoft Agent Framework workflow in ASP.NET Core with AddWorkflow, and the first request that used it answered 500 with System.InvalidOperationException: The workflow factory returned workflow with name '', but the expected name is 'greeting'. The function that builds the workflow has to name it, with exactly the name AddWorkflow passes to that function.