C#

C

C#

We are a programming server aimed at coders discussing everything related to C# (CSharp) and .NET.

Join

"Building a C# Interface to Display Real-Time Data on macOS"

I need to build an interface using C# on a macOS laptop with an Apple Silicon chip. The goal is to create an interface that takes data and displays it, but I’m unsure how or where to begin. My background is in Java, but I now need to handle this project in C#. I’ve heard that .NET isn’t very well optimized for macOS, so I would really appreciate any guidance or suggestions on the best approach to move forward with this.

Need help inserting row to DB table from Ajax or unsure if supposed to be through the backend?

Hello, I was able to capture the PrimaryID1 to send to the backend using an ID1 to the dropdownlist, but I don't know how to send data to the server from the model without using an ID? https://paste.mod.gg/qnlljihvpcdx/0...

✅ Strings

StringBuilder newCrustacean = new StringBuilder(); newCrustacean.Append("fiddler crab"); Console.WriteLine(newCrustacean); newCrustacean.Remove(0,8); Console.WriteLine(newCrustacean);...

✅ Keyauth

keyauth doesn t work

Async issue

Hi! I'm trying to perform an http get request in a graphical element of the Eto library. Thing is, my whole program freezes until the response is received and I'm unsure why. ```csharp ...REST OF THE CODE... public class Body : StackLayout...

Is it necessary to setup validation constraints at the api level and database level?

I'm setting up a minimal api and just started to use FluentValidation. Should I also setup validation constraints at the database level as well?

Improving performance / caching

Hello, Im coming to an end with my database software. I filled the database with around 150 rows, but now I got the problem that performance is really trash with everything it does, even if it only does single row querys. So I thought maybe it´s possible to create a cache which stores all data once they are loaded which then is being used by all the other methods making a query. This is the code where all aircrafts are being collected, at the moment the data is loaded asynchron to not block the UI. How can I build such a cache with is used by every method?...

How to target .net standard in visual studio

when i create new project, the target framework that i can choose is only .net framework, there is no .net standard. I installed .net core 3 in my pc and .net standard still not shown, then i installed .net core 3.1 runtime in visual studio and .net standard still not shown in target framework. How do i target .net standard ??

Help with error

what is this error and how to fix it
No description

How to start coding C# in vs code??

ive already installed c# dev kit and .net from website ad from .net install tool but when i try to create a new project this window pops out. and when i try to check the version with dotnet --version it has a problem (screenshots) please what do i do
No description

unity character clips into floor and cant walk properly

unity character clips into floor and cant walk properly

✅ cant get dotnet sdk recognized

no matter what i try im stuck here recognizes runtimes but not sdks
No description

Studying singly linked lists and need help understanding pointer functionality

I would love some help understanding something in the following leetcode problem Merge Two Sorted Lists: ```csharp void Main() {...

This is my code how do I convert the Object of Basewords into a string?

namespace ConsoleApp1 { class Program { static void Main(string[] args)...

✅ Aspnet runtime not found when running, but present in dotnet --info (linux)

I'm having issues trying to run Aspnet applications on Linux Mint. Running dotnet --info shows both the dotnet and aspnet runtimes, but when I try to run the aspnet application I get an error stating that the framework is not found. I've since reinstalled dotnet manually instead of with the package manager and checked that the files are all present in the home directory. The app is using dotnet 7 with dotnet 8 installed, but this happens regardless of what dotnet version I use. I'd really app...
No description

✅ Mac is not supported by Visual Studio anymore, There is not download link for Mac user anymore,

I have checked the Microsoft page. VS has not been suported for Mac user since 31 August 2024, Rider is not free, there is only option for me VS code. I am just trying to create environment for basic C# code implementation to see the difference between Java, I am a new learner, I have cloned this git repo https://github.com/derekbanas/C-Sharp-Course.git which contains pretty good c# fundamental examples but I can not run any test I want to run C# Code / Program.cs file but I can not run it , what I am missing...
No description

✅ Hey IDK how to use NetSpell

This is probably really simple thing to do but IDK the keywords, and functions and methods to Netspell package and I can't find them on internet. I already installed the NetSpell package.

Need help with AspNetCore and GUID.

Well I have got the following code for my register method in my webapi (Shown on first image. It is pretty simple). I am running my xUnit test for this method (everything is good) but it seems that I can't access my user.Id normally (I am returning it via "return Ok(user.Id);" line). Somehow debugger shows me that I have got two Id properties, one is actual Id and another just filled with zeros (shown on second photo). I would be grateful if someone explains me what is the problem with them and...
No description