C#

C

C#

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

Join

CheckPasswordSignInAsync returns fail when password is correct

``` [HttpPost("login")] public async Task<IActionResult> Login(LoginDto loginDto) { if (!ModelState.IsValid)...
No description

βœ… remove dotted border around win32 control in wpf?

hello all! im hosting a win32 control (command links) in wpf but on click they have a dotted border. im trying to replicate windows 7's wizards (which didn't have this on click) so i was wondering how i can remove the border? i've seen people suggest WM_CHANGEUISTATE like such:
SendMessage(source.Handle, WindowMessage.WM_CHANGEUISTATE, MakeLong((int)UIS.UIS_SET, (int)UISF.UISF_HIDEFOCUS), 0);
SendMessage(source.Handle, WindowMessage.WM_CHANGEUISTATE, MakeLong((int)UIS.UIS_SET, (int)UISF.UISF_HIDEFOCUS), 0);
where source.Handle is the main window's handle. however, this doesn't remove the dotted border (but it does remove all focus-related visuals from my wpf elements)...
No description

Xunit and database projects

I'm trying to write some integration tests and am having a little trouble setting up the database. I have imported my database as a SQL Server project to my solution and added a project reference from my test project to the database project. I expected that would place the dacpac in the test project's build output directory, but that's not the case. The dacpac is in the database project's build output directory, but only a dll and pdb in the test project's. I need the path to the dacpac so I can programmatically deploy it to the test environment when tests run. Seems to me I should be able to get it in the test project's output directory, but if there is another/a better way to do this, please lmk!...

Why does Ef Core not save my data in the database?

I have four models that are saved in sql server with Ef-Core and these four are Order, Contact, Address and BillingInfo. Each Order has Contact and BillingInfo. Each Contact has an Address. Each BillingInfo has an Andress, too. ...

NEED HELP

Hey can someone have a look at my code I made this applicaiton a files ago and currently over the year of increasing the amount of files in select image folder it seem to have caused the application to freeze quite often. Base on what I have seen on the code it should be an issue where I havn't limit how many files the btnPickFolder_Click scan for since the freeze issue tends to happen when I set that file location. I tried adding buffer by making the applicaiton only pre load a set amount of images at a time but I don't believe this will solve my issues. Since thinking about this further this is an issue where the applictaion freezes since it loading too many images from the btnPickFolder_Click location into the applicaiton......
No description

βœ… None of my stuff is being pushed to my repository on github.

I don't know what to do. The origin is my repository and the upstream is my teachers repository. I use two computers so I'm not sure if that affects anything.πŸ’€...

Need help connecting AJAX to Controller to DAL

I kind of need help also explaining the process cause it's alot of stuff happening. But I don't know where else to turn to and my job is a kind of on the line here and my Senior dev isn't helping

βœ… 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...