C#

C

C#

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

Join

Trigger isnt working

I can have the 2 box colliders overlapping and it still isnt triggering
No description

✅ Default interface methods - Am I using them wrong?

I'm trying to learn when/where to properly use interfaces, and I don't understand why my default method doesn't work. I have this: ```c# public interface IMyInterface {...

Can't build anything in dotnet 8. Not even template project.

I get this error when i try to build any project on Ubuntu 24.04 The project has just been made with dotnet new classlib ``` relt@relt-MS-7D95:/media/relt/M2/Blendesonite/test$ dotnet build MSBuild version 17.8.5+b5265ef37 for .NET...
No description

Firefox browser in c#/c++

The question is not entirely about C#, but rather about whether it is possible to integrate the latest versions of the Gecko core and, for example, write a browser for it using C#?Or only C++? Are there any good libraries? How difficult is this for an average C# dev?...

✅ .NET 9.0 | CSharp - WinForms | Encryption & Button Function Issue

Having a minor issue when trying to encrypt a file. This is my exception error that was thrown: Error: Method or operation is not implemented Here is my button call code:...

✅ combo box null reference

I am currently learning wpf and tried to reference a combo box. Even though I have defined the combo box in the xaml code, it returns a null reference.
No description

Issues with OmniSharp and language servers.

I have 4 cs proj files for different layers but I am getting issues with the languageservers, I have tried to select a project and restart langauge servers.

DropDownButton.Flyout.FlyoutItem Click Handling Help needed

I want to call a dummy ContentDialog from the named FlyoutItem and since it collapse on click there is most liky trown this fail from gestureRecognizer and ScrollContentPresenter thrown so I would like you to give me example on how do you would call a simple ContentDialog from that... For me it seems irrelevant if that thing collapse, but I am not able to catch this... GitHub Repo on this: https://github.com/DevTKSS/MyUnoXamlApp.git...

Aws Lambda Server Hosting .net Web API

I have host the application in aws lambda server but i am connecting front end vue js is showing error I Am Connecting backend end and frontend singlr can any one help
No description

Can't Refactor Or Save this Class File (Lazily Loaded Singleton)

```using System; public sealed class SessionCache { private static readonly Lazy<SessionCache> lazy = new Lazy<SessionCache>(() => new SessionCache());...

cannot update visual studio installer and visual studio community

i tried 2 time installing and uninstalling the program but still it doesnt find the latest version who i want to use MAUI for the first time:((

Need Help with Application Insights Logging Issue in Production

Hey everyone, I could use some help. I have the same app running in two different environments: production and non-production. Both should be logging to Application Insights via Serilog. However, in production, the logs are showing up in the log stream but not in Application Insights, whereas in non-production, they’re being logged to both. Can anyone help me figure out why with the settings below? appsettings.json...

✅ Looking for .NET MAUI EXPERT.

I'm experiencing display/layout issues with my .NET MAUI app specifically on iOS devices. - Problem: Misaligned elements in the top section of the app and between items in the layout. - Affects: Primarily the top section of the app and gaps between items. ...

communication between host to the docker and the docker to the host machine

I have 2 server apps - an MVC dotnet app and dotnet API. a dotnet mvc web app which runs on 8888 port locally and the api which runs on 8889 port locally. I have another 2 angular apps which runs on 4200 and 4300 ports in the containers and I use docker hub. I don't want to build the angular apps every time and I want to run on docker such a way that we don't have to run these angular apps every time. the constraint here is we load the angular app inside the mvc webapp iframe. I was able to load the angular app but I can't call the APIs from the angular app. i am able to run mvc app with the anulgar app loaded in the iFrame. MVC app will run on the host machine, angular apps run on docker. but the issue is the angular app in the docker is unable to hit the API on the host machine. the software i use here are visual studio, docket hub and visual studio code....

✅ Website doesn't trust SSL Provider (MSSQL Database)

So I get this error
Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
Microsoft.Data.SqlClient.SqlException (0x80131904): A connection was successfully established with the server, but then an error occurred during the login process. (provider: SSL Provider, error: 0 - The certificate chain was issued by an authority that is not trusted.)
But to be quite honest... I'm new to MSSQL and I don't understand where it's getting the SSL from or how I get my website to trust it? They are both hosted from the same machine...

Cant query the data with specified uid

I got a problem, I am using aps.net 6.0 with ef and dbcontext, I tried to query the uid with 16 char string, however, its not working: I set dbcontext and its working and connected, its string queryuid(uid) { Dbconnection dbcon = dbContext.dbconnection.firstOrDefault(e=>e.Uid == uid);...

How to pass a caught error from one .cs file to output in a textbox in another .cs file? (same sln)

I have two classes that i'm working with. I'm trying to catch an error in one class and output that to a textbox that exists in another class. In my example I'm trying to make my Circle method throw a caught error to my ErrorOutputWindow in my windows form called BooseForm. I think this is a pretty simple implementation but I may be wrong? All help appreciated, thank you!...

Visual error

I’m facing an issue in my WPF application where I get the following exception: Exception: The specified Visual is not an ancestor of this Visual This happens specifically when I perform an extended selection on items that were recently added to a Observablecollection bound to my UI. The exception doesn’t occur with items that were already present before the selection, only with the newly added ones. It also occurs if I move the selection beyond the boundaries of the DataGrid....
No description

How to delete a cross-domain cookie

Hey, I'm working on a web app (next.js as a frontend and .net api as backend). I decided to try cross-domain cookies to make authentication more simple. it works, i can log in or register, but when im trying to clear the cookie on logout the problem comes. i tried to do this on a frontend initially, but then i found out that i could only be done on the "main" domain. Logout endpoint returns "Ok" but i still can see a cookie in browser. here's how i set and delete cookies ```csharp
private readonly CookieOptions _cookieOptions = new() { HttpOnly = true, Secure = true,...

✅ Can you make labels scroll alongside input?

Hey, so I'm rather new to C# in general, we've been learning it in a course to play around with things like OpenGL or Unity eventually, but for now there's the classic programming assignment of making a calculator; I've more or less got the logic of it down.. What i've currently done is that i've made all the buttons add certain characters to the label_display.text property, and i've made some validation that the user does not enter dumb stuff like "9*+-25", then i parse this string and turn it into tokens of values and operators, turn the normally infix expression to postfix and then evaluate that expression and overwrite label_display.text with the result. -- intro ends here...
No description