Category "c++sharp"

Get XSD from RESTful Web API

I have created simple RESTful Web API with automatic documentation from Swagger on Azure by using C# : namespace WebAPIDemo.Controllers { public class

Where to set custom ClaimsPrincipal for all HttpRequests

I'm porting older application to ASP.NET Core, that uses Windows Authentication (configured in IIS, resp. launchsetting.json). I would like to override the aut

How to type cast of a session object into a class object in c#

i have a class called user. I put that class object into session. My question is, how can i retrieve that object into another page? var user = obj.user; var use

Azure Durable Function: Fan Out vs. Parallel.ForEachAsync

I have to run a function on a list of items. I'm using Azure Durable Functions, and can run the items in parallel using their fan out/fan in strategy. However,

How to fill text with 2 different color/texture

I draw text on top of a image using Path.Addstring and filling it with a color and it works perfectly. Now I would like to split(bisect) the text vertically and

Use dependency injection in static class

I need to use Dependency Injection in a static class. the method in the static class needs the value of an injected dependency. The following code sample demo

Rapid stack allocations vs accessing a single heap allocation

I'm having a situation where I have an array T[] which must be copied in an instant and sent over to a function accepting a ReadOnlySpan<T>. I found two s

Using C# Moq testing getting Parameter count mismatch?

I know there are similar questions but somehow I am not able to figure out the situation in my case. I am getting Paramater count mismatch exception. Here is

CreateDbCommandDefinition in the custom DbProviderServices not called?

I need to intercept the call to the following method of DbProviderServices: DbCommandDefinition CreateDbCommandDefinition(DbProviderManifest providerManifest, D

Azure Kinect DK, Body tracking: Mapping separate avatars on separate skeletons

To recreate my issue, I've setup a project in Unity3d 2020, using this sample project. Here I can successfully map an avatar to a single skeleton. In my project

Redirect to Action not working using MVC asp.net

I have a requirement, where I validate user using Windows Authentication. Till there it works perfectly fine. But when I try to redirect to respective controlle

nanoFramework webserver not recognizing routes with attributes

I have set up an ESP32-WROVER as a web server using the nanoFramework.WebServer library. It fires the route method when I use a route without attributes (//192

ITrackingConsentFeature not working in production

I have a cookie consent banner in my blazor server app, everything works well when building in debug mode, but when I push it into production I get a "Object re

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