Category "c++sharp"

Group elements of the data set if they are next to each other with LINQ

I have a data set (ex. 1, 1, 4, 6, 3, 3, 1, 2, 2, 2, 6, 6, 6, 7) and I want to group items of the same value but only if they are next to each other minimum 3 t

How can i set environment variable for ffmpeg.exe using uwp c# code?

set environment variable for ffmpeg.exe using code in C# UWP?

using Nunit I want to use the Retry Attribute to help my parallel testing in BrowserStack

I am attempting to add the retry Attribute under the Test Fixture in Nunit but it does not appear to work. Can anyone show me how to add this as a try catch? Th

How to call a method on application crash before objects in DI container are disposed? c#

I have a console application that is running in Kubernetes. I want it to send an event through rabbit when it crashes on unhandled exception. Here is simplifie

Logging using Serilog to SQLite sink

I'm not able to make SeriLog work with SQLite sink. My project setup is as follows: Packages I have installed: My SQLite database: My appsettings.json file

Cancellation doesn't go as expected

The while loop currently blocks the thread as it retries forever until the connection is established. I expect it to retry forever but it shouldn't block the th

Connecting to Dynamics Dataverse from Azure Web App - getting "object not set to an instance of an object"

We have an API, written in C# .NET Framework that connects to the OrganizationService and the OrganizationServiceContext of our Dynamics instance. We are gettin

C# WinForms | Can I detect specific Sounds with a Microphone Input and let my program detect that specific sound and respond to it?

I'm currently trying to make a C# programm that simulates a Dial-Up Connection. So this what the programm should do: When I play a DTMF Tone like 212 5678912 or

Draw a "transparent" triangle over dark background in monogame

I am trying to have a "night" effect on my screen, by setting dark background spriteBatch.Begin(); // my objects here spriteBatch.Draw(darkBackground, Vector2

Resize Texture2D (printscreen) with SharpDX

The following question answers how to resize a printscreen taken with SharpDX by a power of two Resizing a DXGI Resource or Texture2D in SharpDX. I'm trying to

LiveChart.WinForms.CartesianChart scrollable

I am developing a C# WinForm application. I am using cartesianchart from LiveChar.Winforms.I want to do a scrollable graph. I added too many items on chart and

How to automatically add a name from selected id in View page from controller ASP.NET MVC

I want to get a name from selected id in my view page First Model public class Transaction { [Key] public int Id { get; set; } [Required] public

Could not load assembly 'CommonBaseData'. Ensure it is referenced by the startup project 'CommonBaseType'

I want create micro service architecture solution so I add some services for my solution. All my services must have one table in my database in there models so

System.Text.Json 6.0.2 Serialize error - trying to load System.Runtime.CompilerServices.Unsafe, Version=4.0.4.1

We are using C# .Net Framework 4.7.2, JsonSerializer in System.Text.Json Version 6.0.2. Solution builds fine. We get a runtime error when Serializing: Could no

Why nullable value type assignment does not fail with "Converting null literal or possible null value to non-nullable type."

In C#10 I was trying to create a Result type that would have an error or a value (without going for monadic stuff). When trying to use it I was expecting a comp

Calling another EXE with C# on Windows fails on target machine

I have created a Windows shell extension that provides a menu to users when they right-click in File Explorer. This then invokes a small dialogue App. I'm a nov

Edit Datagrid in WPF

How I can provide ComboBox to a particular DataGrid Column in wpf when user tries to edit data grid . For example user can change the Operator at run time from

System.Data.SQLite.SQLiteException : SQL Logic Error

A Sqlite Database was created that consists on a persons FirstName and LastName.When the code is executed, System.Data.SQLite.SQLiteException: 'SQL logic error

Get data from a table after having closed the session

In this moment I´m try to get a List of users and checks if the user is in the BD or not I´m using Web API Net 6 and Sql Server This is the code

C#: Append text to text file between two lines

I have in a txt file the following: TOP: BOTTOM: I want to add between those lines strings adding also a newline. How can I do this? The end Result should be