Andrew Lock "Sock"'s Avatar

Andrew Lock "Sock"

@andrewlock.bsky.social

Microsoft MVP and blogger, focused on ASP.​NET Core. Author of ASP.​NET Core in Action (https://mng.bz/5mRz) Blog: https://andrewlock.net Mastadon: @andrewlock@hachyderm.io Twitter: @andrewlocknet

2,331 Followers  |  334 Following  |  871 Posts  |  Joined: 12.10.2023  |  2.1701

Latest posts by andrewlock.bsky.social on Bluesky

What I don't really understand is if you're redirecting to somewhere on the same origin, then it should be covered by the CSP and not be violating as far as I can tell... But if your Auth is such that you redirect externally, then I'd expect you to hit the issue?

06.10.2025 11:54 — 👍 0    🔁 0    💬 1    📌 0
Application Security - Strict CSP form-action for login with Auth0 connections I’m trying to increase the security of our application’s CSP and I have run into issues during the login process. Specifically around the use of form-action on the login call. The same issue applies f...

You can see someone having a similar issue with redirects here: community.auth0.com/t/applicatio...

06.10.2025 11:50 — 👍 1    🔁 0    💬 1    📌 0
Preview
CSP: form-action and redirects · Issue #8 · w3c/webappsec-csp From @ptoomey3 on September 23, 2015 0:12 I just wanted to open an issue to get your thoughts on form-action with respect to redirects. We have been working on deploying form-action and have run in...

Ah, intriguing! It looks like if you have a redirect from a form submission, you need to have the final location in the CSP too 🤔

github.com/w3c/webappse...

Or put another way, form-action is basically broken in a bunch of scenarios, including PRG pattern🙄

06.10.2025 11:49 — 👍 0    🔁 0    💬 1    📌 0

Interesting, I'm out of the country for a couple of weeks but happy to take a closer look when I'm back if you haven't got to the bottom of it 😬 what's the exact error you're getting? 🤔

03.10.2025 16:34 — 👍 0    🔁 0    💬 1    📌 0

Any more details? I haven't tried it specifically, but you'll need to allow js sources at a minimum. client-side wasm needs wasm-unsafe-eval too. See learn.microsoft.com/en-us/aspnet... and also the section on frame-ancestors

03.10.2025 11:33 — 👍 0    🔁 0    💬 1    📌 0
Preview
Publishing NuGet packages from GitHub actions the easy way with Trusted Publishing In this post I describe how you can use nuget.org's new Trusted Publishing feature to publish NuGet packages from a GitHub Actions workflow

Blogged: Publishing NuGet packages from GitHub actions the easy way with Trusted Publishing

andrewlock.net/easily-publi...

In this post I describe how you can use nuget's new Trusted Publishing feature to publish NuGet packages from a GitHub Actions workflow

#dotnet #NuGet #GitHubActions

30.09.2025 12:52 — 👍 7    🔁 1    💬 0    📌 0

Tbh, it's not my area, so you'll probably be better of raising a ticket with support 🙂 Not trying to fob you off, just might be quicker for you! 😄

25.09.2025 16:58 — 👍 0    🔁 0    💬 1    📌 0

I think the main thing your missing is setting the resources like service.name, deployment.environment.name and service.version using the resource builder, though I can't find any good guidance for your to follow unfortunately

25.09.2025 16:50 — 👍 0    🔁 0    💬 1    📌 0
Preview
Datadog OTLP Metrics Intake Endpoint Datadog, the leading service for cloud-scale monitoring.

Nothing stands out tbh, RE the metrics, this is the docs logs for the metrics OTLP endpoint, (we're missing a .NET atm) docs.datadoghq.com/opentelemetr...

but the agentless page also says this:

> The Datadog OTLP intake endpoint is in Preview. To request access, contact your account representative

25.09.2025 16:47 — 👍 0    🔁 0    💬 2    📌 0

I'm still not quite sure if you want to use the .NET Datadog auto-instrumentation or Datadog.Trace package, or if you want to use pure OTel? This sample shows using the standard `AddOpenTelemetry()` APIs with auto-instrumentation, sending to a Datadog agent: github.com/DataDog/dd-t...

24.09.2025 20:53 — 👍 0    🔁 0    💬 3    📌 0
Preview
sleep-pc: a .NET Native AOT tool to make Windows sleep after a timeout In this post I describe a small native AOT .NET tool that I built to force a Windows PC to go to sleep after a timer expires

Blogged: sleep-pc: a .NET Native AOT tool to make Windows sleep after a timeout

andrewlock.net/sleep-pc-a-d...

In this post I describe a small native AOT .NET tool that I built to force a Windows PC to go to sleep after a timer expires

#dotnet

23.09.2025 17:06 — 👍 12    🔁 3    💬 0    📌 0

Hey, I don't have any articles about it, but just to check - how are you configuring "native OTEL"? If it's just using the "standard" Otel packages (i.e. nothing Datadog specific, no Datadog.Trace etc) then you should just be able to point the exporter at the Datadog OTEL collector endpoint

22.09.2025 20:21 — 👍 0    🔁 0    💬 1    📌 0

As requested, I published an article about how the UI profiler works: minidump.net/measuring-ui...
It allows me to measure the responsiveness of Visual Studio when running with ReSharper, in various conditions.

I also made the source code available on github: github.com/kevingosse/U...

18.09.2025 12:54 — 👍 15    🔁 7    💬 1    📌 0
Preview
.NET STS releases supported for 24 months - .NET Blog .NET STS releases will be supported for 24 months

.NET STS releases are now supported for 2 years instead of 18 months starting with .NET 9 (the current STS). STS releases now go out-of-support on the same day as the previous LTS release. Upgrading to an STS release will no longer cause you to lose support!
devblogs.microsoft.com/dotnet/dotne...

16.09.2025 17:56 — 👍 79    🔁 36    💬 8    📌 6
Preview
Supporting platform-specific .NET tools on old .NET SDKs: Exploring the .NET 10 preview - Part 8 In this post I look at the advantages, trade-offs, and implications of the new platform-specific .NET tool feature added in .NET 10, and how to support old SDKs

Supporting platform-specific .NET 10 tools on old .NET SDKs
Exploring the .NET 10 preview - Part 8

andrewlock.net/exploring-do...

In this post I look at the advantages, trade-offs, and implications of the new platform-specific .NET tool feature added in .NET 10 and how to support old SDKs

#dotnet

16.09.2025 18:00 — 👍 1    🔁 1    💬 0    📌 0
Preview
Packaging self-contained and native AOT .NET tools for NuGet: Exploring the .NET 10 preview - Part 7 In this post we look at the new support for platform-specific .NET tools, so that you can pack your tools as self-contained or Native AOT packages

Blogged: Packaging self-contained and native AOT .NET tools for NuGet - Exploring the .NET 10 preview - Part 7

andrewlock.net/exploring-do...

This post looks at the new support for platform-specific .NET tools that lets you pack tools as self-contained or Native AOT packages

#dotnet

09.09.2025 17:45 — 👍 9    🔁 1    💬 0    📌 0
Post image

If you're using github.com/VerifyTests/..., e.g. to protect your library's public API, also check out plugins.jetbrains.com/plugin/17240... created by Mathias Koch.

06.09.2025 13:02 — 👍 4    🔁 2    💬 0    📌 0

Great post! Something I think missed (because it is not correctly documented😀) is `dotnet tool install --allow-roll-forward`. You can use this when installing a tool to force it to allow roll forward, even if the tool itself doesn't.

Unfortunately I can't recall which SDK introduced it.

02.09.2025 19:36 — 👍 2    🔁 2    💬 1    📌 0

Agreed, I'm fairly sure that _is_ supported in general, and I've certainly used it in the past. I should have put it in the post 👍

The main 'problem' from my PoV is that this puts the onus on the consumer of the tool to _know_ that it's available, though it's also arguably 'better' 😀

02.09.2025 20:55 — 👍 0    🔁 0    💬 1    📌 0
Preview
Using and authoring .NET tools In this post I describe some of the complexities around authoring .NET tools, specifically around supporting multiple .NET runtimes and testing in CI

Blogged: Using and authoring .NET tools

andrewlock.net/using-and-au...

In this post I describe some of the complexities around authoring .NET tools, specifically around supporting multiple .NET runtimes and testing in CI

#dotnet

02.09.2025 17:52 — 👍 10    🔁 5    💬 1    📌 0
Preview
Fixing an old .NET Core native library loading issue on Alpine In this post I walk through the process of solving a native library loading issue on alpine with an old .NET runtime, showing the steps we took and the solution

Blogged: Fixing an old .NET Core native library loading issue on Alpine

andrewlock.net/fixing-an-ol...

In this post I walk through the process of solving a native library loading issue on alpine with an old .NET runtime, showing the steps we took and the solution

#dotnet

26.08.2025 17:41 — 👍 13    🔁 4    💬 1    📌 0

It'll obviously become increasingly important as more libraries and Frameworks support it though, so it's nice to have a test framework that can actually support those scenarios!

20.08.2025 20:24 — 👍 2    🔁 0    💬 0    📌 0

Yeah that's fair, I guess I still consider AOT in general to mostly be a party trick for the majority of companies, hence my bias there

20.08.2025 20:23 — 👍 0    🔁 0    💬 1    📌 0
Post image

Running .NET in the browser without Blazor by @andrewlock.bsky.social andrewlock.net/running-dotn... #aspnetcore #blazor

19.08.2025 08:44 — 👍 2    🔁 1    💬 0    📌 0
Preview
Converting an xUnit test project to TUnit In this post I discuss the new TUnit testing framework, why I ported one of my libraries to use it instead of xUnit and related issues I had to deal with

Blogged: Converting an xUnit test project to TUnit

andrewlock.net/converting-a...

In this post I discuss the new TUnit testing framework, why I ported one of my libraries to use it instead of xUnit and related issues I had to deal with

#dotnet #testing

19.08.2025 18:00 — 👍 19    🔁 7    💬 2    📌 0
Preview
Reset Cookies and force new sign-in using ASP.NET Core Identity This post looks at implementing a cookie reset in an ASP.NET Core application using Duende identity server which federates to Entra ID. Sometimes cookies need to be reset for end users due to size …

Blogged: Reset Cookies and force new sign-in using ASP.NET Core Identity

damienbod.com/2025/08/18/r...

#aspnetcore #identity #iam #cookie #duende #dotnet #net

18.08.2025 05:18 — 👍 4    🔁 3    💬 0    📌 0

Redid the way my content engine handled file watchers thanks to this post ( and @maartenballiauw.be, @woodruff.dev , @khalidabuhakmeh.mastodon.social.ap.brid.gy on @breakpoint.show ). Took the drifter example and tweaked it so that the lifetime of the object is determined by a file watcher.

14.08.2025 04:15 — 👍 3    🔁 2    💬 1    📌 0
Preview
Passkey support for ASP.NET Core identity: Exploring the .NET 10 preview - Part 6 In this post I look at the passkey support added to ASP.NET Core Identity and the Blazor Web App template, explore how it works, and look at the implementation

Andrew Lock explains that .NET 10 preview 6 adds passkey support to ASP.NET Core Identity, enabling passwordless login with WebAuthn in the new Blazor template. via andrewlocknet https://andrewlock.net/exploring-dotnet-10-preview-features-6-passkey-support-for-aspnetcore-identity/

13.08.2025 03:04 — 👍 4    🔁 1    💬 0    📌 0
Preview
Running .NET in the browser without Blazor In this post I show how to run .NET in your browser without using Blazor, and instead rely on lower-level abstractions provided by [JSImport] and [JSExport]

Blogged: Running .NET in the browser without Blazor

andrewlock.net/running-dotn...

In this post I show how to run .NET in your browser without using Blazor, and instead rely on lower-level abstractions provided by [JSImport] and [JSExport]

#dotnet #aspnetcore #wasm #webassembly

12.08.2025 16:04 — 👍 18    🔁 5    💬 0    📌 0
A screenshot of "dotnet make" in action

A screenshot of "dotnet make" in action

A while back, I created "dotnet make" which will invoke your favourite build tool (cake, fake, make, nuke, csproj, fsproj, proj, sln) by convention, regardless of the current working directory in the repository.

github.com/patriksvenss...

05.08.2025 23:25 — 👍 26    🔁 11    💬 2    📌 0

@andrewlock is following 19 prominent accounts