C#

C

C#

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

Join

Simple yolo webcam throwing System.InvalidOperationException: 'The calling thread cannot access this

any help is SUPER appreciated. This is in WPF and the error is at the end of my WebcamAsync task

Save an image to a mysql

cmd = new MySqlCommand(query, con); cmd.Parameters.AddWithValue("@image", client.Image); I tried this method, but saved "System.Image.bitmap" on the database How can I save the image to the mysql database?...

WinRTC

Hello, Is anyone still using WinRTC for their Windows desktop application? Is the library still active in the development? Are there any alternatives for this Library? I couldn't find much information about WinRTC online, so I wanted to know from this community!...

DataSet, DataTable from System library doesn't generate nullable attribute.

In System. Data. Common has a DataSet, when you call api Dataset.GenerateXmlSchema(), it generates XSD file with elements and type attributes, but it doesn't add "nilable" attribute to the xml elements. Is there other ways to generate xsd file from postgreSQL Database with appropriate attributes?

βœ… my application in the assembly works fine on my PC, BUT

my application in the assembly works fine on my PC, but opens for a few seconds and closes if I try to run the exe file on another PC and no it's not because I forgot to set the action wait in the program I created a simple program and hello world with reading the line and it also immediately closes...

βœ… Test keep returning 503 while postman give 200

I really have no clue why http in the test give me 503
No description

Creating a class Player based on instructions

Hi i got a few questions. What exactly does an enum do and how would it apply to my program?` ```cs public abstract class Player {...
No description

books or tutorials which talk bout: action invoker,model binder,under the hood in asp.net core

i wish if i find books or tutorials that talk about how action invoker method ,model binder ,code under the hood

βœ… WPF Application, renaming

So i'm currently going through an assignment and creating the necessary classes which our WPF program should have. However i got a question... It says i should rename the initial MainWindow to GameWindow. Does that mean i rename MainWindow.xaml.cs to GameWindow.xaml.cs ? The problem is if i do that i get an error.....
No description

βœ… Help interpreting classes

GameWindow, do you think they mean that i should rename the program.cs into GameWindow. Or what do they meanwith MainWindow? Maybe it shouldn't be a Console Application?
No description

Basic stuff: c#

so i am new to programming i only learnt the basics, so please don't laugh at this, but i don't quite understand using classes in other classes(not program.cs i mean other classes). for example: internal class WritingTool { private string name;...

βœ… Unit Testing in Rider not working

Hello, I've unsuccessfully attempted to use NUnit 3.14 with Net 8.0, and Xunit 2.5.3 with Net 8.0, and Xunit (2.0 or 2.1.0.3179) with Net 4.0, and NUnit 3.5 with Net 4.0 - all respectively shown in this video: https://www.youtube.com/watch?v=PyY5X7ylGOc I've also tried both with Net 7.0 According to NUnit, Net 4.0 should be compatible with any NUnit underneath 4.3; I'm surprised NUnit 3.5 didn't work with Net 4.0: https://docs.nunit.org/articles/vs-test-adapter/Supported-Frameworks.html...

Looking for AI dev to back me up a little in open source project

Hi guys, trying to make some open source project for face blurring in C#, I need to remove one dependency from some small, (looks like) abandoned project to fully switch to OpenCvSharp. I want to use CenterFace ONNX model to detect faces. Code is almost done, I just don't have enough DNN knowledge to replace the "3rd party" library partial implementation with OpenCvSharp one. Anyone interested? πŸ™‚

βœ… random current value?

Hello, I'm using a naΓ―ve Random generator, and I'd want to display the current seed used, in the hope to replicate the current state for some later replay. How can I achieve that, apart from having a second Random seeding its .Next() int to the actual Random?...

βœ… Creating multiple projects inside one solution in Rider on mac

I can’t find any way to create a second project inside my solution because the add drop menu simply doesn’t have anything related to adding projects/solution folders.
No description

My autoclicker project is not working.

I will attach the codes I am using for the autoclicker so you can check and review, there is no error when compiling. It is simply that when I have it compiled it does not set coordinates and therefore it does not activate either. I have 2 Timers added, Timer 2 is in Enabled True.
No description

Cannot get my ASP.NET site to publish to Azure app services.

I've been banging my head off the wall for 3 days now. This is the first site I've ever built and it has gone great upto this point. I added a view counter to the homepage to I could see how many uses it gets which worked just fine. Accept every night when the Azure servers reset the counter resets as well. So I learned how to create an SQL database to store the counter. It works perfect when I run it locally but when I try to publish it I get the error below. Error: Could not copy "C:\Users........\wwwroot\lib\jquery-validation-unobtrusive\dist\jquery.validate.unobtrusive.min.js" to "C:\Users........\obj\Release\net8.0\PubTmp\Out\wwwroot\lib\jquery-validation-unobtrusive\dist\jquery.validate.unobtrusive.min.js". Exceeded retry count of 10. Failed. I have tried verything from removing it from the dist folder up one. To manually copying it to the new location. To moving the entire project to a new directory because the file path was so long. ...