Category "c++sharp"

VSCode won't open console in an external window

I am a beginner in C# just recently learning it soon. Whenever I run my Project.cs file, it does not open in an external terminal despite the launch.json file h

Pad a struct so its size is a multiple of 16 bytes

I'm trying to have my C# struct match up some complex padding and packing rules. Fields should be aligned on 4 byte boundaries. The entire struct should be a mu

Azure Service Bus send message every other time

I've a c# dotnet webjob and a simple desktop app. Sending a message apperaes to work only every other time. serviceBusClient = new QueueClient(_conf

How to get ILoggerFactory in .net 6

In .Net5 ILoggerFactory is used as Configure function in Startup.cs as follows : public void Configure(IApplicationBuilder app, IWebHostEnvironment env, ILogger

.Net Framework 4.6.1 - Web API - HttpResponseMessage.Content is empty for StringContent

Content being returned by HttpMessageResponse is blank/empty after being explicitly set I have created a WebApi with the latest .net Framework 4.6.1 and am try

How to connect ngrok with bot emulator?

I have developed a chatbot in C# and hosted it on our local server. When I'm trying to connect it remotely with ngrok. I get below error: Failed to spawn ngrok

What is the encoding to read and write files with special characters such as en dash, left quotes, etc?

I'm reading csv files that contain special characters such as the long en dash –, left double quotes “, and right double quotes ” and I can't

Problem Changing the value of nested ValueObject using C# 10, .NET 6 and EF Core 6

My Aggregate is like this: public class Order : AggregateRoot { private readonly List<OrderItem> _items = new(); public DateTime Date { get; set;

C#: Save selected outlook message as eml file

I created an add-on for outlook using c#. It is proposed to connect to external Document Management System(DMS) and upload documents/emails into it. And now I w

dotnet run not working after update to dotnet 6

I updated yesterday from .Net 5 to .Net 6 and now my projects can't start with dotnet run. I then get the error: Building... warn: Microsoft.AspNetCore.Server.K

How to hydrate a Dictionary with the results of async calls?

Suppose I have code that looks like this: public async Task<string> DoSomethingReturnString(int n) { ... } int[] numbers = new int[] { 1, 2 , 3}; Suppo

Entity Framework Core: load related data after object is queried

It is clear how to query an entity and include all the related data; e.g.: using (var context = new BloggingContext()) { var blogs = context.Blogs .

Build error: Reference PresentationCore could not be resolved

I have a WPF C# application hosted on GitHub attached to Travis. I configured my .travis-ci.yml this way: language: csharp solution: FaceDetection/FaceDetectio

LINQ query with multiple LEFT JOIN

I have 1 main table and 3 tables for ordering the fields in the main table. I return all these tables as lists. The main table structure is like this: Color Ma

UWP is binded checkbox is checked?

So I created a combobox with inside a few binded checkboxes. My xaml looks like this: <ComboBox x:Name="CbSandwichFilling" ItemsSource="{x:Bind SandwichFill

AutoMapper - Trying to flatten my object property to string but getting an error

I am trying to map my ProductDto to Product class. I get an error when mapping the string property in ProductDto class to a Brand property in the Product class.

How to reuse data in FluentValidation

For example I have validator with two validation rules: // Rule 1 RuleFor(o => o.Email).Must((email) => this.GetDataDataFromDB(email) != 0) .WithMess

Jumping problems. (new coder please be nice)

I was following a tutorial about the basics of making games in Unity. Link to person :https://www.tiktok.com/@individualkex. I came across an issue, when I put

*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