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
108
votes
18 answers

Is there a string math evaluator in .NET?

If I have a string with a valid math expression such as: String s = "1 + 2 * 7"; Is there a built in library/function in .NET that will parse and evaluate that expression for me and return the result? In this case 15.
Guy
  • 65,082
  • 97
  • 254
  • 325
108
votes
5 answers

What's the false operator in C# good for?

There are two weird operators in C#: the true operator the false operator If I understand this right these operators can be used in types which I want to use instead of a boolean expression and where I don't want to provide an implicit conversion…
Jakub Šturc
  • 35,201
  • 25
  • 90
  • 110
108
votes
5 answers

Windows SDK 7.1 Setup failure

I am trying to install Windows SDK for Windows 7 with .NET Framework 4 but when I open the setup I receive an error: Some Windows SDK components require the RTM .NET Framework 4. Setup detected a pre-release version of .NET Framework 4. If you…
dngadelha
  • 1,314
  • 2
  • 11
  • 14
108
votes
7 answers

C# DateTime.Now precision

I just ran into some unexpected behavior with DateTime.UtcNow while doing some unit tests. It appears that when you call DateTime.Now/UtcNow in rapid succession, it seems to give you back the same value for a longer-than-expected interval of time,…
Andy White
  • 86,444
  • 48
  • 176
  • 211
108
votes
11 answers

Why can't a 'continue' statement be inside a 'finally' block?

I don't have a problem; I'm just curious. Imagine the following scenario: foreach (var foo in list) { try { //Some code } catch (Exception) { //Some more code } finally { continue; …
lpaloub
  • 868
  • 2
  • 8
  • 21
108
votes
9 answers

Access private field of another object in same class

class Person { private BankAccount account; Person(BankAccount account) { this.account = account; } public Person someMethod(Person person) { //Why accessing private field is possible? BankAccount a =…
Nageswaran
  • 7,481
  • 14
  • 55
  • 74
108
votes
5 answers

.NET console application exit event

In .NET, is there a method, such as an event, for detecting when a console application is exiting? I need to clean up some threads and COM objects. I am running a message loop, without a form, from the console application. A DCOM component that I…
user79755
  • 2,623
  • 5
  • 30
  • 36
107
votes
4 answers

MsDeploy is returning 403 forbidden

We had a Web Application working on an intranet and I'm trying to publish it to the internet using Visual Studio 2010. The destination server is running iis7 and the Web Management Service is running. On Visual Studio 2010 my service URL…
dcarneiro
  • 7,060
  • 11
  • 51
  • 74
107
votes
10 answers

Why C# implements methods as non-virtual by default?

Unlike Java, why does C# treat methods as non-virtual functions by default? Is it more likely to be a performance issue rather than other possible outcomes? I am reminded of reading a paragraph from Anders Hejlsberg about several advantages the…
Burcu Dogan
  • 9,153
  • 4
  • 34
  • 34
107
votes
10 answers

The SqlParameter is already contained by another SqlParameterCollection - Does using() {} cheat?

While using the using() {} (sic) blocks as shown below, and assuming that cmd1 does not live beyond the scope of the first using() {} block, why should the second block throw an exception with the message The SqlParameter is already contained by…
John Gathogo
  • 4,495
  • 3
  • 32
  • 48
107
votes
7 answers

How can I bring my application window to the front?

How to bring my application window to front? For example whan my app needs attention. This is for my personal program. I need that functionality. This is what I got. But it's NOT working 100% times. public void BringToFrontToEnterCaptha() { if…
Hooch
  • 28,817
  • 29
  • 102
  • 161
107
votes
2 answers

Odd return syntax statement

I know this may sound strange but I don't know even how to search this syntax in internet and also I am not sure what exactly means. So I've watched over some MoreLINQ code and then I noticed this method public static IEnumerable
kuskmen
  • 3,648
  • 4
  • 27
  • 54
107
votes
7 answers

Create web service proxy in Visual Studio from a WSDL file

My application needs to talk to a web service that hasn't got an online WSDL definition. The developers however supplied me with a WSDL file. With a public WSDL Visual Studio can generate this code for me using the Service Reference wizard. But it…
Anne
  • 1,073
  • 2
  • 8
  • 4
107
votes
3 answers

NameValueCollection vs Dictionary

Possible Duplicate: IDictionary or NameValueCollection Any reason I should use Dictionary instead of NameValueCollection? (in C# / .NET Framework) Option 1, using NameValueCollection: //enter…
frankadelic
  • 20,543
  • 37
  • 111
  • 164
107
votes
4 answers

ASP.NET MVC security patch to version 3.0.0.1 breaks build

After installing the ASP.NET MVC 3 security update KB2990942 it appears the MVC version increased from 3.0.0.0 to 3.0.0.1. This causes Visual Studio to no longer find the reference.
usr
  • 168,620
  • 35
  • 240
  • 369
1 2 3
99
100