Category "c++sharp"

Convert a string to a class type/model in C#

It seems that the default Jason Taylor's clean architecture .net template doesn't allow custom order or filtering. Indeed, the default GetTodosQuery.cs only all

How would I monitor and restart tasks that throw exceptions in C#?

Let's say I have a program that instantiates three tasks that run indefinitely. These tasks are intended to run in parallel. However, lets say these tasks are k

c# failed to connect to websocket server

I'm trying to connect to a websocket server. The reference is here: reference. However, it doesn't work like the example. The code runs to OnError method. The e

The request was aborted: Could not create SSL/TLS secure channel when connecting to an old web service

I need to connect to an old web service. It's a government service so I cannot do anything server side. Firstly, when I try to connect to WSDL through browser,

ASP.NET Core 6 how to access Configuration during startup

In earlier versions, we had Startup.cs class and we get configuration object as follows in the Startup file. public class Startup { private readonly IHostE

The instance of entity type cannot be tracked because another instance of this type with the same key is already being tracked

I have a Service Object Update public bool Update(object original, object modified) { var originalClient = (Client)original; var modifiedClient = (Cli

Set configuration and options from json file for servicebuilder in test project

Hi i am trying to configure and build services in a test project. I have read and built a json file into IConfigurationRoot, and can extracts specific parts ind

WebSockets in C#: How do I read a data frame when the bytes are not what they're expected to be?

I'm learning how the websocket protocol works and using C# to listen and receive some websocket data from a client. I'm using Postman to act as my remote websoc

How to convert HEX string to normal text string C#

We have a keyMaterial HEX string. It looks like this 453F1287225ED9971D389A35F8D1032E7748DD0B88302F7C6C194626D4C8659B000000000E800000000200002000000047C2CA7

Excel VSTO C# change Marker fill color of Chart series always apply only 1 color to multiple series

I am trying to change Marker Fore Color of series 4 and 6 to two different colors, but somehow they have the same color. Please kindly advice series1.Format.Lin

C# How to make a return function?

So i have a question. I'm trying do make a function witch returns a number, but the problem is that i can't convert int to string. My functions looks like this:

Getting "Metadata generation failed" when building C# function app in Visual Studio 2019

Starting with a C# function app created as a new project in VS2019 (16.4.1) and latest Azure libraries (Azure Functions and Web Jobs Tools 16.4.457.38025) from

Store Entity Framework Core SQLite file in project-relative subdirectory

I have an ASP.NET Core 2.0 app using Entity Framework Core and the SQLite Provider. I am trying to store the SQLite database file in a subdirectory (specificall

C# equivalent to Java Robot class

What is the C# equivalent to Java Robot class for mouse pointer movements? As Actions class cannot be used directly for keyboard and mouse. I need to move my mo

C# check object type against multiple types

IS there a way to pass an array of types to the "is" operator? I am trying to simplify the syntax of checking an object against multiple types. Something like

.Net Core 2.0 The view 'Index' was not found

I deployed .net core 2.0 application to IIS and I get the following error. InvalidOperationException: The view 'Index' was not found. The following location

Is there a way to overload commands in Discord.net?

I have two modules for my Discord Bot: The first one is the UserModule, where every commands are, that users can execute, and the second one is the AdminModule,

Converting JObject to a dynamic object

I am calling a REST endpoint from C# and I am receiving json which gets serialized into an object. One of the properties on this object is a dynamic property. T

what is the best way to split string in c#

I have a string that look like that "a,b,c,d,e,1,4,3,5,8,7,5,1,2,6.... and so on. I am looking for the best way to split it and make it look like that: a

'Nullable object must have a value.' for List in LINQ c#

In database I have next model tblWorkItem with next field: public List<xWorkItemItemFailReason> WorkItemItemFailReasons { get; set; } When I am trying