Top ".net" questions

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

VB.NET: how to prevent user input in a ComboBox

How do you prevent user input in a ComboBox so that only one of the items in the defined list …

.net vb.net combobox
Deciding between HttpClient and WebClient

Our web app is running in .Net Framework 4.0. The UI calls controller methods through ajax calls. We need to consume …

c# .net rest webclient dotnet-httpclient
Visual Studio popup: "the operation could not be completed"

When I try to open a project, local or on a Team Foundation Server (TFS), I get a modal window …

.net visual-studio visual-studio-2015
Creating an empty file in C#

What's the simplest/canonical way to create an empty file in C#/.NET? The simplest way I could find so …

c# .net
The type initializer for 'CrystalDecisions.CrystalReports.Engine.ReportDocument' threw an exception

I am deploying a desktop application to my clients that uses the Crystal Reports API to display and print forms. …

c# .net deployment installshield crystal-reports-2010
How to use ConfigurationManager

I want to use App.config for storing some setting. I tried to use the next code for getting a …

c# .net winforms configuration config
Play audio from a stream using C#

Is there a way in C# to play audio (for example, MP3) direcly from a System.IO.Stream that for …

.net audio stream mp3 naudio
Best Practice for Forcing Garbage Collection in C#

In my experience it seems that most people will tell you that it is unwise to force a garbage collection …

c# .net garbage-collection
How to find the Number of CPU Cores via .NET/C#?

Is there a way via .NET/C# to find out the number of CPU cores? PS This is a straight …

c# .net cpu-cores
System.IO.FileNotFoundException: Could not load file or assembly 'X' or one of its dependencies when deploying the application

I'm having a strange problem with deploying an application, which references an assembly, written in managed c++. I've created an …

c# .net deployment .net-assembly managed-c++