C#

C

C#

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

Join
XXantres4/28/2024

Database function skipping data

Hello, when I run the below method it is supposed to return a string array with a list of users, but when I run the debugger, the reader object has rows, but it skips over the while loop. Here is the code: ```C# public static List<string> RetrieveUserList() { List<string> users = new List<string>();...
No description
Jjborean4/28/2024

AssemblyLoadContext LoadfromAssemblyPath vs LoadFromNativeImagePath

What is the difference between LoadfromAssemblyPath and LoadFromNativeImagePath? When would I ever need/want to use the latter?
OOle4/28/2024

SpotifyAPI - i dont understand things but i want this so bad...

With alot of Help from the internet i somehow managed to get to this code: (in picture) it is not everything but the rest was the authendification wich somehow works fine. These executions also work (not the last one) with the help of this link: https://github.com/JohnnyCrazy/SpotifyAPI-NET/blob/master/SpotifyAPI.Web/Clients/Interfaces/IPlayerClient.cs so i can get the types of Tracks and if it is paused or not but when it comes to the song name / id i dont know how to get that i tried with this last but it wont work it says: there is no argument that matches the necessary variable request "IPlayerClient.GetCurrentlyPlaying(PlayerCurrentlyPlayingRequest, CancellationToken)" idk what to do im a total beginner... (and sorry for bad english)...
No description
Sstigzler4/28/2024

✅ WPF - how to approach a treeview displaying different types at different levels via MVVM

I'm just learning WPF - so seeking some design advice. I'm designing a Visual Studio extension to view and edit Gists. Each type Gist has a collection of type GistFiles (Files property in a Gist): I'll have 3 views inside the main View: GistsBrowser (user control=treeview), GistEditor (user control) and GistFileEditor (user control). I'm thinking I need to store the Collection of Gists in the MainViewModel, as different UserControls/ViewModels will need access to a shared GistsCollection to ensure synchronicity. For the GistsBrowser, I need to make a specific treeview control to display all Gists at the root level which can be expanded to show all of the GistFiles within a Gist. There will be no further child levels....
Bblueberriesiftheywerecats4/28/2024

Does hangfire has a redudant delay?

I`ve created an Job that deletes object from db at certain time, but it looks like it is being delayed by approximately 15 sec
Ddiscount4/28/2024

help needed with accesing a variable in another script

im trying to acces isgrounded in another script and have it be the same as hi but i get this error
No description
HHath4/28/2024

Issue with websocket within a service

Im having troubles using a websocket service within other parts of my projects, cannot use the Send method properly
PPoseidon4/28/2024

Help

I'm new to C# in VSC and i have a Problem wich is why i can't execute the Code. What am i supposed to do?
No description
EEve.4/28/2024

Checking data from SQL database

help on verge of tears
No description
UUnawareModesty4/28/2024

✅ How to export data from datagridview into excel file

I've tried like a few ways and cant really make sense of it, if someone can guide me through it it would be nice, thanks in advance 🙂
Cclover4/28/2024

Problem with Material Design Lib in wpf

I have a Combobox item in Stack panel. Im using Material Desing for automatic styling but the Popup of the Combobox doesnt carry over the colors that i have set for material design picture for example My nomal colors are the shades of blue but for whatever reason they pick this grey color. I tried setting the ItemContainerStyle but it didnt help...
No description
WBWALEED BENSUMAIDA4/28/2024

Title: Issues with Authentication and Authorization using JWT with AutoRender Mode in Blazor NET8

Hello friends, I am currently facing challenges with Authentication and Authorization using JWT with AutoRender Mode in Blazor NET8. Specifically, I'm encountering issues with the <Authorized> attribute in components, as it does not retrieve the user's state. Additionally, I would appreciate guidance on how to implement RevalidatingServerAuthenticationStateProvider and Persist State in a client project. If any of you have experience working on a project involving JWT with AutoRender Mode, I would greatly appreciate any insights or sample projects that could help me overcome these obstacles....
SShell-Caster4/28/2024

✅ How do I reference a specific private instance of a class

I would like to know how I could reference a specific instance of a class, if the class is private and I'm in a different class
MMustafa4/28/2024

Receiving Game Controller Input while Minimized (WinForms C#)

Pretty general question here. How would I go about receiving input from my user while they aren't tabbed into the program or have a different window as their foreground window? I'm using the InputSimulator Nuget package (InputSimulatorStandard version), and I'd like for my program to send inputs to a game window when it receives controller input. My only issue, now, is that the controller input isn't received unless I have my application as the foreground window. ```cs private async void T_Tick(object sender, EventArgs e) {...
Ccyclone4/27/2024

process start

Ive been trying to figure out why the proccess.start() hasnt been working
No description
NNDOT4/27/2024

Configurations say that appsettings is returning null

Basically, i have a configuration and i'm trying to access a value from my appsettings, and all that i got is "null", but the value is actually there, more details below
Yyucaconqueso4/27/2024

✅ ASP.NET Core Web Api + SignalR

Hi, I have an API deployed on IIS but when a person wants to access it they get an error: "ERR_CONNECTION_TIMED_OUT" Any solution?...
AAngieFoxx4/27/2024

✅ .NET sdk not working

So, I've installed the .NET sdk and did what I was told, but it's still not being detected by vscode, commands like 'dotnet --version' don't work I've had this issue many times before trying to setup C#, and I've never solved it, it's kept me from learning the programming language for longer than I expected and I really would like help fixing it...
R_read_only_4/27/2024

MEF No exports were found that match the constraint

Hi, i'm trying to implement MEF in my WPF app, however i'm getting this error, not sure why anymore. Everything looks correct for me This is my plugin: ```csharp public interface IPlugin...
Next