Manuel Zelenka
banner
dev-in-disguise.bsky.social
Manuel Zelenka
@dev-in-disguise.bsky.social
Lead Developer @AdmiralTechnologies (C#/.NET) | Family man | Liverpool FC supporter | Rock/Metal/Prog enthusiast
public enum Fruit {
Apple,
Orange,
Pear = Apple,
Banana
}

What would you expect the output of Console.WriteLine(Fruit.Banana); to be?

I at least was surprised to see that it is Orange. Such a weird quirk with high potential for bugs.
November 16, 2025 at 7:58 AM
Ah, so wasteful with these pesky whitespaces and equal signs. Let's do: Fruit.Banana shorthand;

And the name for the feature writes itself: pattern assignment!
November 13, 2025 at 9:46 PM
Do you want that more stuff will be tagged as AI generated? Because that's how you get more stuff being tagged as AI generated 😅
August 28, 2025 at 8:07 AM
I enjoy both. Though honestly I love using existing stuff. Specifically old legacy stuff that you can improve tremendously and see in real time how customer and developer experience goes through the roof!
August 13, 2025 at 2:00 PM
Understandable. @jodydonetti.bsky.social did a fantastic job on them
June 22, 2025 at 5:16 PM
That's a big shot but clearly a great vision statement. Under those circumstances it makes sense then, I agree.

I really hope that it will be used in non .NET projects since that would be another great entry point to the ecosystem.
June 1, 2025 at 8:00 AM
Sounds like you're doing it because you can and not because it makes sense.

Because when you need an apphost your original project most likely is already using a csproj.

What kind of scripts would even require an apphost that would make this change meaningful?
June 1, 2025 at 6:46 AM
If consumers notice such things and are aware of such scams I do hope that they don't trust the web shop if it's using AI to show off a product
April 1, 2025 at 8:56 AM
Apart from the fact that the companies involved have to take action for the consumers in this specific example it seems pretty clear to me from the images that they are AI generated.
Just look at the box and the shapes that are supposed to look like rabbits. Then the text below the ribbon. ...
April 1, 2025 at 8:56 AM
I'm kind of disappointed. I wanted to use my train ride to work for setting this up but I'm done already and everything works out of the box...

Screw you great dev experience! What shall I do now? 🤣
March 18, 2025 at 6:02 AM
Makes sense then why the fix didn't work so far 😅
Thanks for the heads-up!
March 18, 2025 at 5:44 AM
But @captainsafia.com fixed this scenario 2 weeks ago and apparently it's already part of the new 9.0.3 runtime of ASP.NET Core 🥳

So onwards to the download and let's see if I can remove my workaround!

github.com/dotnet/aspne...
Fix OpenAPI server URLs for Aspire scenarios by captainsafia · Pull Request #60673 · dotnet/aspnetcore
Description This PR supports respecting he X-Forwarded-Proto and X-Forwarded-Host headers when generating server URLs in OpenAPI documents. When these headers are present in the request, the OpenAP...
github.com
March 17, 2025 at 8:01 AM
Seems like I get to the bleeding edge of Aspire/.NET development now 😁

I could solve my issue by not using Env Vars but by setting the servers to an empty array. Scalar then picks window.location as a fallback.

Which is fine for now.
March 17, 2025 at 8:01 AM
Looking at this today a bit deeper it's nice to know about this functionality. But it isn't what I want.

I want to be able to send my requests in Scalar against Aspires reverse proxy. Which means I have to introduce an Environment Variable that will set the server to the reverse proxies URL
March 17, 2025 at 7:40 AM
Quick follow up: the mentioned short uses a custom Aspire command. So nice to know that this exists!

Though that means I will most likely have to implement this myself since the video does not deal with multiple instances
March 16, 2025 at 5:49 PM
But not today! My son has decided to wake up 😁
March 16, 2025 at 1:30 PM
Quickly searching I found a YT Short by Milan Jovanovic that adds a WithScalar extension in the apphost.

Maybe this will solve my issue 🤞
March 16, 2025 at 1:29 PM
Also interesting: I use Scalar in my API as a UI for my OpenAPI definition. When I navigate to the reverse proxies URL to scalar it is shown.

But trying to run a test request only allows going against one instance of the APIs. Probably the one the reverse proxy hit when opening Scalar.
March 16, 2025 at 1:29 PM
One question maybe @james.newtonking.com can answer: is there a specific algorithm implemented in the reverse proxy which instance gets the next request? Round robin?

At least it looks like it always switches between my 2 instances.
March 16, 2025 at 1:21 PM
Wait a second, I'm telling crazy stories! It was the same Port from the launchsettings!

The reverse proxy uses the port defined in the launchsettings of my project and the projects themselves get own Ports by Aspire.
March 16, 2025 at 1:15 PM
Nice!

WithReplicas is what I should have used from the get go.

And the reverse proxy mention makes it clear to me why both instances of my API showed the same Port in the dashboard which wasn't the one from the launchsettings.
March 16, 2025 at 1:10 PM