C#

C

C#

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

Join

✅ Explicit interface implementation

Hi, guys. Maybe it's a stupid question, but can someone explain me, what is explicit interface implementation used for? I heard it can be used if a class inherits the same method from two interfaces or if one class inherits from another one which, in turn, inherits from an interface and the first class should implement it in its own way. These cases seem confusing and unlikely. Probably I don't understand the importance of this concept, so I ask you to tell me about occasions, when it could be useful. Thank you in advance....

nugget package update

I have a doubt. I recently did a nugget package update to my project and when I try to run my site in local. I'm getting a pop up
No description

✅ Help with small error

Git failed with a fatal error. Git failed with a fatal error. error: open("RealiserenThema7_8/.vs/RealiserenThema7_8/FileContentIndex/09aad924-6fda-4fa9-9462-6c498d674d0c.vsidx"): Permission denied fatal: Unable to process path RealiserenThema7_8/.vs/RealiserenThema7_8/FileContentIndex/09aad924-6fda-4fa9-9462-6c498d674d0c.vsidx does anyone know how to fix this when im trying to push to devops...

✅ Command Not Found error

I have created console app, I want to run hello word but some reason I am having this error although I have add C# Dev Kit extention , What can be the reason?
No description

ASP.NET Identity Login endpoint returns schema in of auth tokens

what the title says. I assume there some kind of messed up in my configuration somewhere, but i dont know where to start looking i also assume this is because of how this method is somehow supposed to return data without returning anything......

How do i put "" Inside a String?

I wrote down "
Console.WriteLine("Welcome to "Program"")
Console.WriteLine("Welcome to "Program"")
" And it simply told me theres an error. How do i fix that?

✅ ASP.NET razor

Why do I have to manually open a web browser and navigate to localhost:5030 to view my web UI? Why doesn't it just open up automatically after running dotnet run?

Need help for my escape room array field

Hi, I want to make an console escape room and I want to create a field with a key and a door. Can someone help me with this ? Im pretty new to programming

FileWatcher for project folder

```csharp string outputDirectory = AppDomain.CurrentDomain.BaseDirectory; string projectDirectory = Directory.GetParent(outputDirectory).Parent.Parent.Parent.FullName; // Navigate to the project folder this.watcher = new FileSystemWatcher();...

✅ Trying to make an undo function on my paint program thingie

so i started making a paint program in vs console bc i was bored and i need to rack up experience in coding, but im unsure of how to utilise stacks/ why my code doesnt work https://paste.mod.gg/rokqfntmjjcd/0 my entire code is in there and ill add snippets i dont understand in replies

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