C Sharp

1533 readers
1 users here now

A community about the C# programming language

Getting started

Useful resources

IDEs and code editors

Tools

Rules

Related communities

founded 1 year ago
MODERATORS
76
77
 
 

I've been teaching myself C# for the last 2 years or so. I've got a reasonable handle on a lot of the language/ programming in general. However I feel like I'm massively missing the mark when it comes to debugging.

I deal with a lot of multithreaded and real-time applications that interact with physical hardware. I can set breakpoints and inspect variable values at the breakpoint, step into, step over, etc. But the "autos" and "locals" windows are something I don't understand.

Are there any decent courses/resources that teach me some intermediate debugging skills. Particularly interested in resources that focus on Visual Studio tools (extra points for resources that include tips on VS Enterprises debugging tools, like step backwards, etc.).

Appreciate anyone pointing me in the right direction! I've learnt by feel up to this point, but I've hit a wall and could use some structured docs or courses.

78
79
5
submitted 1 year ago by Ghgore to c/csharp
 
 

I'm looking for a Linear Algebra library to perform calculations for circuit analysis, which ones would you recommend?

80
10
submitted 1 year ago* (last edited 1 year ago) by starman to c/csharp
 
 

Link to GitHub issue: https://github.com/dotnet/csharplang/issues/7009

Link to video explaing it: https://youtu.be/91xir2oUQPg

81
6
submitted 1 year ago by Fractal to c/csharp
 
 

Hi all! Trying to work with small pet project for myself. So I use few asp net core apps + db in docker and docker compose. And I little confuse about storing configuration (like for logging or db connection etc). Where is best place to store it? Continue use app.json or move .env files (enviroments variables)

I guess .env files more easy to configure f.e. on CI\CD So whatis a better?

82
 
 

There are many YouTube channels that specializes on C#, but not all of them are created equal. So, I thought, it would be good to share the ones that we think is worth taking a look at.

83
 
 

Hey guys,

I'm looking for a complete guide to C#. If it covers basic programming paradigms as well that would be a plus as I have coded a bunch of stuff but am lacking in theoretical knowledge.

I'm definitely open to spending money for a book or something like that. A full course would be outside of my price range though.

Maybe someone has any good suggestions! I obviously tried googling and had a look at microsofts learning resources but without having some feedback as to how good they are it is difficult to choose something.

84
 
 

I want to learn C# but I can't find time for it (even if I have entire days available)

85
 
 

With regards to null conditional operators, calling properties and methods will work fine, e.g.:

HttpContext.Current?.Response.Clear();

But I'm wondering if assignment is possible? I get this error when trying to do this:

HttpContext.Current?.Response.ContentType = "text/json";

The docs say:

The null-conditional operators are short-circuiting. That is, if one operation in a chain of conditional member or element access operations returns null, the rest of the chain doesn't execute.

So wondering if it's possible and I'm doing it wrong, or am I taking "does not execute" too literally? :)

86
 
 

Recently an idea came across my mind, and that is with all the fuss around Lemmy and fediverse in general, that i could spend my nights working on something instead of watching random YouTube stuff. So I've decided i could start building some kind of Android app, which will just be my time killer for the time being.

Just for some background info - I'm by no means considering myself a programmer, but I do write a lot of scripts/extensions/forms for software we use at work, which is mainly Microsoft stuff associated with .NET, so when it comes to programming I'm most familiar with C# and the whole .NET ecosystem. Lately I've also got into JS/TS with React as I wanted to create my own website.

Because I like C# as a language, i was looking into building this project in some kind of cross platform framework. I researched and found out about MAUI, Avalonia UI and such. As I was researching I found a lot of opinions on those frameworks, some of which were positive and some of which were negative. The negative ones outweigh the positive ones (bugs, broken basic features, messy workarounds, outdated underlying platform APIs) and such. I do know that such framework cannot be perfect because there is a lot of going on, and I would like to hear some more opinions.

So guys what are your experiences with those .NET frameworks? How is the XAML holding up? And do you think I would be better learning Flutter/Dart or straight up Kotlin, as the only platform I'm willing to develop for is Android?

Thanks!

87
88
 
 

New features for those who haven't seen them:

// Primary constructors
public class NamedItem(string name)
{
    public string Name => name;
}

// Default lambda params
var IncrementBy = 
    (int source, int increment = 1) => 
        source + increment;

Console.WriteLine(IncrementBy(5)); // 6
Console.WriteLine(IncrementBy(5, 2)); // 7

// Type aliases
using Point = (int x, int y);
89
 
 

Found this while researching how this fediverse thing works. ActivityStreams provide the vocabulary for interacting with Activitypub, which is the protocol the fediverse uses.

Here's more on ActivityPub, for the interested

90
10
submitted 1 year ago by angrysaki to c/csharp
 
 

I'm partly just posting this to get some more content going here...

...but I've been using Rider for the past year or so, and I'm not sure I can say it's better than Visual Studio. I find anytime it comes up it's all praise for Rider (including the debugger, which i find to be crap)

The Pros:

--IdeaVim is better than VsVim

--Feels a bit snappier

--The find in files pops up in a dialog box with "display as you type"

Cons:

--I really don't like the debugger layout. It's not customizable at all and I find I'm going back and forth between tabs all the time

--The debugger also doesn't have a second watch window, which blows my mind. (I often want to compare the state of 2 variables side by side, which is a huge pain in Rider)

--It has a bad bug where sometimes it won't recompile my changes, so I have adopted the workflow of always deliberately building before debugging, which is annoying.

--Doesn't work with WinForms

I just always see comments about how much better Rider is. It has some advantages, but it has some massive flaws IMO too. I'm not sure what I'm going to use going forward. Right now I'm developing in rider and debugging in VS.

91
 
 

Hey I started making an Azure functions bot so I made a quick lemmy HTTP client and decided to push it to Nuget

92
 
 

Just a random idea- but,

Would anyone be interested in having a .net based blazor front end for lemmy?

Sadly, there isn't yet a c# nuget package, but, that wouldn't be hard to fix.

https://join-lemmy.org/api/

The API itself, is pretty well documented.

And, building custom front-ends is encouraged as well.

https://join-lemmy.org/docs/en/contributors/04-api.html#creating-a-custom-frontend

93
 
 

There is no polling functionality on Lemmy, so please upvote the comment that you mostly agree with.

94
 
 

Another one of my C# articles, this time about Nullable.

95
 
 

This is an older article of mine I wrote when C# was still my main language.

I don’t know if posting my own content is allowed here - if not, feel free to remove it, no hard feelings.

96
20
submitted 1 year ago by Spyros to c/csharp
97
11
Let's play a game... (programming.dev)
submitted 1 year ago by nibblebit to c/csharp
 
 
98
60
Welcome to C#! (self.csharp)
submitted 1 year ago by nibblebit to c/csharp
 
 

Hey there! πŸ‘‹

Welcome to our C# community on Lemmy! We're a group of programmers, hobbyists, and learners all keen about C#. Whether you're a pro or just getting started, we're excited to have you here.

Our goal? To learn, share, and collaborate on everything C#. Got questions, projects, or resources to share? Or simply want to discuss a feature you love (or not) about C#? This is your space!

Here are a few ground rules:

  1. Be respectful and considerate: Remember, we're all at different stages in our C# journey.

  2. Stay on topic: Let's keep discussions C# focused.

  3. No spamming or self-promotion: Share your projects, but don't overdo the self-promotion.

  4. Use appropriate language: No offensive language. Let's keep it positive!

So, let's dotnet build and Nuget Unable to resolve dependency

Cheers!