We could abort a Thread like this: Thread thread = new Thread(SomeMethod); . . . thread.Abort(); But can I abort a Task (in .Net 4.0) in the same way not by
I want the example controller below to return a status code 418 with no contents. Setting the status code is easy enough but then it seems like there is somethi
I have to draw a circle with N meters diameter around some geolocation. I could able to generate coordinates for vertically oriented ellipse only. C# using NetT
I have a really strange issue (And I have a really strong suspicion - that it will be on the IIS side). I have .NETCORE6 application, which uses Selenium via IH
I have a simple console app written in C#. I want to be able to detect arrow key presses, so I can allow the user to steer. How do I detect keydown/keyup even
The below is my code, the PrimarySmtpAddress use 50ms which need more than 15 s to load more 300 users. I am not familiar with Outlook API, and it seems this Pr
What is the difference between a DateTime and a DateTimeOffset and when should one be used? Currently, we have a standard way of dealing with .NET DateTimes in
I'm trying to create a ASP.NET Core MVC test app running on OSX using VS Code. I'm getting a 'view not found' exception when accessing the default Home/index (o
My Windows service needs to create/remove certain rules from the Windows firewall. For this I interface with NetFwTypeLib in <windows>\system32\hnetcfg.dl
i'm using razor's listboxfor for the first time, but my Model is always null. after reading similar posts and tryouts it still won't work. Person.cshtml @mode
I have a customers Class with properties and methods defined. At present it contains methods for any type of task associated with Customers. For example, it con
I'm trying to write some WMI in my windows form and the ManagementObject is givin me the "The type or namespace name 'ManagementObject' could not be found" Er
I need to change the icon in the application I am working on. But simply browsing for other icons from the project property tab -> Application -> Icon, it
I have an external library that does long running I/O. I wish to create a multithreaded application that will use ThreadPool to limit simultaneous number of thr
I'm trying to measure the elapsed time in milliseconds between keypress events using a dispatch timer but when declaring a dispatch timer to have an interval of
In C# what is the performance cost of using the new keyword? I ask specifically in relation to games development, I know in C++ it is a definite no-no to be new
Is it ok to call GetHashCode as a method to test equality from inside the Equals override? For example, is this code acceptable? public class Class1 { pub
Why does this: class OutOfMemoryTest02 { static void Main() { string value = new string('a', int.MaxValue); } } Throw the exception; but
Hi I am using EF 4 and EntityDataSource in a Page (WebForms). This page contains a DropDownList that display UserName. Data from this DropDownList it is from "
Ok, I am having a hard time trying to figure out how to setup a moq for a method that takes in an expression. There are a lot of examples out there of how to to