C#

C

C#

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

Join

Install SkiaSharp

I'm completely new to C#. I'm trying to install a package but can't figure out how. What is going wrong? ``` $ nuget install SkiaSharp Feeds used: ...

✅ while loop on cpu

is there a type of while loop that doesn't hammer the cpu with checks? like when i type a character, THATS when it updates, instead of as many times as it possibly can, because it slows down my pc and i dont get these issues with other CLI tools (eg. python repl)

✅ when programming a CLI in C#...

1. how can i open my own CLI window like how starting the python repl works? 2. how can i take input with a string predecessor? i want to do >>> ... but there isnt a way to get an input on the same line as text, as far as ive seen...

Login Message Help

i am gonna ask to asp.net developers. is everyone think it is convenient to use asp.net mvc.
how can i resolve the following situations in more tidy way. situation: when i want to go the page which requires to login without login then i will be redirected to login page, but in this case , the message such as "Please login" should be shown. how can i solve this...

how do i rotate part of a multidimensional matrix?

i have a 2D matrix representing a rubik's cube (figured that a 3D matrix would be both quite difficult and a massive overhead) and i want to rotate just one of the inner 1D matrices to rotate just one face of the side. how would i do this?

HTTPS payload decryption using root authorized private key

How could one decrypt HTTPS payload using a root authorized private-key in a .NET application?

.NET

``` var process = new Process(); var start = new ProcessStartInfo() { CreateNoWindow = false,...

✅ typeof()?

I am trying to arrange objects in a hashmap: The key should be the class and the Value a List with the instances of this class. Is typeof ()the right function for this?...

Reading HTTP requests on machine level

Is it possible to read all incoming and outgoing HTTP (including secure) requests on the local machine?

How find file in Docker?

This is my Dockerfile: ```docker FROM mcr.microsoft.com/dotnet/sdk:8.0 AS build WORKDIR /app...

difference between a normal variable and one declared with that property shorthand garbage

i'd be grateful for anyone willing to explain that to me. Like, I encountered it while trying to set up a DataGrid in WinUi earlier and changing a class property from normal public field to one with the get set shorthand fixed it for some reason and i'm just wondering why they behave differently. aren't they accessed the exact same way from the outside?...

How to Build Multiple Binaries from Dotnet New Console?

I have the following: ``` $ dotnet new console $ dotnet run...

NewtonSoft Serialization Exception

Hi i have a shared library i use on both client and server, most of JSON works fine, but in this example i have List.
Newtonsoft.Json.JsonSerializationException: Type specified in JSON 'System.Collections.Generic.List1[[RetrobineShared.DTOs.ItemDto, RetrobineShared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' is not compatible with 'System.Collections.Generic.List1[[RetrobineShared.DTOs.ItemDto, RetrobineShared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Path 'UserBoard.Items.$type', line 1, position 267.
Newtonsoft.Json.JsonSerializationException: Type specified in JSON 'System.Collections.Generic.List1[[RetrobineShared.DTOs.ItemDto, RetrobineShared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e' is not compatible with 'System.Collections.Generic.List1[[RetrobineShared.DTOs.ItemDto, RetrobineShared, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], System.Private.CoreLib, Version=8.0.0.0, Culture=neutral, PublicKeyToken=7cec85d7bea7798e'. Path 'UserBoard.Items.$type', line 1, position 267.
...

I need to figure this out asap, with a problem in my program, please sendd me a friend request

I have a project I need to turn in asap, I cannot figure out what is wrong with one part, please help, send a friend request, its in visual studio community

Blazor - Identity Scaffolding Fails

Hi all, trying to scaffold identity into a blazor app. I have an AuthDbContext that looks like this
public sealed class AuthDbContext(DbContextOptions<AuthDbContext> options)
: IdentityDbContext<IdentityUser>(options);
public sealed class AuthDbContext(DbContextOptions<AuthDbContext> options)
: IdentityDbContext<IdentityUser>(options);
...

Updating datagrid gui from other threads

In wpf, I have an application that has a button and datagrid. The button over the datagrid adds an object to the datagrid called barProgress. The class barProgress contains one public int value called progress and is a default of 0 when initialized. The datagrid itself has two columns. Column one contains a progress bar for each object and Column two has a button that tells the progress of object to go up by one every second. I understand creating/adding/binding objects to the datagrid and their values. I added background workers (running async of course) per object to update the object.progress by one per second. Here's the problem. ...
No description

Help me

I want to learn about signalR in Asp.net core. could someone recommend some free books to learn it?

Hello i have a question

How to make BackGround in unity ground to step on for character
No description

Approaches to get around a big codebase

Hi guys I am second month in a new job, so far I've working for couple of years with a lot of Python, C/C++ projects with VSCode on Linux, thats the environment I am used to. Now I am working on Windows using Visual Studio on two solutions the C++ and C# one, that have hundreds of projects and they are dozens of millions lines of code. I am trying to get some work done on the C# solution, however, its a product that has a long history, there is a lot of weird design decisions, lack of documentation, extreme complexity, inconsistent style, tons of code, tons of components - lot of different processes each with a lot of different threads, communicating with different services across several machines of different architectures. Now getting around this is a headache, especially because I don't even know Visual Studio or other tooling very well. Do you have some tips for tools, articles, whatever how to get some high level sense of what is going on in such context fast? I am talking about the C# solution. Attaching to more than 1 process in VS and debugging it (without opening 1 instance of visual studio for each process)? ...

✅ Having to press <return> twice?

```cs namespace Calculator.View { public class InputHandler {...