Top ".net" questions

Do NOT use for questions about .NET Core - use [.net-core] instead.

How to select only the records with the highest date in LINQ

I have a table, 'lasttraces', with the following fields. Id, AccountId, Version, DownloadNo, Date The data looks like this: 28092|15240000|1.0.7.1782|2009040004731|2009-01…

c# .net linq linq-to-sql
CryptographicException 'Keyset does not exist', but only through WCF

I have some code that makes a call to a third party web service that is secured using X.509 certification. …

.net wcf x509
Update .NET web service to use TLS 1.2

I need to use TLS 1.2 to connect from my .NET web service to another that is going to force TLS 1.2. …

c# .net tls1.2
Error 1053 the service did not respond to the start or control request in a timely fashion

I have created and installed a service a couple of times. Initially it was working fine, but after some changes …

c# .net timer windows-services
Remove items from one list in another

I'm trying to figure out how to traverse a generic list of items that I want to remove from another …

c# .net list
Reading large text files with streams in C#

I've got the lovely task of working out how to handle large files being loaded into our application's script editor (…

c# .net stream streamreader large-files
Shortest way to check for null and assign another value if not

I am pulling varchar values out of a DB and want to set the string I am assigning them to …

c# .net null variable-assignment
What method in the String class returns only the first N characters?

I'd like to write an extension method to the String class so that if the input string to is longer …

c# .net string character
How to find the most recent file in a directory using .NET, and without looping?

I need to find the most recently modified file in a directory. I know I can loop through every file …

c# .net file loops last-modified