khalidabuhakmeh, to CSharp
@khalidabuhakmeh@mastodon.social avatar

12 lets you omit the body of an interface or type declaration, as an empty body is redundant.

I sense a great disturbance in the force like a million EditorConfig maintainers were shocked into silence all at once.

bradwilson, (edited ) to dotnet
@bradwilson@mastodon.social avatar

Sad realization for today: using formatted strings hides issues that CA1305 would find.

Overly simple example:

$"{myValue}"

vs.

myValue.ToString()

These are equivalent. Both (usually) implicitly and silently use CultureInfo.CurrentUICulture, but only the latter can be flagged as needing an explicit culture to ensure you're getting the value the way you want.

This kind of makes me want to rip out all instances of formatted strings now.

TimPurdum, to CSharp
@TimPurdum@dotnet.social avatar

No, MS Learn, there isn't only one answer here... 😩

TimPurdum, to blazor
@TimPurdum@dotnet.social avatar

I have ONE razor component with a razor.cs code-behind file that absolutely refuses to analyze as valid, even though it is. The .cs file is fine, but the .razor file can't find the file. It's super annoying, happens on multiple pcs, but is only this one, customer-owned page, so no idea how to report or share.

@khalidabuhakmeh any ideas?

maxim, to programming
@maxim@mastodon.gamedev.place avatar

Programmers, developers, coders!

Let's get to know each other in Mastodon

📻 Make a repost, write what you do and where you are from
🤝 Subscribe each other
🛰️ Let this signal pass through all obstacles

Let the wave flow! Halt and Catch Fire!

kedare, to dotnet
@kedare@g33ks.coffee avatar

Is there anyone using other languages than C# and F# on .NET ?
I remember back then there was the language but looks like it's not much used now.
Other alternative languages like and are either lagging a lot on supported version or abandoned apparently.

bradwilson, (edited ) to dotnet
@bradwilson@mastodon.social avatar

I see a lot of responses to the current Moq 4.20 issue being "now I have to port all my projects to something else".

Is anybody considering just rolling back to 4.18.4 and staying there?

Is anybody considering forking the project and giving it a new name, after removing SponsorLink? It's BSD licensed, so there shouldn't be any legal issues with doing so.

khalidabuhakmeh, to CSharp
@khalidabuhakmeh@mastodon.social avatar

I think should introduce the concept of global pure functions. And yes, I know exists.

The ceremony of encapsulating static types for static methods is just that, ceremony.

Ciantic, to azure
@Ciantic@twit.social avatar

Why is depolyment step still slow? It has been like this for at least 5 years. Sometimes it lasts nearly 20 minutes! It's the part that says: "Package deployment using ZIP Deploy initiated."

I know the gun-ho method, connecting via SFTP to AppService and syncing files then restarting. But that's just an ugly way of rapid deployment during development.

khalidabuhakmeh, to CSharp
@khalidabuhakmeh@mastodon.social avatar

I wonder why you can’t “nameof” private fields in . Anyone know?

khalidabuhakmeh, to CSharp
@khalidabuhakmeh@mastodon.social avatar

I just found the killer use case for primary constructors. I think it's excellent for reducing boilerplate in your @xunit test suites. Check it out!

khalidabuhakmeh, to CSharp
@khalidabuhakmeh@mastodon.social avatar

What are some expensive CPU operations that can be done in #csharp and #dotnet? Something that makes the CPU sweat.

hazel, to CSharp

Might have just found a bug in System.Text.Json. Stepping past this line results in an immediate NullReferenceException lol

khalidabuhakmeh, to dotnet
@khalidabuhakmeh@mastodon.social avatar

Did you know that you should use TextElementEnumerator to determine the length of a string if the input might have Unicode emojis? Check out the sample below.

I'm curious if future versions of should do this check implicitly. 🤔

joaofbantunes, to programming
@joaofbantunes@mastodon.social avatar

Look at what arrived in the mail 🙂
"C# For Babies", by some great folks from

khalidabuhakmeh, to CSharp
@khalidabuhakmeh@mastodon.social avatar

It would be neat if syntax lets you define a default constructor like this.

blooddemonarts, to CSharp

Hey people! I need to learn and for a new project. I already have a few years of experience with and spring boot framework.
Does anyone have any good recommendations of fast tutorials, articles, new concepts, etc. so that I can get to speed quickly with coding and testing in c# and .net? Any other tips are appreciated as well. Thanks!

khalidabuhakmeh, to godot
@khalidabuhakmeh@mastodon.social avatar

Spent some time changing a to a class. They look identical, but it seems the same hardcoded values work differently in GDScript vs. C#.

Does anyone want to have a look? I can't see what I did differently.

C# code

poppastring, to fediverse
@poppastring@dotnet.social avatar

Has anyone implemented Activity Pub with ASP.NET Core?

Not just types and objects but something that could be used for basic federation.

#activitypub #csharp #aspnet #aspnetcore

KristofferStrube, to dotnet
@KristofferStrube@hachyderm.io avatar

I think I see the value of primary constructors now. That is so sleek and simple. The only thing I'm wondering is whether all the newcomers to C# will be confused by seeing this when all tutorials out there use the "old" method.

video/mp4

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

What exactly is going on here? 🤔 The nullability attributes on Guard.ArgumentNotNull are working in lots of other places. 😕

The implementation of Guard.ArgumentNotNull, which is showing the [NotNull] annotation which tells the compiler that the value is not null.

Gjoel, to CSharp
@Gjoel@mstdn.dk avatar

My relationship to extension methods is a bit ambivalent. You can make some nice helper methods on classes you don't otherwise have access to, but it comes at a cost of, IMO more opaque code. Which can be fine if the benefit is there.

I have noticed people, however, making extension methods and placing them right next to the class or interface being extended, which in my view is just obfuscation. The argument being, that this particular set of helper functions do not belong in the class, so instead we extend the class.

By extending the class, you alter the class. Something might belong in the class in the current context, but not others (say, in test) but if the extension methods are implemented in the same project and namespace as the class itself, then it's functionally the same as adding the methods directly to the class. Only more difficult to navigate.

#csharp

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

I want CA2007 to be smarter.

There's no need to keep re-calling .ConfigureAwait(false) on every single task. The first one is good enough. I've already been shifted off the SyncContext, if there was one.

bradwilson, to dotnet
@bradwilson@mastodon.social avatar

Today I noticed that Visual Studio successfully uses source files from SourceLink, but VS Code (with the new C# Dev Kit) does not.

I wonder why. Anybody know?

nietras, to dotnet
@nietras@mastodon.social avatar

What options are there to improve Parallel.For runs when WorkerThreadStart is taking 70% of CPU usage?

#dotnet #csharp

  • All
  • Subscribed
  • Moderated
  • Favorites
  • megavids
  • thenastyranch
  • rosin
  • GTA5RPClips
  • osvaldo12
  • love
  • Youngstown
  • slotface
  • khanakhh
  • everett
  • kavyap
  • mdbf
  • DreamBathrooms
  • ngwrru68w68
  • provamag3
  • magazineikmin
  • InstantRegret
  • normalnudes
  • tacticalgear
  • cubers
  • ethstaker
  • modclub
  • cisconetworking
  • Durango
  • anitta
  • Leos
  • tester
  • JUstTest
  • All magazines