Category "c++sharp"

use custom python module in script run from c#

I am trying to run a python script from a c# console application. This c# code works fine until I import our custom python module that in turn imports other mod

c# replace string with many "x" [duplicate]

I am writing a windows form app in C#. I have a label with a random word, e.g. "computer". User has to guess what is this word by guessing let

Unity3d - Trying to change color of Material via C#

I've looked all over for a solution for this and it seems simple enough but I don't understand why I can't change the property of one of the materials located o

Why is web.config getting created on publish not on build the project in Asp.Net Core API?

I have Asp.net Core 3.1 API project. When I build it doesn't create any web.config file, but when I publish the API using VS 2019 in a folder, it creates a web.

LINQ Expression GroupBy Select First

I've got a question on LINQ Expression. I need to replicate the following lambda: var result = processRevisions OrderByDescending(pr => pr.CreatedAt) G

Can't Install Nuget Package

I am trying to install System.Runtime.Handles so I can use SafeAccessTokenHandle and RunImpersonated, however when I try to install the package I get the error

How do I fix a "System.Net.Http.HttpRequestException: TypeError: Failed to fetch" in Blazor WebAssembly?

The code below, runs for about fifteen seconds on the "dataFs = await _Http.GetStreamAsync(BODIST_DATA_HTTPNAME)" line before failing with a "System.Net.Http.Ht

Get PP_E_RPS_REASON_OFFERACTIONS_INVALID error key

I use GraphServiceClient When I try to call: var currentUser = await _graphServiceClient.Me.Request().GetAsync(); It works. BUT when I try to call: var inbox =

EF Core - generic way to merge child records based on current db state and equality

I have a scenario where during an Update request of a parent entity, I have a collection of children entities in my dto, and want to merge them in the DB so tha

ASP.NET MVC - how to zip and download files from database?

I'm new to ASP.NET MVC and I'm trying to figure out how to zip and download files stored in a database. Do I need to zip the files, save them in memory or serv

Get .NET Core JsonSerializer to serialize private members

I have a class with a private List<T> property which I would like to serialize/deserialize using the JsonSerializer. Use of the JsonPropertyAttribute does

Create ikev2 profile using dotRas

I've trying to create ikev2 with special options using doRas1.3 with no success giving error 'entry' contains invalid or conflicting settings. Please verify th

C# Adding a NOLOCK to a user-defined EF query

I have the following user-defined query: var outerRingEntities = await Databases.OuterRing.Set<TOuterEntity>() .As

HttpContext.Request.Form threw an exception of type 'System.InvalidOperationException' - why?

I have a strange problem. We are using C# for an ASP.NET MVC application, and JavaScript with jQuery and Data Tables for the frontend. In the frontend, a part o

Unity: Runtime-Terrain-Editor How to raise a circle

I'm trying to create a terrain editor, that works on runtime. At this point I can raise a square but have problems to raise a circle-shape. I saw this post and

Problem running DAPR with docker-compose in ASP .NET core 3.1

I'm trying to run multiple microservices with docker-compose relying on DAPR to establish communication between them. However, even though developer shell logs

OnItemDataBound in Datalist on how to show and hide labels and linkbuttons

I have a datalist with some labels and link button. I want to hide and show based on some stored procedure. The stored procedures are woprking fine in SQL Serve

How to solve BinaryFormatter Deserialize 3th party object Exception in C#?

In my project, I have a function which is used for loading objects from files: public static ObjectBase LoadObject(string _filePath, string _name) { Object

Why am I getting a SignatureDoesNotMatch error when object key contains grave accent marks?

I have been trying to replicate backup files on S3 bucket and one of my machines, which belongs to french culture, and the images it generated contains grave-ac

Database operation expected to affect 1 row(s) but actually affected 0 row(s) entity framework core

I have the following code try { using (var context = await PrepareDatabase()) { // Update temp roles by removing one row, this