Category "c++sharp"

Crossthread databinding in NotifyPropertyChanged for DataGridView Control

When trying to update a displayTimer (duration for how long a specific orderline is taking), I get a Crossthread error in NotifyPropertyChanged for my DisplayTi

Accepting body with generic type

I'm creating a web API that accepts a custom object. This works when someone does a POST request in JSON format. But now I have someone asking if they can post

.NET JsonDeserializer fails when I rename List<> property with JsonProperty

I'm trying to deserialize json that looks like this: { "Total": 1, "Page": 1, "Products": [ { "ID": "524c20a3-a8ec-44f2-9685-311f1f7d1498",

Revit failed to Load ImagePath

i try to Place a Temporary In-Canvas Graphic in Revit like this: var activeUiDoc = document.Application.ActiveUIDocument; var activeDbDoc = activeUiDoc.

Razor Pages Cannot Read File with build action "Content" Properties

I have a resources file name "Index.en-US.resx", initially it was "embedded resources" build action and it worked well in localization. But when it is "embedded

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