Tag: io

49 votes
14 answers
3K views
How can I save application settings in a Windows Forms application?

What I want to achieve is very simple: I have a Windows Forms (.NET 3.5) application that uses a path for read

avatar
Karolyn
0 1 0 9
asked 07 September, 2021
58 votes
8 answers
2.1K views
Combining two expressions (Expression<Func<T, bool>>)

I have two expressions of type Expression<Func<T, bool>> and I want to take to OR, AND or NOT of t

avatar
Kisha
0 1 0 9
asked 07 September, 2021
56 votes
6 answers
2.1K views
Convert string[] to int[] in one line of code using LINQ

I have an array of integers in string form: var arr = new string[] { "1", "2", "3", "4" }; I need to an arr

avatar
Karolyn
0 1 0 9
asked 07 September, 2021
51 votes
12 answers
1.6K views
Deserializing JSON to .NET object using Newtonsoft (or LINQ to JSON maybe?)

I know there are a few posts about Newtonsoft so hopefully this isn't exactly a repeat...I'm trying

avatar
Clarice
0 1 0 9
asked 07 September, 2021
63 votes
17 answers
3K views
Using LINQ to concatenate strings

What is the most efficient way to write the old-school: StringBuilder sb = new StringBuilder(); if (strings.C

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
56 votes
4 answers
1.1K views
Convert Linq Query Result to Dictionary

I want to add some rows to a database using Linq to SQL, but I want to make a "custom check" before adding the

avatar
Kurtis
0 1 0 9
asked 07 September, 2021
55 votes
6 answers
2K views
LINQ .Any VS .Exists - What&apos;s the difference?

Using LINQ on collections, what is the difference between the following lines of code? if(!coll.Any(i => i

avatar
Virgil
0 1 0 9
asked 07 September, 2021
60 votes
22 answers
990 views
Retrieving Property name from lambda expression

Is there a better way to get the Property name when passed in via a lambda expression? Here is what i currentl

avatar
Robyn
0 1 0 9
asked 07 September, 2021
49 votes
10 answers
1.2K views
Which method performs better: .Any() vs .Count() > 0?

in the System.Linq namespace, we can now extend our IEnumerable's to have the Any() and Count() extension

avatar
Luis
0 1 0 9
asked 07 September, 2021
60 votes
23 answers
2K views
Html.ActionLink as a button or an image, not a link

In the latest (RC1) release of ASP.NET MVC, how do I get Html.ActionLink to render as a button or an image ins

avatar
Frederick
0 1 0 9
asked 07 September, 2021
62 votes
9 answers
954 views
How to add Web API to an existing ASP.NET MVC 4 Web Application project?

I wish to add an ASP.NET Web API to an ASP.NET MVC 4 Web Application project, developed in Visual Studio 2012.

avatar
Eddie
0 1 0 9
asked 07 September, 2021
55 votes
10 answers
1.7K views
Which version of MVC am I using?

I can't find it for some reason, feeling a little dumb. How do I know? I'm using .net 4 with VS2010.

avatar
Bryan
0 1 0 9
asked 07 September, 2021
59 votes
30 answers
2.3K views
ReSharper "Cannot resolve symbol" even when project builds

My Tools: Visual Studio 2012 Ultimate + Update 1 ReSharper v7.1.25.234 My Solution Build Status: Build Succ

avatar
User demo
0 1 0 9
asked 07 September, 2021
68 votes
30 answers
1.5K views
Visual Studio debugging/loading very slow

I'm at wit's end. Visual Studio is typically painfully slow to debug or just plain load ("start with

avatar
Eddie
0 1 0 9
asked 07 September, 2021
59 votes
19 answers
488 views
How to fix: Handler "PageHandlerFactory-Integrated" has a bad module "ManagedPipelineHandler" in its module list

I am configuring an MVC 3 project to work on a local install of IIS and came across the following 500 error:

avatar
Lashawna
0 1 0 9
asked 07 September, 2021
62 votes
15 answers
549 views
RedirectToAction with parameter

I have an action I call from an anchor thusly, Site/Controller/Action/ID where ID is an int. Later on I need

avatar
Xavier
0 1 0 9
asked 07 September, 2021
49 votes
9 answers
587 views
ASP.NET MVC - Set custom IIdentity or IPrincipal

I need to do something fairly simple: in my ASP.NET MVC application, I want to set a custom IIdentity / IPrinc

avatar
Frederick
0 1 0 9
asked 07 September, 2021
63 votes
13 answers
1.9K views
Html.Partial vs Html.RenderPartial & Html.Action vs Html.RenderAction

In ASP.NET MVC, what is the difference between: Html.Partial and Html.RenderPartial Html.Action and Html.Rend

avatar
Lawanda
0 1 0 9
asked 07 September, 2021
50 votes
30 answers
1.8K views
A potentially dangerous Request.Form value was detected from the client

Every time a user posts something containing < or > in a page in my web application, I get this exceptio

avatar
Patsy
0 1 0 9
asked 07 September, 2021
50 votes
4 answers
804 views
Token Based Authentication in ASP.NET Core

I'm working with ASP.NET Core application. I'm trying to implement Token Based Authentication but ca

avatar
Dorian
0 1 0 9
asked 07 September, 2021