Category "c++sharp"

Mock gRPC Response Stream for unit testing - C#

I have a function that calls a gRPC endpoint, converts the objects into POCO objects and returns them as a list. public class ActionPlanConnectionsService : ICo

Coloring the first and last rows in a datagrid WPF C#

Can you guy tell me a great way of coloring the last row in a datagrid in WPF, I have to color the first and last rows, I found a way to do the first one by doi

How to print out documents on a list which is datasource of DGV C#

my app has a DataGridView where all selected files get listed and added to a class which is the datasource of the DGV. public partial class Form1 : Form {

Same type-name exists in both Aero and Aero2

I am updating several projects from .net framework 4.7.2 to .net6, using the excellent upgrade-assistant tool. Sometimes I get this error: Error CS0433 The ty

c# Firesharp - How to update a single value of an object?

I have a c# project and I'm trying to update a single value of an object using FireSharp. However, when I do, it deletes the other objects that are strings. tld

Filter List inside List Linq

I have list say list of customers and inside each list there is another list of orders Class Customer { int ID, string Name List<Order> orders } Class Or

I have problems connection to Soap with Authentication

i'm trying to connect my project to SoapUI with an authentication. I am connected to my WS but after reading lots of documents I can´t understand how to c

C# HiQ Html to PDF Performance Issue

I'm working on a reporting project in C# that uses Razor pages to generate HTML and HiQ to convert the HTML to PDF. It's been working just fine until we added a

NET 5 and EF: how to use AddPooledDbContextFactory in liu of DbContext in services

I recently came across AddPooledDbContextFactory concept as part of my NET 5 self-education piece and am keen to implement it properly. However, I am not sure h

Generically Register All Concrete types for Lazy Loading in DI

I want to setup Lazy Loading of registered types in a generic way that does not require me to register each one individually. I can create an extension method t

C# REST API File Upload from Client Code gets 400 Bad Request

I have a Rest API written in .Net core that accepts a File as input as Multipart/Form-data. The API works absolutely fine when I run it from Swagger/Postman. He

MemberNotNullWhen (or other code analysis attributes) for inherited members?

I have a class: public abstract class InvestorAccount { public bool IsRegistered => ...; } And a subclass: public class PrivateInvestorAccount : Investo

`Failed resolution of: Lcom/google/android/datatransport/TransportFactory` when using Xamarin.Firebase

I'm creating a .NET MAUI application using the current preview 11. When I tried to implement Push notifications I added the Xamarin.Firebase.Messaging package a

What is the best practice to handle long external process in ASP.NET page?

An example will be something like: User clicks a button on a webpage I created with ASP.NET. My app calls an API hosted on a third party server. The user sees

How to save values in appsettings.json fetched from UI display

For UI, I am using Extjs, for server side, C#. My problem is i have a appsettings.json property under HubSettings, LiveStream is the property and it has Url, an

Binding section from appsettings.json to options

So I was trying to follow the Microsoft Docs, Options pattern in ASP.NET Core however for the life of me I can't seem to correctly get the "AppSettings" section

.NET Worker Service: Failure processing application bundle, bundle header version compatibility check failed

I've developed a Worker Service in .NET (.NET 5) which runs successfully. I'm then publishing the application using the following publish command. dotnet publi

Specifying cs file to build with dotnet CLI

Suppose I have two files in my current working directory: // file1.cs Console.WriteLine("file1"); //file 2.cs Console.WriteLine("file2"); In powershell, I do

New controller does not respond to requests

I created a new project from the ASP.NET Core Web API template in Visual Studio, and attempted to add a new controller, but I get a 404 response with this messa

404 error after scaffolding identity library of an ASP.NET Core 6 MVC project

I am using .NET 6. Every time I scaffold Identity, the application stops working. My Startup class is like this: using BulkBook.Data.Data; using BulkBook.Data.R