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
110
votes
4 answers

Creating threads - Task.Factory.StartNew vs new Thread()

I am just learning about the new Threading and Parallel libraries in .Net 4 In the past I would create a new Thread like so (as an example): DataInThread = new Thread(new ThreadStart(ThreadProcedure)); DataInThread.IsBackground =…
Jon
  • 38,814
  • 81
  • 233
  • 382
110
votes
18 answers

What is the difference between lambdas and delegates in the .NET Framework?

I get asked this question a lot and I thought I'd solicit some input on how to best describe the difference.
ScottKoon
  • 3,483
  • 6
  • 27
  • 29
110
votes
15 answers

Is .NET/Mono or Java the better choice for cross-platform development?

How much less libraries are there for Mono than for Java? I lack the overview over both alternatives but I have pretty much freedom of choice for my next project. I'm looking for hard technical facts in the areas of performance (for example, I'm…
Hanno Fietz
  • 30,799
  • 47
  • 148
  • 234
110
votes
8 answers

How can you do paging with NHibernate?

For example, I want to populate a gridview control in an ASP.NET web page with only the data necessary for the # of rows displayed. How can NHibernate support this?
Ray
  • 187,153
  • 97
  • 222
  • 204
110
votes
7 answers

What is the difference between log4net and ELMAH?

Some people are using ELMAH instead of log4net. What makes it better? I found out about ELMAH in an answer to Stack Overflow question How do I do logging in C#?
IAdapter
  • 62,595
  • 73
  • 179
  • 242
110
votes
9 answers

Monitor vs lock

When is it appropriate to use either the Monitor class or the lock keyword for thread safety in C#? EDIT: It seems from the answers so far that lock is short hand for a series of calls to the Monitor class. What exactly is the lock call short-hand…
smartcaveman
  • 41,281
  • 29
  • 127
  • 212
110
votes
10 answers

Is it safe to check floating point values for equality to 0?

I know you can't rely on equality between double or decimal type values normally, but I'm wondering if 0 is a special case. While I can understand imprecisions between 0.00000000000001 and 0.00000000000002, 0 itself seems pretty hard to mess up…
Gene Roberts
  • 2,192
  • 3
  • 17
  • 16
110
votes
5 answers

No authenticationScheme was specified, and there was no DefaultChallengeScheme found with default authentification and custom authorization

I have a .NET Core 2.0 app and have a problem with authorization. I want to use custom authorization with special requests. Header and standard default authentication. First, I add configuration in Startup.cs: public IServiceProvider…
Galina Melnik
  • 1,947
  • 3
  • 14
  • 19
110
votes
5 answers

Nullable vs. int? - Is there any difference?

Apparently Nullable and int? are equivalent in value. Are there any reasons to choose one over the other? Nullable a = null; int? b = null; a == b; // this is true
Zachary Scott
  • 20,968
  • 35
  • 123
  • 205
110
votes
1 answer

OAuth with Verification in .NET

I'm trying to create a .NET-based client app (in WPF - although for the time being I'm just doing it as a console app) to integrate with an OAuth-enabled application, specifically Mendeley (http://dev.mendeley.com), which apparently uses 3-legged…
John
  • 5,452
  • 8
  • 37
  • 37
110
votes
4 answers

What does Html.HiddenFor do?

Although I have read the documentation on Html.HiddenFor, I've not grasped what is it used for... Could somebody explain its uses and give a short example? Where should those helpers go in the code?
JPCF
  • 2,232
  • 5
  • 28
  • 50
110
votes
26 answers

ASP.Net error: "The type 'foo' exists in both "temp1.dll" and "temp2.dll"

When running a web application project, at seemingly random times a page may fail with a CS0433 error: type exists in multiple DLL's. The DLL's are all generated DLL's residing in the "Temporary ASP.NET Files" directory.
Ben Fulton
  • 3,988
  • 3
  • 19
  • 35
110
votes
10 answers

Change the Target Framework for all my projects in a Visual Studio Solution

I need to change the target framework for all projects. I have many solutions with hundreds of projects. Anything new here or do I have to change every single project?
Ezombort
  • 1,892
  • 3
  • 16
  • 20
110
votes
6 answers

What's the difference between Uri.Host and Uri.Authority

System.Uri has Host, Authority, and DnsSafeHost. MS provides a nice example of when Host and DnsSafeHost are different here. I'd like a similar example/explanation for Host and Authority.
Brian
  • 25,523
  • 18
  • 82
  • 173
110
votes
4 answers

How to show a custom error or warning message box in .NET Winforms?

How can I show message boxes with a "Ding!" sound and a red 'close' button in it? This is what I'm talking about: I'm trying to create some custom errors and warnings, but this: MessageBox.Show("asdf"); doesn't seem to give me any customization…
claws
  • 52,236
  • 58
  • 146
  • 195