Top ".net" questions

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

Should 'using' directives be inside or outside the namespace?

I have been running StyleCop over some C# code, and it keeps reporting that my using directives should be inside …

c# .net namespaces stylecop code-organization
In .NET, which loop runs faster, 'for' or 'foreach'?

In C#/VB.NET/.NET, which loop runs faster, for or foreach? Ever since I read that a for loop …

c# .net performance for-loop
How can I create a temp file with a specific extension with .NET?

I need to generate a unique temporary file with a .csv extension. What I do right now is string filename = …

c# .net temporary-files
What is the correct way to create a single-instance WPF application?

Using C# and WPF under .NET (rather than Windows Forms or console), what is the correct way to create an …

c# .net wpf mutex
Get all column names of a DataTable into string array using (LINQ/Predicate)

I know we can easily do this by a simple loop, but I want to persue this LINQ/Predicate? string[] …

c# .net linq datatable
Reading DataSet

How do I read data from a DataSet in WPF? I have a train schedule table with just 2 columns and …

c# .net wpf ado.net dataset
ASP.Net MVC Redirect To A Different View

Is it possible to redirect to a different view from a controller? For example, all my controllers inherit from a …

.net asp.net asp.net-mvc
How do you UrlEncode without using System.Web?

I am trying to write a windows client application that calls a web site for data. To keep the install …

c# .net urlencode .net-client-profile
How to convert View Model into JSON object in ASP.NET MVC?

I am a Java developer, new to .NET. I am working on a .NET MVC2 project where I want to …

.net javascript asp.net-mvc json
A circular reference was detected while serializing an object of type 'SubSonic.Schema .DatabaseColumn'.

I am trying to do a simple JSON return but I am having issues I have the following below. public …

c# .net json entity-framework subsonic