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
113
votes
5 answers

Convert JObject into Dictionary. Is it possible?

I have a web API method that accepts an arbitrary json payload into a JObject property. As such I don't know what's coming but I still need to translate it to .NET types. I would like to have a Dictionary so that I can deal with it…
tucaz
  • 6,524
  • 6
  • 37
  • 60
113
votes
15 answers

How to flatten tree via LINQ?

So I have simple tree: class MyNode { public MyNode Parent; public IEnumerable Elements; int group = 1; } I have a IEnumerable. I want to get a list of all MyNode (including inner node objects (Elements)) as one flat list Where…
myWallJSON
  • 9,110
  • 22
  • 78
  • 149
113
votes
15 answers

What reference do I need to use Microsoft.Office.Interop.Excel in .NET?

I am interested in using C# to manipulate/Automate Excel files. After browsing the web I have found VSTO but it seems you can not use that in Visual Studio Express Edition so I can not use that. Just few minutes ago I noticed a question in this site…
user850010
  • 6,311
  • 12
  • 39
  • 60
112
votes
10 answers

Are there any cases when it's preferable to use a plain old Thread object instead of one of the newer constructs?

I see a lot of people in blog posts and here on SO either avoiding or advising against the usage of the Thread class in recent versions of C# (and I mean of course 4.0+, with the addition of Task & friends). Even before, there were debates about the…
Tudor
  • 61,523
  • 12
  • 102
  • 142
112
votes
5 answers

dynamic does not contain a definition for a property from a project reference

I am getting an error that says: 'object' does not contain a definition for 'Title' all the code is also on github I have a ConsoleApplication1 that looks like this namespace ConsoleApplication1 { class Program { static void…
eiu165
  • 6,101
  • 10
  • 41
  • 59
112
votes
9 answers

How do I handle Database Connections with Dapper in .NET?

I've been playing with Dapper, but I'm not sure of the best way to handle the database connection. Most examples show the connection object being created in the example class, or even in each method. But it feels wrong to me to reference a…
Donald Hughes
  • 6,627
  • 8
  • 35
  • 46
112
votes
6 answers

BCL (Base Class Library) vs FCL (Framework Class Library)

What's the difference between the two? Can we use them interchangeably?
Joan Venge
  • 315,713
  • 212
  • 479
  • 689
112
votes
5 answers

What's the difference between Uri.ToString() and Uri.AbsoluteUri?

As a comment to an Azure question just now, @smarx noted I think it's generally better to do blob.Uri.AbsoluteUri than blob.Uri.ToString(). Is there a reason for this? The documentation for Uri.AbsoluteUri notes that it "Gets the absolute URI",…
Jeremy McGee
  • 24,842
  • 10
  • 63
  • 95
112
votes
5 answers

Filtering fiddler to only capture requests for a certain domain

I'm not sure how to modify the CustomRules.js file to only show requests for a certain domain. Does anyone know how to accomplish this?
CVertex
  • 17,997
  • 28
  • 94
  • 124
112
votes
4 answers

What's the difference between the WebConfigurationManager and the ConfigurationManager?

What's the difference between the WebConfigurationManager and the ConfigurationManager? When should I use one over the other? UPDATED I just looked at the WebConfigurationManager, and for some reason, you can't access the connection strings as you…
John B
  • 20,062
  • 35
  • 120
  • 170
112
votes
5 answers

Post build event execute PowerShell

Is it possible to set up a .NET project with a post build event to execute a powershell script? I am using this script to generate some files. Also can I pass whether it's a debug or release build to script. An example of this would be great.
amateur
  • 43,371
  • 65
  • 192
  • 320
112
votes
4 answers

Get value of a public static field via reflection

This is what I've done so far: var fields = typeof (Settings.Lookup).GetFields(); Console.WriteLine(fields[0].GetValue(Settings.Lookup)); // Compile error, Class Name is not valid at this point And this is my static class: public static…
Omu
  • 69,856
  • 92
  • 277
  • 407
112
votes
4 answers

What is a Portable Class Library?

On MSDN I noticed a section about a Portable Class Library, under Version Information. See System.Object for an example. http://msdn.microsoft.com/en-us/library/system.object.aspx I did a brief Google search and couldn't find anything about the…
mjcopple
  • 1,580
  • 2
  • 13
  • 19
112
votes
17 answers

What is the difference between a reference type and value type in c#?

Some guy asked me this question couple of months ago and I couldn't explain it in detail. What is the difference between a reference type and a value type in C#? I know that value types are int, bool, float, etc and reference types are delegate,…
tugberk
  • 57,477
  • 67
  • 243
  • 335
112
votes
6 answers

How to get the location of the DLL currently executing?

I have a config file that I need to load as part of the execution of a dll I am writing. The problem I am having is that the place I put the dll and config file is not the "current location" when the app is running. For example, I put the dll and…
Vaccano
  • 78,325
  • 149
  • 468
  • 850