Category "c++sharp"

C#: Helper Method Dependency Injection within Constructor

I have a IData interface that handles the SQL data access logic and as well as retrieving data from SQL Server: public interface IData { Task<IEnumerable&l

Create UML Diagram from C# Project [closed]

I am currently working with a big Library that I did not write myself, there are close to no comments at all and there is no API. Therefore I

How to get Serilog to enrich logs

I've set Serilog to read its config from appsettings.json: return WebHost.CreateDefaultBuilder(args) .UseSerilog((ctx, config) => { config.ReadFrom.Confi

Error "Keyset does not exist" from creating a RSACryptoServiceProvider

My code csp = new RSACryptoServiceProvider(cspParms); causes the error: "Keyset does not exist". string keyContainerName = "abcd"; CspParameters cspParms = ne

WinUI Desktop app publish in app center: Problem occurred while extracting your app

I am trying to upload a WinUI desktop package in appcenter, but i am facing a below issue when uploading the packages. In addition, I have tried some other app

How to send Scorlllock key event using C#

I have two machines which use a KVM to share one mouse and keyboard. When switch to another machine, I have to press keys ScrollLock + ScrollLock + num. I'm try

C# MySQL SSL Connection Error when trying to use conn.Open()

For the past 3 days now I have been struggling with an issue with MySQL connector in C#. Basically, I follow the MySQLConnector tutorial to open my connection

How to use localization with data annotation in a separate DTO Assembly (Asp.net Core Web Api)

I have: a Dto.Library (.Net 5 Library) a SharedResourceLibrary with Resource.resx (.Net 5 Library) How can i use the Resource File Messages in conjunction with

How to send Scorlllock key event using C#

I have two machines which use a KVM to share one mouse and keyboard. When switch to another machine, I have to press keys ScrollLock + ScrollLock + num. I'm try

Dispose ReaderWriterLockSlim after ExitWriterLock

I have a function to clean up some objects as well as the ReaderWriterLockSlim. But I need the ReaderWriterLockSlim to lock as writer lock to prevent the other

ASP.Net core - blank response when returning a JObject property

I am using ASP.Net core 5.0 and want to return IEnumerable of an object as Action method response. Here is the response class: public class TestResponse { p

Unity Android App Bundle Builds sometimes have double size

We are using Google's App Delivery package in our game to escape APK download size limit. First a few builds were completely fine. But later, our download sizes

What is a NullReferenceException, and how do I fix it?

I have some code and when it executes, it throws a NullReferenceException, saying: Object reference not set to an instance of an object.

Unity: Convert Vector2 to Vector2Int

I have a Vector2 and I want to convert it into a Vector2Int. I know I could convert the Vector2 with something like this: Vector2 v2 = new Vector2(10, 10); Vec

How to change the morphTime at runtime?

I copied the whole switch/case part to the Update to be able to change the modes also at runtime. but I want also to be able to change the morphTime at runtime

Error 400 - Bad Request an Creating user with Microsoft Graph

I am trying to create a new user in my tenant using Microsoft Graph (v1.0) with help of the Microsoft doc. When I create my user, I always get an error 400 bad

c# two parameters in one parameter in a method

I would like to make one method like this: public void SomeMethod(int myInt,<float or double or MyClass> myFloatorDoubleorMyClass) { } And not only with

Selenium ChromeDriver 101.0.4951.41 cannot start DevTools

Hi. I tried upgrade my chromedriver to 101.0.4951.41 today and it sudden keep prompt this error to me. Anything I missed or what I should add for new version?

Why use AddScoped() instead of AddSingleton()?

Why I should use AddScoped() for my repositories or services? Why not AddSingleton()? I know about differences between them, but dont understand why I shouldn't

how to get Json values which are not in a class using C#?

I have the following problem: I am a C# beginner and I want to create a weather app using the OpenWeatherApi. The response of the api looks like this (it´