C#

C

C#

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

Join

✅ What is the difference?

It doesn't look like it would make a difference by doing that
No description

✅ What is wrong with this code???

pls help my brain hurtssssssssssss
No description

✅ How to read Environment Variables in VS Code ?

Edit. Solved. Code was correct, but had to run from ".NET Core Launch (Console)" and not from "Debug project associated with this file" Using .Net 8.0.402 and Visual Studio Code 1.94.0 I'm trying to get pretty simply a value from a file named launch.json in .vscode folder. The path is:...

✅ CheckPasswordSignInAsync returns fail when password is correct

Ok I followed function calls from
var result = await _signInManager.CheckPasswordSignInAsync(user, loginDto.Password ,false);
var result = await _signInManager.CheckPasswordSignInAsync(user, loginDto.Password ,false);
to VerifyPasswordAsync which runs
return PasswordHasher.VerifyHashedPassword(user, hash, password);
return PasswordHasher.VerifyHashedPassword(user, hash, password);
Where VerifyHashedPassword is called I've checked that hash is the hashed password and that password is in-fact the password. Here is my code:...

need help via modding cuphead

trying to restore this unfinished weapon into my mod and i pretty much finished everything about it just need to change its explosion effect since it looks unfinished i thought id swap it with another effect but all my attempts failed if u are intersted in helping me out dm me or just ask me for the details here and thx

Getting the initial text size of a RichEditBox. (answered)

I know it is affected by scaling and the like, but I'm not sure how to capture the initial value. this.Document.GetDefaultCharacterFormat().Size; is always 14.7f, no matter what I set the FontSize property too. getting this.Document.Selection.CharacterFormat.Size; in the constructor is also 14.7f. ...

✅ How to add a textfile in monogame pipeline(MONOGAME)

Trying to add a textfile for a 2d game im making however when i rebuild the project to save it i get this error
No description

i just download vs2022 professional i wanna do a Loader

i tried to do with chatgpt but codes always giving errors so i need who knows this windows forms (.NET)

Two properties slows down the query for 26 seconds

so the problem is in the middleName and lastName properties, the thing is if I in any way mention them in the query, then it is slows down the request for 25-30 seconds, tried everything and only initializing the properties later is helpful (showed on second screenshot)
No description

MudBlazor DropContainer not triggering ItemDropped

I have the following MudBlazor MudDropContainer: ```<!-- Dropzone for reorganizing and editing the Check Items --> <MudDropContainer T="CustomDropItem" @ref="_dropContainer" Class="align-center justify-start" Items=@_items ItemPicked=@ItemSelected ItemDropped=@ItemUpdated...

"Object reference not set to an instance of an object"

code: https://github.com/axololly/chess/tree/main/Board.cs#L1073 not sure why this is happening. i changed the Board from a class to a struct so it's no longer heap allocated (used in an engine, so these things matter) and now it's raising weird errors like this...

✅ Not sure why im getting this error

Haven't deleted any thing from the design just double clicked the button and started to write code and I get this.
No description

✅ how can i install node.js module in visual studio community app

helloo,I want another .bat application to open when I press the button on my form in visual studio community application, but when I press the button, it says Node.js module not found, how can I add this module to my visual studio community form?

✅ Array wont fully print out Windows Forms App

Hiya new to WDF trying to output a full aray ive looped through. Though it only displays the last string in the array "King spades" Wondering why this happens
No description

✅ Use Sqlite in a C# project

Hello, I'm trying to use Sqlite for the first time but I'm getting the following error when creating a connection. ```csharp using System.Data.SQLite; ... new SQLiteConnection(connectionString);...

In Memory DATABase troubles

Some slight issues and code fix ups ```cs public class InMemoryDatabase { public Dictionary<int, Person> People = [];...
No description

making interface button

im just having trouble somehow implementing a button, i tried watching a tutorial but he talks about so many complex thijgs such as an eventHandle clikc and later doing click?.invoke(this, eventargs) that it just didnt make sense to me... so how would you go about making a button for my homeScreen (the homeScreen is one of the screens on my interface) i sorrta can map out what to do just do not know hwo to, i guess id have to make a button class with a texture,position and rect along with draw and load methods but i tried this and couldnt pass down the contentmanager to load the textures eyc, i also tried passing it down in my screenManager but then i had to make whole new instances of the object in my methods and it would never be able to load the textures it needed to draw them out, so nothing would be output onto the screen e.g public Load(){...

WPF Submenu Styling

I can't seem to figure how to get rid of the border in submenus in WPF. More specifically, can't figure out how to get rid of that border. For minimum repo, create a new WPF application and have this as your MainWindow's xml file:: ```cs...
No description

win32 island in wpf application has #f0f0f0 background colour

hii!! i'm working on a project which requires an embedded win32 control. however, the background of the island is always #f0f0f0 instead of #ffffff. this occurs even if the window is hosting no control and is just a child window. see the attached image for an example
No description