Category "c++sharp"

*System.Text.Json* unable to load when VisualStudio is not installed

I have a DLL based on netcoreapp3.1. The DLL references the NuGet package Microsoft.Extensions.Configuration.Json version 5.0.0. If I deploy the DLL to another

Passing a large file stream to MultipartFormDataContent with HttpClient

I'm experiencing a problem when trying to use MultipartFormDataContent with HttpClient with a stream of data. Context I'm trying to upload a large file to ASP.N

C# Combined length of user strings used by the program exceeds allowed limit. Try to decrease use of string literals

When I add a static string property to my class that returns a long string I get this error. In the same project I have added lots of string properties over 20

async Task is being executed immediately instead of asynchronously

I have a Task that should execute asynchronously that is executing synchronously. I'm not entirely sure why it's happening, and it seems to follow the example f

What is the best way to perform partial updates in EF core and never update certain properties?

I know you can do something like var myObj = _db.MyTable.FirstOrDefault(x=>x.Id==id) and then update myObj property by property that you want to update but i

Link not rendering when using asp-page TagHelper

I have one page that does not render a link in HTML when using the asp-page TagHelper. I have seen this before, but it was due to a typo or the page not existi

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