Category "c++sharp"

How do I detect and then base an action off of when one of my generated buttons(from a 2D button array) is clicked

So i am generating buttons like this and what i need to do is make those buttons disappear when they are clicked. { Button[,] buttonArray =

MSBuild not publishing Web.config to the root of the publish folder

I'm running the following MSBuild command from PowerShell to publish a solution file: $Configuration = "Release" $slnFullPath = "...\Solution.sln"; $PublishPath

Blob version information in blob trigger

I currently work on a blobtrigger that gets triggered everytime a blob has been created, a new version of a blob has been uploaded (so a blob has changed) or an

Make a method both static and instance [closed]

I have a class called Foo and a static method - Bar (Foo instance) - inside it. But instead of only being able to call it like Foo.Bar(new Foo

In Expressive Annotations using the AssertThat attribute - how to modify the error message at runtime or pass in string values

In Expressive Annotations, using the "AssertThat" attribute is it possible to modify the error message at runtime? I am working in ASP.NET MVC Classic environme

C# Generic method for getting field names based on attributes

I am trying to make a generic method to be used in a lot of places in my code I can make it work with the following code: public static void GetFieldNames(Syste

I keep getting a "scriptcs" error in my C# code for Unity. Nothing I've seen on the internet is working

here is the code: using System.Collections; using System.Collections.Generic; using UnityEngine; public class CarDrive : MonoBehaviour { [SerializedField]

Check if string exists in list made with data from a csv file

I import data from a csv file and then store it in a list (List<Customer> customers). The data is added to the list by creating and adding objects. The ob

Getting index of selected item in a ListView while WPF MVVM pattern is used

I want to get selected Item from ListView. My view is: <ListView Name="StudentGrid" Grid.Row="1" Margin="1,1,1,1" ItemsSource="{Binding studentList}" Selecte

NuGet pack Could not load file or assembly 'System.Memory, Version=4.0.1.1, Culture=neutral, PublicKeyToken=cc7b13ffcd2ddd51'

I am trying to build a NuGet package from a Framework 4.8 .csproj file for a library. The project compiles fine. I have some unit tests that run fine. I run

A second operation started on this context, Domain Event EF Core 3.1

I'm using Domain Event to update some tables. I have created a class that inherits INotificationHandlers like this: public class DamageTypeEvents:INotificatio

How to write millions of double values into a txt file

I've made a neural network and now I need to save the results of the training process into a local file. In total, there are 7,155,264 values. I've tried with a

How can I sort on nullable DateTime fields? [duplicate]

I have the following line of C# code: dueEvents.Sort((e1, e2) => e1.EventDateGmt.CompareTo(e2.EventDateGmt)); dueEvents is a List. The Eve

Xunit in asp.net core

I'm new at asp.net and moq and xunit test, I want to create a test case for my asp.net project. I have the service file that is CRUD action, I have been written

Blocking main thread with SemaphoreSlim until background event arrives

Yes, I know, there are tons of threads on this topic. I read a lot of them and used them often (more or less) successfully. Now I got an old DLL (programmed in

How can I get Time.time as a fixed integer after an event happens in Unity

I want to display on the screen that the player has achieved their goals in this much time after playing the game. But when I display Time.time it keeps changin

Xunit integration test dotnet 6 System.Net.Http.HttpRequestException : Response status code does not indicate success: 415 (Unsupported Media Type)

Hello I'm learning integration testing and I want to test a 'POST' method from my controller using xunit and WebApplicationFactory But I'm getting this exceptio

how to scale the AKS Deployments using C#

I have tried using the Patch Class to scale the Deployments but unable to do so. Please let me know how to do it. i have researched a lot but no proper docs on

Differences between IQueryable, List, IEnumerator?

I am wondering what the difference between IQueryable, List, IEnumerator is and when I should use each one? For instance when using Linq to SQL I would do some

Float3 array values are different in compute shader than what I sent them to be as from C# script in unity?

So I am using a compute shader in unity to find groups of vertices that overlap (are the same as) other groups of vertices in a Vector3[]. I have a List < Li