NuGet is the package manager used by .NET to download, restore, and manage package dependencies. Most of the time it works quietly in the background: you add a package, restore the project, and NuGet downloads what is needed. However, NuGet also stores packages and metadata locally. This is good for…
-
-
.NET 6 added a long-missing collection to the base class library: PriorityQueue<TElement, TPriority>. A priority queue is useful when you do not want to process items in the order they were inserted, but in the order of their priority. Typical examples include job scheduling, pathfinding, graph algorithms, simulations, message processing,…
-
SortedSet in .NET manages ordered, unique elements using a custom comparer that defines both sorting order and element uniqueness. A common pitfall occurs when two different instances with the same value are treated as duplicates. To avoid this, a tie-breaker is needed, ensuring both order and distinctness among elements.
-
Scraping content from websites can be a useful tool for gathering information or automating certain tasks. In C#, there are several libraries available that can help make this process easier. In this blog post, we will cover how to use the HtmlAgilityPack library to scrape content from websites in C#.…
-
Scraping dynamic content from websites has become an important task in data collection and analysis. With the advancements in web technologies, websites are now using dynamic content that cannot be easily scraped with traditional web scraping techniques. In this blog post, we will explore how to scrape dynamic content from…
-
File I/O looks like one of those things that cannot be unit-tested properly. A method that reads directories, scans files, compares extensions, and deletes files seems tied to the real machine where the test is running. That creates all the usual problems: tests become slow, fragile, dependent on local paths,…
-
Testing private methods is often debated among developers, as they typically represent implementation details and should not be directly tested. However, there are scenarios in legacy code where testing privately for safety before refactoring is necessary. The preferred approach is to test public behavior or extract complex logic into separate…
-
In the “2016 .NET Community Report” just released by Telerik, the answers to the question “What technology would you choose if building for Windows Desktop?” were as follows: So roughly half of new desktop developments would be based on Windows Forms, a technology declared dead multiple times. The Telerik report…
-
It is not easy to monitor how our code behaves on a vast array of different machines. A myriad of different configurations can lead to errors that are difficult to reproduce and even more difficult to anticipate. And when the customer calls complaining about a crash, provided information on what…