Top ".net" questions

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

Most Useful Attributes

I know that attributes are extremely useful. There are some predefined ones such as [Browsable(false)] which allows you to …

c# .net .net-attributes
How to create a simple proxy in C#?

I have downloaded Privoxy few weeks ago and for the fun I was curious to know how a simple version …

c# .net .net-2.0 proxy
What does CultureInfo.InvariantCulture mean?

I have a string of text like so: var foo = "FooBar"; I want to declare a second string called bar …

.net resharper
Equivalent to 'app.config' for a library (DLL)

Is there an equivalent to app.config for libraries (DLLs)? If not, what is the easiest way to store configuration …

c# .net dll settings app-config
.NET - Get protocol, host, and port

Is there a simple way in .NET to quickly get the current protocol, host, and port? For example, if I'm …

.net asp.net url uri authority
Changing SqlConnection timeout

I am trying to override the default SqlConnection timeout of 15 seconds and am getting an error saying that the property …

c# .net sql-server sqlconnection
How do I create directory if it doesn't exist to create a file?

I have a piece of code here that breaks if the directory doesn't exist: System.IO.File.WriteAllText(filePath, content); …

c# .net file-io
ASP.net Getting the error "Access to the path is denied." while trying to upload files to my Windows Server 2008 R2 Web server

I have an asp.net webapplication that uploads files to a specific folder on the Web server. locally everything works …

c# asp.net .net asp.net-4.0 windows-server-2008-r2
How can I limit Parallel.ForEach?

I have a Parallel.ForEach() async loop with which I download some webpages. My bandwidth is limited so I can …

c# .net asynchronous parallel.foreach
Serialize Class containing Dictionary member

Expanding upon my earlier problem, I've decided to (de)serialize my config file class which worked great. I now want …

c# .net serialization dictionary