C#

C

C#

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

Join

Trouble Setting up double controllers in a single MVC .net project, API controllers and MVC controll

Hi all, Hope so you are having a good one. So basically its a complete web solution which also have a mobile application in the flutter, now for that reason I need to have API controllers. I am bound to use one project, to avoid double hostings and other complexitites that might come along the way. What I did is Created MVC .net project set up API controllers in it about auth and stuff...

โœ… very simple fix, im just not smart enough.

hey, could someone tell me how to get rid of that blue highlighting when you hover over a button in wpf? would really help thanks ๐Ÿ™‚

Noob C# enjoyer building a project from other people

hello, i git cloned a project from github and iam using vscode i already installed c# and c# dev kit, the project has .csproj and .sln but iam not sure how to build using vscode, the project iam trying to run on vscode: https://github.com/BoyBaykiller/Newtonian-Particle-Simulator
No description

Where i should use async await?

I have two methods. One of these will be used from "public async Task<int?> SomeASPNETControllerPostMethodAsync()". Should i use await async everywhere or only in Controllers? Which one is the best for performance?...
No description

Edit view directs to 404 not found

A beginner's mistake - the problem is that i have been getting Site Not Found 404 error (as per screenshot) while I wanted to display the edit dashboard view on localhost:https://imgur.com/a/mw5wBkD i think the connection between my view (html and js) and controller has gone wrong: https://pastebin.com/n4cfnwLp Could anyone kindly point out what I have been missing out here?...

RapidApi

Hello! I was thinking of starting to use RapidAPI to sell some API's. Is anyone here using RapidAPI that would like to talk to me about this platform? I have some questions about it Thank you!...

โœ… Help to display a label on top of a picture box

I have been struggling to make a label show up on top of the corresponding picture box with the setup below: private FlowLayoutPanel CreateImagePanel() { //setup panel inside flow layout panel ......

.Net Maui Prebuild executes multiple times

Hi, So I am working on a .Net maui desktop app, and I need to run a .bat file for some automation before the app gets build. Problem is that it gets executed for every platform the app builds, while I only need it to be executed once. Any ideas if this is possible?...

Proper way to deploy application?

So right now I scp my entire project to the CVM, build and then docker compose up The scp parts takes absolutely forever it's outrageous (project is about 117+mb) Am I stupid and just doing this wrong? Am I missing something? I haven't explored CICD pipelines yet...

โœ… Looking for help using XMLRPC with a dotnet core WebAPI Project.

Any pointers to example on how to use XMLRPC with a webapi project (ideally I'd like to support both XML and JSON payloads). I saw something like this done with Swagger years ago but now I need it with a C# Project and not finding examples or docs for how to set it up.

Why lambda is faster than other approaches?

I've been working on some algorithm and discovered that if the Sort function uses a lambda comparer, it is faster than if it uses a comparer type. So I run this test with BenchmarkDotNet and the result really puzzles me. Why is that? https://gist.github.com/laicasaane/d51193a0a4aff7c6df6c1bb89a66bdc9...

created a basic C# .NET WinForms app to clean system files like temp, prefetch, and cache.

How can I allow users to choose which files they want to clean (like just prefetch) by checking a checkbox?

wpf elements with a vertical alignment of top aren't exactly at the top and have a weird gap.

Hello, I have a window with the button at the top and I noticed that they aren't sticking to the top and have a weird gap in between the top and them, I believe it's most likely related to the grid but I can't find out why.
No description

Custom JsonConverter to apply to interface or abstract class, anyone ?

``` // public class ISerilizableStateConverter : JsonConverter <<< I need to write some custom Converter that will when doing // serializing take Type of implementing class and put it in Json, example ResolveToType:"TestClass1" and when de-serializing // read that ResolveToType and create instance of that implementing class // So if i have ISerilizableState currentState i can apply serializing and de-serializing and not get error, atm i get ...

i am beginer, where do i find what is inside the method for example File.ReadAllLines

where do i find what is inside the method for example File.ReadAllLines

Optimizing Large i18n Loading in Blazor

Hello everyone, I am currently experiencing some performance issues during application startup. We are using Blazor Wasm and we are loading a large json file with a lot of language keys (about 4.5MB) during startup. The result is obviously a freezing UI while the language keys are loaded (about 2-10 sec depending on the device performance). We have already tried to use local storage as a cache layer, but serialisation still needs to be done. How do you deal with such a case? I think I am not the only one with a lot of language keys....

How to stop audio from overlapping

Complete begginer, used to make games a while back but they were increadibly simple, took a very long break and now I came back. I am making a clicker in unity, when spamming the button the audio will just start overlapping. Is there a way to limit the amount of audio playing at once?

Dynamic client certificates without socket exhaustion

I have a server that is called by users passing in a representation of a client cert that is then used to call some dependent APIs using that client certs context. HttpClientFactory doesn't seem to support dynamically supplying certificates without awareness of their existence prior to the call. What would be the best practice to implement this to avoid socket exhaustion? Just looking for a point in the right directions....

whats the problem?

when i type <Button> it says invalid mark up but when i type <Button></Button>it shows a button?