C#

C

C#

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

Join

โœ… Z position controlling of my WPF window

Hello, guys, i'm developing a WPF application for a game, which source code I don't have. I want to make a window, that always will be on top of the game window, but if there is a some other window, for example browser, it can be on top of my application. I have one idea to use C++ functions for windows from user32.dll, but it looks complicated and I think there is a simpler solution. Is it?

SQL code invalid object name

i have written an SQL code and i get the expected result but it says invalid object name when i hover over the procedure name, it this a problem or can i just leave it alone?
No description

Developing a program

Hey everyone, I need help on developing a program. If you could help me, it would be greatful. Also, note that I'm not that good on C#.

Code formatter

Is there a plugin similar to Prettier in vs 22 IDE ? or is there prettier itself...

Integration Test issue on ubuntu-latest (.NET 8)

Hi, While running the basic example for integration tests with WebApplicationFactory in a .net8 (8.0.303) web api on ubuntu pipeline (https://learn.microsoft.com/en-us/aspnet/core/test/integration-tests?view=aspnetcore-8.0 I'm getting this exception :...

โœ… How do I disable copilot? I dont have it installed and yet it's there

As you can see in the screenshot, these extended suggestions are extremely annoying and pop up nonstop. This is in vscode insiders. I do NOT have any copilot extension installed.
No description

โœ… hey I need some help!

Hey I was wondering if I could look to learn C# I need an C# teacher and if you could teach me then dm me!

the namespace is not recognised

hey so I am making a wpf app that will be a flight booking app but I will be storing user data on an azure sql database I am trying to create a REST API and so far I have made a ASP.NetService named FakeFlightBookingAPI I made this class named ApplicationDbContext to interact with my database here and I am trying ref my Admin and Customer classes that are part of my WPF project not my ASP project and my code is below ```cpp using Microsoft.EntityFrameworkCore; using FakeFlightBookingApp.Model;...
No description

ads for multi-platform avalonia (or Android at least xD)

Hi!, I'm very very new to all this xD and while I worked with WPF, this is my first time uploading something... So, I've made this Multiplatform App in AvaloniaUI, and I am focusing right now on the Android side of it, I'm about to publish (today hopefully) the app in the Play Store, but I have no idea how to add ads to it... I was thinking on a simple banner somewhere in the bottom of the app, so I can pay for servers/services and the app would be self maintained, but... all the explanations, tutorials, etc are targeted for Android specific platforms, which, I never used, so while Avalonia has access to this code implementations, I have no idea what half of what I'm reading means... As an example, admob has an SDK... in step one of the guide it sais "In your Gradle settings file, include the Google's Maven repository and Maven central repository" and then there are two explanations that say "Kotlin" and "Groovy"... I have no idea what ANY of this means, I tried finding what Gradle is, and seems like it is an actual file, which I also don't have in my project for some reason, I have no idea how to get or access those repositories, it mentions... I'm really lost, I've been trying to do this for a while now.. first trying to find an ad service which used paypal, cos I'm not from the US, so paypal was the best way of managing the exchange from dollars to pesos by myself, but I can't understand any of the different services explanations, they don't seem to focus on c# implementations on their mini guides... ...

โœ… Exception handling

I'm trying to understand exceptions but i'm having a hard time. So when an error occurs in my program. For example : ```cs int number = Console.Readline(); Console.Writeline($"{number}");...

Markdown editor without separate preview

Hey, so I'm planing on creating either a WPF or an Avalonia application, that serves as markdown editor (prefered avalonia, because of cross plattform). The markdown editor should be inspired by Obsidian or Notion, meaning you don't have a separate preview, but instead get the markdown rendered directly "block wise" in the same area where you can type. I first thought of having a textbox and whenever you press enter a new textblock gets rendered with the markdown converted to html for example. When you click on this textblock it gets converted to an editable textbox again. However with this approach I would loose all the features a single textbox has, like ctrl+z etc. Anybody has some idea how I could manage the live rendering of markdown?...

App Insights vs Azure Monitor (OpenTelemetry)

I am wanting to know what the difference is here, I was reading this document here. and was just trying to make sure I was understanding this correctly.
From my understanding this is just a different way of monitoring and logging based on the OpenTelemetry standard?...

Custom Memory Allocator

I need to manage millions of rather long lived (minutes to weeks) byte arrays that contain hundreds of KBs in memory. I need to be able to release the arrays if the memory pressure is too high and then reuse the RAM for arrays with other sizes. It is an in-memory database , which contains hot data from multiple TB of disk storage. Since a lot of IO is involved a lot of async functions are called and I can not make sure that the thread allocating is also the thread releasing memory. I think doing...

Im pretty new to c#

i wanted to make a progamm with no real purpose but even that i have not enough knowlage i wanted to make a program that does that: Progress bar when strarted random prograss labe that updates after reaching 100% chanching to form2...

โœ… array of methods

i am trying to create an array of methods, and those methods have parameters. is it possible to create an array with methods which may have 0, 1, and 2 parameters? they also have return values, and are meant to return ints when called
No description

ASP.NET Data Error

Unable to fix this error
No description

Null Literal and NUll reference problems

Hey guys, Beginer at using Files here. Im running into 2 errors while trying to read the contents of a text file, then putting the contents into a consructor....

Mercado Pago integration in .Net Clean arquitecture

Hey, i need help to implement mercado pago sdk in my back end proyect. If anyone knows how to do it I would appreciate his help.

โœ… How does the button know what to do?

Hey, new to C# and wrapping my head around following MVVM. Can someone help me understand how the button knows what to do here? When adding a new button or data binding, they all trigger each other (if that makes sense...). Will any button trigger all data bindings unless otherwise set with like a command relay or something? XAML: ```xml <TextBlock Text="{Binding DisplayText}" Background="LightGray" Margin="10"/> ...