C#

C

C#

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

Join

All reference is yellow triangle

Hello, i'm new to C#, when i'm loading the project, all my reference cannot be loaded, Even tho in ../packages/... i have all the library, other PC i can load the project normally but this PC cannot, how to fix it?
No description

✅ Transition to .net

Hey guys i am recently graduated java dev who landed in a job with .net tech Stack i am wondering which courses you recommend, i am looking at the backend cert from Coursera and C# academy, any suggestions?

✅ Can someone help me understand GetType()

Do I have to instantiate an object in order to use GetType() ``` using System; using static System.Console;...

setting up a Wheel controller and force feedback

I was wondering if anyone has a way of setting up a Wheel controller and force feedback or have any assets that I can use to get it to work with different types of wheels for unity

What do you use for planning out your API/endpoint structure?

Hi, I’m sort of a visual-learner and work better when I have a visualization. Are there any tools out there anyone uses or knows of which a developer can make use of for planning out an API? ...

Using PWA offline

I have been watching the talk from Steve Sanderson on his demo app CarChecker to try and get a grasp on how to allow offline use of a PWA. I'm using Blazor, .NET9 & EF9 for my own project but the talk is quite dated. I was wondering what direction I should be looking if I want to do the following: When the technician loses internet access he would still need to be able to access the data....

✅ I got error just for run "Hello World"

I dont know why i got erro just for run Hello World even though i've installed and set the compiler or .NET to Path, etc.
No description

A .Select() that I believe should work but it doesn't.

As title says, this is the script (not my real script just one made to show the issue): ```csharp using System; using System.Text.RegularExpressions; using System.Linq;...

I need help declaring an array of objects where the attributes of the properties are user inputted.

I have been tasked with creating an array of objects. The Application for my assignment says that I need to create a job array in which the user is prompted for details to fill out the form. A job number, a name of the business, the hours it takes for the job to be completed..... The first thing that I do is create a job class. ...

Mobile - Upload file over HTTP with reliable progress tracking

Is there a consistent way to send an HTTP POST request in MAUI that allows tracking progress? I have an implementation that uses a custom Stream class that wraps an inner Stream and reports read/write progress. I have attempted to consume this both in a StreamContent that is part of a MultipartFormDataContent, as well as by using the wrapper stream directly in a custom subclass of MultipartFormDataContent. No matter what I do, it seems like (on Android at least) the entire request is buffered into device memory before the request actually gets sent. Every request consumes the stream to 100% instantly and then hangs at 100% for as long as it takes the entire file to upload. I have tried putting <UseNativeHttpHandler>false</UseNativeHttpHandler> in the csproj file, and I've also tried explicitly using SocketsHttpHandler for the HttpClient instance. I've even tried explicitly setting request.Content.Headers.ContentLength = null before sending the request to force a chunked transfer. It seems like nothing I do will cause the request to actually be sent in a way that lets me track the progress as the request is transmitted. For reference, the amount of data that is being uploaded is around 1-5 MB per upload, but on slower mobile data connections, this can take 5-10 seconds for each request (meaning the user sees the progress bar jump to 100% and sit there for 5-10 seconds, which is a terrible experience)....

What do you think of my code to identify images, do you have any suggestions

What do you think of my code to identify images, do you have any suggestions, I think it's not very accurate? ``` public Task<List<ImageMatch>> FindTemplateAsync( Bitmap source,...

How to Deserialize dynamic types from json

I'm making a game where users will store multiple different types of items. My Question is when deserializing an item from json it will just deserialize to the given type attribute in the json. example: I want to turn Superhero character json into superhero, but instead it becomes character....

How to anchor

I want the blue rectangle to appear like the first pic when minized and maximized the 2nd pic is the result of whats currently happening...
No description

Deploy greyed out in Visual Studio

I don't know if this is the right place but I have been looking for a solution for multiple hours and am getting frustrated. I am trying to make an extension for the windows command palette in powertoys. I auto-generated the solution by running "Create a new Extension" in the command palette and then opened it in visual studio community 2022. The Wiki says I have to deploy the solution, but the button is...
No description

How to train model for search (ML.NET)

Hellom i've created a database for search, looks like i need to add some sort of comprasion for my strings, am i right?

How to build a form using a figma/mockup as my starting point?

I've been learning how to code in c# for about a month now and one of the ways I'm learning to do that is by building an application, which is a management app for a local clinic, however I started by designing the gui and such but I'm nt sure how to translate that into code, considering that I find the designer of visual studio quite difficult to use, any help would be greatly appreciated!

Help for cell height

I have this layout on my phone and would like to have the third column for Player 2 to have the 0 cell occupy full height of the column to avoid leaving empty space. as of now, my code looks like this, I'll only paste relevant parts: const containerStyle: ViewStyle[] = [ styles.commanderDamageContainer,...
No description

✅ dotnet Aspire

how i can publish dotnet aspire on IIS ?

✅ Cosmos - Waiting for debugger information

Ok so I wanted to make a OS, and I'm a complete beginner so yea, I tried to use Cosmos, It was decent until i wanted to run it, when I ran it all it said was this in the image, I disabled remote debugging in the properties and It still does this so I don't know what to do, I'm using the recent release of Userkit and Visual Studio 2022.
No description

Passing data to a details page dilemma

Hi everyone 👋 I’ve got a small architectural dilemma and would love your input. Let’s say I have a list of item view models, and each one wraps its own model (e.g., ItemViewModel → Model). When I navigate from the list to a details page, what’s considered the better practice?...