Questions tagged [.net]

Do NOT use for questions about .NET Core - use [.net-core] instead. The .NET framework is a software framework designed mainly for the Microsoft Windows operating system. It includes an implementation of the Base Class Library, Common Language Runtime (commonly referred to as CLR), Common Type System (commonly referred to as CTS) and Dynamic Language Runtime. It supports many programming languages, including C#, VB.NET, F# and C++/CLI.

The .NET Framework is not specific to any programming language. Programming languages from Microsoft, like , , CLI, and , as well as many other languages from other vendors, all use the same .NET Framework.

The .NET Framework includes a large library of functions as part of the Base Class Library (BCL), including those related to user interface design, data access, database connectivity, cryptography, development of web applications, mathematical algorithms, and network communications. This extensive library simplifies development and makes it easy to rapidly develop new applications.

As such, questions like "How do I do file I/O in C#?" should really be "How do I do file I/O with .NET?". Because such a question concerns the file I/O libraries provided by the .NET Framework, it should be tagged with both the tag, and with the tag, to indicate that you'd like the answer to be written in the C# programming language.

See also: , (do NOT use the tag for questions about .NET Core).

Getting help

Versions of .NET

Performance

Garbage collector

Free .NET Programming Books (C# / F# / VB / Nemerle / Visual Studio)

Reference Source

API Guide


Database

Database Drivers

  • MySQL Connector - Connector/Net is a fully-managed ADO.NET driver for MySQL
  • Npgsql - .NET data provider for PostgreSQL
  • MongoDB - Official MongoDB C# driver
  • RethinkDb.Driver - A RethinkDB database driver in C# striving for 100% ReQL API compatibility and completeness.
  • ServiceStack Redis - .NET's leading C# Redis client
  • StackExchange Redis - General purpose Redis client from Stack Exchange
  • Cassandra - DataStax .NET driver for Apache Cassandra
  • Couchbase - Official Couchbase .NET client library, based on the Enyim Memcached client
  • Firebird.NET - The .NET Data provider is written in C# and provides a high-performance, native implementation of the Firebird API

Useful .NET Libraries

Mathematics

  • Math.NET Numerics - special functions, linear algebra, probability models, random numbers, interpolation, integral transforms and more

Package managers for external libraries

  • NuGet (formerly known as NuPack) - Microsoft (developer-focused package management system for the .NET platform intent on simplifying the process of incorporating third-party libraries into a .NET application during development)

Build Tools

  • Prebuild - Generate project files for all Visual Studio versions, including major IDEs and tools like SharpDevelop, MonoDevelop, NAnt and Autotools

Dependency Injection/Inversion of Control

Logging

Validation

Design by Contract

Compression

Ajax

Data Mapper

ORM

Charting/Graphics

PDF Creators/Generators

Unit Testing/Mocking

Automated Web Testing

Misc Testing/Quality Support/Behavior Driven Development (BDD)

URL Rewriting

Web Debugging

  • Glimpse - Firebug for your webserver

Controls

MS Word/Excel Documents Manipulation

  • DocX to create, read, manipulate formatted word documents. Easy syntax, working nicely, actively developed. No Microsoft Office necessary.
  • Excel XML Writer allows creation of .XLS (Excel) files. No Microsoft Office necessary. It has been a while since it has been updated. It also provides a code generator to create code from already created XLS file (saved as XML). Haven't tested this but looks very promising. The author hasn't updated this in awhile.
  • Excel Reader allows creation/reading of .XLS (Excel) files. No Microsoft Office necessary. It has been awhile since it has been updated.
  • Excel Package allows creation/reading of .XLSX (Excel 2007) files. No Microsoft Office necessary. The author is gone, so it's out of date.
  • EPPlus is based on Excel Package and allows creation/reading of .XLSX (Excel 2007). It is actually the most advanced even comparing to NPOI.
  • NPOI is the .NET version of POI Java project at https://poi.apache.org/. POI is an open source project which can help you read/write Excel, Word, and PowerPoint files. Latest sources available at GitHub repository

Serialization

  • sharpSerializer - XML/binary serializer for WPF, ASP.NET AND Silverlight
  • protobuf-net - .NET implementation of Google's cross-platform binary serializer (for all .NET platforms)

Machine learning

  • Encog C# - Neural networks
  • AForge.net - AI, computer vision, genetic algorithms, machine learning

Chat room

Chat about .NET with other Stack Overflow users

RESTFul Web Services

  • RestSharp - Simple REST and HTTP API Client for .NET

Unclassified

333813 questions
111
votes
10 answers

Use a 'try-finally' block without a 'catch' block

Are there situations where it is appropriate to use a try-finally block without a catch block?
mkus
  • 3,357
  • 6
  • 37
  • 45
111
votes
14 answers

How can I query for null values in entity framework?

I want to execute a query like this var result = from entry in table where entry.something == null select entry; and get an IS NULL generated. Edited: After the first two answers i feel the need to…
Adrian Zanescu
  • 7,907
  • 6
  • 35
  • 53
111
votes
17 answers

Why am I getting this error: No mapping specified for the following EntitySet/AssociationSet - Entity1?

I'm using Entity Framework 4 with the Model First approach. I started the project, designed the entities and generated the database. Everything worked fine. Then I needed to go back and add another entity to my model. However, as I drag an entity to…
Andre Pena
  • 56,650
  • 48
  • 196
  • 243
111
votes
8 answers

When to use IComparable Vs. IComparer

I'm trying to figure out which of these interfaces I need to implement. They both essentially do the same thing. When would I use one over the other?
Micah
  • 111,873
  • 86
  • 233
  • 325
111
votes
7 answers

How can I use escape characters with string interpolation in C# 6?

I've been using string interpolation and love it. However, I have an issue where I am trying to include a backslash in my output, but I am not able to get it to work. I want something like this... var domain = "mydomain"; var userName =…
Matt
  • 1,109
  • 2
  • 7
  • 4
111
votes
13 answers

What is the best alternative IDE to Visual Studio

As I've only ever used Visual Studio for .NET development, I would like to expand my horizons and see what else there is on offer as an alternative to it. So what in your opinion is the best alternative to Visual Studio? Is there a viable…
Darko
  • 38,310
  • 15
  • 80
  • 107
111
votes
3 answers

What's the difference between Console.WriteLine() vs Debug.WriteLine()?

What's the difference between Console.WriteLine() vs Debug.WriteLine()?
Zolomon
  • 9,359
  • 10
  • 36
  • 49
111
votes
6 answers

Disable SSL fallback and use only TLS for outbound connections in .NET? (Poodle mitigation)

I am trying to mitigate our vulnerability to the Poodle SSL 3.0 Fallback attack. Our admins have already started disabling SSL in favor of TLS for inbound connections to our servers. And we have also advised our team to disable SSL in their web…
Jordan Rieger
  • 3,025
  • 3
  • 30
  • 50
111
votes
13 answers

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 (it's like VBA for our internal product for quick macros). Most files are about 300-400 KB which is fine loading. But when they go…
Nicole Lee
  • 1,133
  • 2
  • 8
  • 4
111
votes
8 answers

.NET: Determine the type of “this” class in its static method

In a non-static method I could use this.GetType() and it would return the Type. How can I get the same Type in a static method? Of course, I can't just write typeof(ThisTypeName) because ThisTypeName is known only in runtime. Thanks!
Yegor
  • 2,514
  • 2
  • 19
  • 27
111
votes
0 answers

How to compare 'μ' and 'µ' in C#

I fall into a surprising issue. I loaded a text file in my application and I have some logic which compares the value having µ. And I realized that even if the texts are same the compare value is false. Console.WriteLine("μ".Equals("µ")); //…
D J
  • 6,908
  • 13
  • 43
  • 75
111
votes
1 answer

How does one test async code using MSTest

I'm writing some super simple async code. Just saving a file off-thread. I'd like to test this code using the MSTest unit test framework in Microsoft Visual Studio Team System 2008. How do I do this? I'd like to simple block the test method until…
Kevin Moore
  • 5,921
  • 2
  • 29
  • 43
111
votes
6 answers

How to use await in a loop

I'm trying to create an asynchronous console app that does a some work on a collection. I have one version which uses parallel for loop another version that uses async/await. I expected the async/await version to work similar to parallel version but…
Satish
  • 3,020
  • 7
  • 35
  • 47
111
votes
4 answers

How are nested capturing groups numbered in regular expressions?

Is there a defined behavior for how regular expressions should handle the capturing behavior of nested parentheses? More specifically, can you reasonably expect that different engines will capture the outer parentheses in the first position, and…
Alana Storm
  • 164,128
  • 91
  • 395
  • 599
111
votes
19 answers

Get the decimal part from a double

I want to receive the number after the decimal dot in the form of an integer. For example, only 05 from 1.05 or from 2.50 only 50 not 0.50
user1095549
  • 1,339
  • 3
  • 12
  • 14