Category "c++sharp"

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´

Programmatic control of virtual desktops in Windows 10

I love that Windows 10 now has support for virtual desktops built in, but I have some features that I'd like to add/modify (e.g., force a window to appear on al

CSHTML WYSIWYG editor/previewer

I wanted to create an Asp.net Application, but I can't find a WYSIWYG editor in Visual Studio or even a Previewer, is the only way to see what your page looks l

How to convert camel case to snake case with two capitals next to each other

I am trying to convert camel case to snake case. Like this: "LiveKarma" -> "live_karma" "youGO" -> "you_g_o" I cannot seem to get the second example worki

How do I get back the key for a newly inserted record using Dapper.Contrib?

I have code like this: db.Insert(myObject); The key for the type myObject is of type System.Guid which is auto generated by RDBMS. I then want to insert child

StateHasChanged for specific component instead rerender all components in a page

I am using multiple components is my application each are rendered in conditional manner. Is there any possibilities to re-render a specific component alone? My

Replace Text into an existing PDF document in a specific positions in JavaScript & Asp.net MVC?

I have an existing 20-page pdf file. I need to extract data from our database and incorporate it into a pdf document for specific positions. I did research on G

Posting form file to ASP .NET Core API using AWS SDK Test Lambda Context and APIGatewayProxyRequest

I have an ASP .NET Core API endpoint which accepts the below model: public class FileUploadModel { public IFormFile? File { get; set; } public DateTime?