Category "c++sharp"

C# properties and "tostring" method

I was trying to understand properties better and I came across this page with this example: https://www.tutorialspoint.com/csharp/csharp_properties.htm using Sy

How to do a for loop in html(razor) using c#

Hello guys i am trying to create a table with all information i have taken from an api in .cshtml.cs and to show them in the html page. But i can't quite figure

Synchronously acquiring the Response.Content of asynchronous HttpClient.SendAsync, in .NET Standard 2.0

How can I properly extract an HttpResponseMessage Content property (of type HttpContent) in .NET Standard 2.0 plain synchronous manner, acquired after using asy

Elastic Search Upgrade Nest.dll 7.17.1

After upgrading Nest.dll from 6.8 to 7.17.1 I'm getting the following runtime exception after executing this piece of code: if (client.Indices.Exists(IndexName)

Await not returning in SpecFlow async test step

I'm having trouble with some async SpecFlow unit tests where an await is never returning. I think that it is to do with the SpecFlow SynchronizationContext, but

Difference between Garbage Collection and a For Loop destroying objetcs

I have this code that creates 5500 objetcs of a class and then it outputs the the total allocated bytes and total memory so that way I can see the changes in th

Get the JSON Schema's from a large OpenAPI Document OR using NewtonSoft and resolve refs

I'm currently looking extracting all of the JSON Schemas from a large OpenAPI spec. I've been using the following NuGet packages: Microsoft.OpenApi v1.3.1 Micro

Multiple SQL Server statements do not work on same form

I am working on a C# project with a Microsoft SQL Server database. This is how I have connected the database: DataSet ds_display = new DataSet(); SqlDataAdapte

Outlook VSTO - Get all items in a group calendar

I am looking for a way to access a group calendar in Outlook VSTO Add-In. I am only able to search the default calendar in outlook. I have shared an image from

Any way to make use of ImageClassificationInstance in C#?

I keep getting Grpc.Core.RpcException: Status(StatusCode="Unimplemented" ... exception when I try to use the ImageClassificationInstance objects to classify usi

Decoding API data with RestClient

I am not entirely sure how to do this or really where to begin, I can't seem to find any information pointing me in the correct direction. I am calling an API a

ASP NET Core 6 MVC Slow page loading

I am trying to upgrade an old ASP .NET project from Framework 4.5 to Core .NET 6. Going well so far, but I noticed the page loading was way longer than before.

Random minvalue cannot be greater than maxvalue

I am trying to make a console based application in which the program will subtract two random numbers from a range provided by the user but when i enter the val

DataSet Parent-Child Nested Relation in Blazor

Is DataSet Parent-Child nested relation available in blazor? if yes, how to apply or use it? Thanks.

Reading a XML file using C# not working for some xml files

I need to read following xml file. I've used XML and LINQ but neither of them show any values.I can't find any mistakes on the code. I've followed This example

When I try to print the copy string on console then instead of string they show me some "Element (id = 5131abe8-3c52-4e18-8eb6-3abedb48e19d)"

IWebElement link = driver.FindElement(By.XPath("/html[1]/body[1]/div[3]/div[1]/div[1]/div[1]/div[2]/div[1]/button[1]")); link.Click(); S

How to elevate my winform privileges (at runtime) to admin on button press

I am developing an application that should not require elevated privileges unless the user wants to change a network adapter's IP address. I would like to allow

Writing multithreaded code to generate incremental index

I want to write a code in following scenario : we want to design an invoice generator.this invoice generator also generates an incremental invoice no .Also note

C sharp code terminates without exception

I have this code: public static bool Run(IntPtr handle, IntPtr imethodName, IntPtr iobject, IntPtr itransaction, IntPtr imethod ) { try { Stri

How to use default interface methods in specific class?

public interface IPrinter { public void Print() { Console.WriteLine("Printing..."); } } public interface IScanner { public void Scan()