Category "c++sharp"

How to save treeview xml correctly when I edit it in winfroms?

Let's say. If I have this kind of xml file. <Main> <group name="R1"> <IsUser>Example</IsUser> <IsUser>Example2</IsUse

Sockets in Unity

I'm working on a project that requires me to connect to an outside server from my oculus app, I want to do this via pushing a button. I have pretty limited C# k

Helix Toolkit in c# displaying ply point cloud

I have made a ply file with the help of this wrapper. How I made the ply file is shown below: using (var frames = pipeline.WaitForFrames()) { var colorFrame

Servicestack.Redis how to use GetRange feature

I need to use the redis command GETRANGE. I use it this retrieve the hash I store along with the string content, to evaluate if this latter has been changed whi

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